Skip to content

Commit

Permalink
test(cdk/testing): attempt to deflake webdriver tests (angular#27319)
Browse files Browse the repository at this point in the history
The Selenium Webdriver tests for harnesses have been flaky for a while now, because the click coordinates haven't been consistent across test runs. My theory is that it's due to the page being scrolled down on some of them.

These changes attempt to reduce the flakes by making the clicked element fixed.
  • Loading branch information
crisbeto authored Jun 18, 2023
1 parent 5b62817 commit 0416617
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/cdk/testing/tests/test-main-component.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<!-- Note that this element is fixed to avoid flakiness if the page has been scrolled down. -->
<div class="click-test" (click)="onClick($event)" (contextmenu)="onRightClick($event)"
style="width: 100px; height: 100px; background: grey"
style="width: 100px; height: 100px; background: grey; position: fixed; top: 0; right: 0; z-index: 10;"
#clickTestElement>
</div>
<div class="click-test-result">{{clickResult.x}}-{{clickResult.y}}</div>
Expand Down

0 comments on commit 0416617

Please sign in to comment.