Skip to content

Commit

Permalink
Add beginning of automated accessibility testing.
Browse files Browse the repository at this point in the history
It's a currently failing test because we have issues to fix
  • Loading branch information
mlandauer committed Oct 28, 2023
1 parent cec66f6 commit 748d909
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
16 changes: 16 additions & 0 deletions spec/features/home_page_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# frozen_string_literal: true

require "spec_helper"

describe "Home page" do
include Devise::Test::IntegrationHelpers

it "is accessible", js: true do
pending "there are accessibility issues to fix on the home page in the new design"
sign_in create(:confirmed_user, tailwind_theme: true)
visit root_path
# page.save_screenshot("screenshot.png")
# save_and_open_screenshot
expect(page).to be_axe_clean
end
end
9 changes: 5 additions & 4 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@
require "email_spec"
require "rspec/active_model/mocks"
require "pundit/rspec"
require "axe-rspec"
require "capybara/rails"

Capybara.javascript_driver = :selenium_headless
Capybara.server = :webrick

VCR.configure do |c|
c.cassette_library_dir = "spec/fixtures/vcr_cassettes"
Expand All @@ -25,7 +26,7 @@
# which automatically downloads the webdriver for headless testing
c.ignore_hosts "github.com"
c.ignore_request do |request|
URI(request.uri).host =~ /s3.amazonaws.com/
URI(request.uri).host =~ /objects.githubusercontent.com/
# false
# URI(request.uri).port == 7777
end
Expand Down Expand Up @@ -109,7 +110,7 @@
end

# For testing use a memory adapter with all features disabled by default
config.before do
Flipper.instance = Flipper.new(Flipper::Adapters::Memory.new)
Flipper.configure do |c|
c.default { Flipper.new(Flipper::Adapters::Memory.new) }
end
end

0 comments on commit 748d909

Please sign in to comment.