Here's a basic example:
RSpec.configure do |config|
config.before(:each, type: :system) do
driven_by :selenium, using: :headless_chrome, screen_size: [1400, 1400]
end
end
RSpec.describe "Test", type: :system do
it "should work" do
mock_omniauth_config
skip_accessibility_audits do
visit some_other_path
end
visit root_path
click_on "Sign in with Google" # Omniauth callback
expect(page).not_to have_text "Something random"
end
end
I get this error after click_on "Sign in with Google":
UncaughtThrowError:
uncaught throw {"errorMessage" => "Cannot read properties of undefined (reading 'runPartial')", "passes" => [], "timestamp" => "Sun Apr 13 2025 10:33:44 GMT-0700 (Pacific Daylight Time)", "url" => "", "violations" => []}
If I put visit root_path before skip_accessibility_audits (maybe so that aXe "boots" before accessibility audits are skipped?), everything works fine.