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: DialogShortcutIT Wait for child element presence before performing assertions #12830

Merged
merged 2 commits into from
Jan 26, 2022

Conversation

mcollovati
Copy link
Collaborator

@mcollovati mcollovati commented Jan 25, 2022

Description

Sometimes findElements(By.tagName("div")) returns an empty list, maybe because server roundtrip has not yet completed.
This change adds a wait condition to ensure the presence of the newly added element before doing assertions.

Fixes #10481
Fixes #10487
Fixes #10491

Type of change

  • Bugfix
  • Feature

Checklist

  • I have read the contribution guide: https://vaadin.com/docs/latest/guide/contributing/overview/
  • I have added a description following the guideline.
  • The issue is created in the corresponding repository and I have referenced it.
  • I have added tests to ensure my change is effective and works as intended.
  • New and existing tests are passing locally with my change.
  • I have performed self-review and corrected misspellings.

Additional for Feature type of change

  • Enhancement / new feature was discussed in a corresponding GitHub issue and Acceptance Criteria were created.

@github-actions
Copy link

github-actions bot commented Jan 25, 2022

Unit Test Results

   774 files  +  1     774 suites  +1   28m 58s ⏱️ - 1m 41s
5 768 tests +13  5 720 ✔️ +19  48 💤  - 2  0  - 1 
5 798 runs  +17  5 749 ✔️ +20  49 💤 +1  0  - 2 

Results for commit 52f51ec. ± Comparison against base commit eab25b3.

♻️ This comment has been updated with latest results.

@mcollovati
Copy link
Collaborator Author

Cherry picking to 2.7 and 2.8 may close also #10590, #10614, #10616

@mcollovati mcollovati marked this pull request as ready for review January 25, 2022 12:21
@mcollovati mcollovati changed the title test: Find child element directly by xpath instead of extracting it from list test: DialogShortcutIT Wait for child element presence before performing assertions Jan 26, 2022
@vaadin-bot vaadin-bot added +1.0.0 and removed +0.0.1 labels Jan 26, 2022
…rom list

Sometimes findElements(By.tagNvame("div")) seems to return results
before server roundtrips are completed, so list of elements is missing
elements. Performing a direct searching for child element by xpath
(findElement(By.xpath("div[N]")))) seem always to work.
To be noted that xpath position is 1 based

Fixes #10481, #10487, #10491
@mcollovati mcollovati force-pushed the issues/flaky_dialogshortcut_it branch from e3975e3 to 52f51ec Compare January 26, 2022 10:44
@vaadin-bot vaadin-bot added +0.0.1 and removed +1.0.0 labels Jan 26, 2022
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@joheriks joheriks self-requested a review January 26, 2022 14:33
@joheriks joheriks merged commit 64d5213 into master Jan 26, 2022
@joheriks joheriks deleted the issues/flaky_dialogshortcut_it branch January 26, 2022 14:57
vaadin-bot pushed a commit that referenced this pull request Jan 26, 2022
…ing assertions (#12830)

Sometimes findElements(By.tagNvame("div")) seems to return results
before server roundtrips are completed, so list of elements is missing
elements. Performing a direct searching for child element by xpath
(findElement(By.xpath("div[N]")))) seem always to work.
To be noted that xpath position is 1 based

Fixes #10481, #10487, #10491
vaadin-bot pushed a commit that referenced this pull request Jan 26, 2022
…ing assertions (#12830)

Sometimes findElements(By.tagNvame("div")) seems to return results
before server roundtrips are completed, so list of elements is missing
elements. Performing a direct searching for child element by xpath
(findElement(By.xpath("div[N]")))) seem always to work.
To be noted that xpath position is 1 based

Fixes #10481, #10487, #10491
joheriks pushed a commit that referenced this pull request Jan 26, 2022
…ing assertions (#12830)

Sometimes findElements(By.tagNvame("div")) seems to return results
before server roundtrips are completed, so list of elements is missing
elements. Performing a direct searching for child element by xpath
(findElement(By.xpath("div[N]")))) seem always to work.
To be noted that xpath position is 1 based

Fixes #10481, #10487, #10491
joheriks pushed a commit that referenced this pull request Jan 26, 2022
…ing assertions (#12830)

Sometimes findElements(By.tagNvame("div")) seems to return results
before server roundtrips are completed, so list of elements is missing
elements. Performing a direct searching for child element by xpath
(findElement(By.xpath("div[N]")))) seem always to work.
To be noted that xpath position is 1 based

Fixes #10481, #10487, #10491
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment