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

Harden Page List Feature Spec #2832

Merged
merged 1 commit into from
Apr 11, 2024

Conversation

mamhoff
Copy link
Contributor

@mamhoff mamhoff commented Apr 11, 2024

We do a lot of page interaction in this spec, and sometimes there's a race condition: We specify that we want to find stuff within "table.list", and Capybara remembers those elements before the page gets actually reloaded, leading to spec failures like this one:

https://github.com/AlchemyCMS/alchemy_cms/actions/runs/8637028349/job/23678297291?pr=2831

Here, the error message was:

1) Admin page list as author can filter table of pages by status
     Failure/Error: expect(page.find("tr:nth-child(1) td.name", text: "Intro")).to be

     Capybara::ElementNotFound:
       Unable to find css "tr:nth-child(1) td.name" with text "Intro" within Obsolete #<Capybara::Node::Element>

The hint here was "Obsolete".

We do a lot of page interaction in this spec, and sometimes there's a
race condition: We specify that we want to find stuff `within
"table.list"`, and Capybara remembers those elements before the page
gets actually reloaded, leading to spec failures like this one:

https://github.com/AlchemyCMS/alchemy_cms/actions/runs/8637028349/job/23678297291?pr=2831

Here, the error message was:
```
1) Admin page list as author can filter table of pages by status
     Failure/Error: expect(page.find("tr:nth-child(1) td.name", text: "Intro")).to be

     Capybara::ElementNotFound:
       Unable to find css "tr:nth-child(1) td.name" with text "Intro" within Obsolete #<Capybara::Node::Element>
```

The hint here was "Obsolete".
@mamhoff mamhoff requested a review from a team as a code owner April 11, 2024 07:38
Copy link

codecov bot commented Apr 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.84%. Comparing base (4df4762) to head (9fcacec).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2832   +/-   ##
=======================================
  Coverage   95.84%   95.84%           
=======================================
  Files         227      227           
  Lines        6186     6186           
=======================================
  Hits         5929     5929           
  Misses        257      257           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@tvdeyen tvdeyen left a comment

Choose a reason for hiding this comment

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

Thanks

@tvdeyen tvdeyen merged commit f0013c8 into AlchemyCMS:main Apr 11, 2024
35 checks passed
@mamhoff mamhoff deleted the fix-flaky-feature-spec branch April 11, 2024 09:07
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