Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(QSelect): explicitly ensure elements are visible before clicking #16970

Merged
merged 1 commit into from
Mar 18, 2024

Conversation

n05la3
Copy link
Contributor

@n05la3 n05la3 commented Mar 5, 2024

See the original issue here

The QSelect random failure is probably caused by clicking on an element when it is not yet visible. Even though cypress is supposed to check that an element is visible before clicking, sometimes due to race conditions or for some other reason, the element may be found and clicked when it is not yet visible. So "should('be.visible')" has been explicitly added to ensure tests are deterministic.

The following cypress issue and blog post describe this issue and recommend explicit visibility checks.

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Documentation
  • Code style update
  • Refactor
  • Build-related changes
  • Other, please describe:

Does this PR introduce a breaking change?

  • Yes
  • No

The PR fulfills these requirements:

  • It's submitted to the dev branch (or v[X] branch)
  • When resolving a specific issue, it's referenced in the PR's title (e.g. fix: #xxx[,#xxx], where "xxx" is the issue number)
  • It's been tested on a Cordova (iOS, Android) app
  • It's been tested on an Electron app
  • Any necessary documentation has been added or updated in the docs or explained in the PR's description.

If adding a new feature, the PR's description includes:

  • A convincing reason for adding this feature (to avoid wasting your time, it's best to start a new feature discussion first and wait for approval before working on it)

Other information:

Copy link

github-actions bot commented Mar 5, 2024

UI Tests Results

   74 files  1 714 suites   2m 2s ⏱️
  504 tests   504 ✅ 0 💤 0 ❌
1 574 runs  1 574 ✅ 0 💤 0 ❌

Results for commit ff706cf.

♻️ This comment has been updated with latest results.

- The QSelect random failure is caused by clicking on an element when it is not yet visible. Even though cypress is supposed to check that an element is visible before clicking, sometimes due to race conditions or for some other reason, the element may be found and clicked when it is not yet visible. So "should('be.visible')" has been explicitly added to ensure tests are much more deterministic
@IlCallo IlCallo merged commit 6667a31 into quasarframework:dev Mar 18, 2024
4 checks passed
@IlCallo
Copy link
Member

IlCallo commented Mar 18, 2024

Merged to quick-fix QSelect tests flakyness

A follow-up PR will migrate QSelect tests to use withinSelectMenu and adapt our own .select override to automatically apply the .should('be.visible') fix whenever possible

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants