diff --git a/spec/features/home_page_spec.rb b/spec/features/home_page_spec.rb new file mode 100644 index 000000000..960dda1d3 --- /dev/null +++ b/spec/features/home_page_spec.rb @@ -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 diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 596e2d3e2..352ead70a 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -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" @@ -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 @@ -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