Repository navigation
Resolve the Capybara session when the audit runs - #39
Conversation
|
@seanpdoyle I've pushed 14a40a1 but looks like some of the failures/flakes are on main already? Should I keep trying to fix this? |
|
@MatheusRich I've merged #42 to pass CI on |
14a40a1 to
e56a7a5
Compare
| # Chrome sometimes needs more than Ferrum's 10-second default to boot | ||
| # on a shared runner. | ||
| FERRUM_PROCESS_TIMEOUT: "30" |
There was a problem hiding this comment.
This was part of a previous PR, and can be omitted.
| # Chrome sometimes needs more than Ferrum's 10-second default to boot | |
| # on a shared runner. | |
| FERRUM_PROCESS_TIMEOUT: "30" |
e56a7a5 to
9448c0a
Compare
There was a problem hiding this comment.
Is this coverage possible to achieve from a Minitest System Test? The presence of the RSpec suite is solely for the purpose of exercising the RSpec-facing public interface of the gem.
The rest of the internal test suite is written in Minitest.
There was a problem hiding this comment.
I've added a minitest test, but kept this one to also test the RSpec hook ordering thing. LMK if you think this is unnecessary.
9448c0a to
74fa47d
Compare
The engine builds the auditor inside a `before` hook. It passes the session that is current at that moment. A host suite can select its driver with `driven_by` from a `before` hook of its own. That hook registers later, so it runs later. The auditor then holds the default `:rack_test` session while the example runs against a real browser. Every audit fails with `Capybara::NotSupportedByDriverError` on the first `visit`. This commit passes the test to the auditor instead of the session. The auditor asks the test for `page` when it audits, so it always uses the session that is current at that moment. The reporters already receive the test, so the two constructor arguments now match. The new spec calls `driven_by` from a plain `before` hook. It fails on `main` with the error above and passes with this change. The new test visits a page inside `using_session`. On `main`, the auditor audits the blank page of the first session, so the test fails. It passes with this change.
74fa47d to
5e6cfba
Compare
The engine builds the auditor inside a
beforehook. It passes the session that is current at that moment. A host suite can select its driver withdriven_byfrom abeforehook of its own. That hook registers later, so it runs later. The auditor then holds the default:rack_testsession while the example runs against a real browser. Every audit fails withCapybara::NotSupportedByDriverErroron the firstvisit.This PR passes the test to the auditor instead of the session. The auditor asks the test for
pagewhen it audits, so it always uses the session that is current at that moment. The reporters already receive the test, so the two constructor arguments now match.The new spec calls
driven_byfrom a plainbeforehook. It fails onmainwith the error above and passes with this change.