AlchemyCMS / alchemy_cms

Alchemy is the Open Source Rails CMS framework for the component based web that can be used as classic server side rendered or headless CMS.
https://www.alchemy-cms.com
BSD 3-Clause "New" or "Revised" License
818 stars 312 forks source link

Harden Page List Feature Spec #2832

Closed mamhoff closed 3 months ago

mamhoff commented 3 months ago

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".

codecov[bot] commented 3 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

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

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

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.