karma-runner / karma

Spectacular Test Runner for JavaScript
http://karma-runner.github.io
MIT License
11.93k stars 1.71k forks source link

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

Open skyRoma opened 1 year ago

skyRoma commented 1 year ago

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