karma-runner / karma-runner/karma

Tests pass only in debug mode (with `--browsers=Chrome` flag)

Open
#3,830 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
JavaScript
Stars
12k
Forks
1.7k
PR merge metrics
No merged PRs in 30d

Description

Hi Guys! My angular tests pass only when chrome is running.

In my tests, I operate with the position of the element on the page using the `getBoundingClientRect`, Also I use scrolling to the desired element using `scrollIntoView`. But the tests pass only for those elements that are visible without scrolling (but pass! it means that these methods above are actually working with the `ChromeHeadless` flag).

Expected:
Tests pass with `nx test --browsers=Chrome` and `nx test --browsers=ChromeHeadless`

Actual:
Tests pass only with `nx test --browsers=Chrome`

Could you possible suggest any advice?
Thank you

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the behavior with `nx test --browsers=Chrome` and `nx test --browsers=ChromeHeadless`, focusing on elements that require scrolling. Compare how `getBoundingClientRect` and `scrollIntoView` behave in both modes. Done means the tests pass consistently in both browser configurations, including scrolled elements.

Written by the indexing model from the issue text.

Assessment

Tech stack
angular, javascript
Domain
testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.