You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix system test screenshots for aggregate failures
If RSpec's `:aggregate_failures` is enabled, a system spec with a failed
expectation would not automatically trigger a screenshot as expected.
This is because aggregated failures are not exposed via the typical
`RSpec.current_example.exception`. To correctly detect failures when
aggregation is enabled, we have to do more work.
This commit works around this problem by using some behind-the-scenes
knowledge of how rspec-expectations does the aggregation. Now we reach
into the thread-local storage (`RSpec::Support.failure_notifier`) and
discover whether there are in fact failures "queued up". If so, we will
consider the example to have failed and take a screenshot.
This is the same workaround as used by capybara-screenshot:
mattheworiordan/capybara-screenshot#213
0 commit comments