Skip to content

skip_accessibility_violations makes tests fail if it is wrapped around the first visit and then user hits Omniauth #28

@gabebw

Description

@gabebw

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions