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

Fix flakey test #3229

Merged
merged 1 commit into from
Sep 25, 2024
Merged

Fix flakey test #3229

merged 1 commit into from
Sep 25, 2024

Conversation

rjlynch
Copy link
Contributor

@rjlynch rjlynch commented Sep 25, 2024

Sometimes the string "FE" ends up in the generated claim reference, eg "XBCFEA", and so is visible in the table more than twice. To fix this we need to specifically look in the policy short names column.

expect(page.find("table")).to have_content("ECP").exactly(10).times
expect(page.find("table")).to have_content("TSLR").exactly(7).times
expect(page.find("table")).to have_content("STRI").exactly(2).times
expect(page.find("table")).to have_content("FE").exactly(2).times
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I came across this recently too on my ticket.
My solution was:

expect(page).to have_selector("td[text()='ECP']", count: 10)

The only advantage to this is that it copes if columns are added/removed from this table, as it doesn't assume a column number.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah that's nicer, have changed

Sometimes the string "FE" ends up in the generated claim reference, eg
"XBCFEA", and so is visible in the table more than twice. To fix this we
need to specifically look in the policy short names column.
@rjlynch rjlynch force-pushed the fix-flakey-admin-spec branch from 8f932b3 to eb215fe Compare September 25, 2024 12:00
@rjlynch rjlynch merged commit 0daffb3 into master Sep 25, 2024
14 checks passed
@rjlynch rjlynch deleted the fix-flakey-admin-spec branch September 25, 2024 12:09
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.

3 participants