diff --git a/blacklight.gemspec b/blacklight.gemspec index cfacb7831c..dd5eb354c1 100644 --- a/blacklight.gemspec +++ b/blacklight.gemspec @@ -37,8 +37,7 @@ Gem::Specification.new do |s| s.add_development_dependency "rspec-its" s.add_development_dependency "rspec-collection_matchers", ">= 1.0" s.add_development_dependency "capybara", '~> 3' - s.add_development_dependency 'webdrivers', '~> 3.0' - s.add_development_dependency "selenium-webdriver", '>= 3.13.1' + s.add_development_dependency 'apparition' s.add_development_dependency 'engine_cart', '~> 2.1' s.add_development_dependency "equivalent-xml" s.add_development_dependency "simplecov" diff --git a/spec/features/facets_spec.rb b/spec/features/facets_spec.rb index 6c9f161dc0..7dc53eac53 100644 --- a/spec/features/facets_spec.rb +++ b/spec/features/facets_spec.rb @@ -56,10 +56,6 @@ expect(page).to have_css('#facet-format', visible: false) - within('#facets .facets-header') do - page.find('button.navbar-toggler').click - end - page.find('h3.facet-field-heading button', text: 'Format').click sleep(1) # let facet animation finish and wait for it to potentially re-collapse @@ -70,14 +66,10 @@ it 'is able to expand pivot facets when javascript is enabled', js: true do visit root_path - within('#facets .facets-header') do - page.find('button.navbar-toggler').click - end - page.find('h3.facet-field-heading button', text: 'Pivot Field').click within '#facet-example_pivot_field' do - expect(page).to have_css('.facet-leaf-node', text: 'Book 30') + expect(page).to have_css('.facet-leaf-node', text: "Book\t30") expect(page).not_to have_css('.facet-select', text: 'Tibetan') page.find('.facet-toggle-handle').click click_link 'Tibetan' @@ -87,23 +79,6 @@ expect(page).to have_css('.constraint-value', text: 'Language Tibetan') end - describe 'heading button focus with Firefox' do - before do - Capybara.current_driver = :selenium_headless - end - - after do - Capybara.current_driver = :rack_test - end - - it 'changes to the button on button click in Firefox' do - visit root_path - page.find('h3.facet-field-heading button', text: 'Format').click - focused_element_data_target = page.evaluate_script("document.activeElement")['data-target'] - expect(focused_element_data_target).to eq '#facet-format' - end - end - describe '"More" links' do it 'has default more link with sr-only text' do visit root_path diff --git a/spec/features/search_filters_spec.rb b/spec/features/search_filters_spec.rb index f6cf96466f..2d251e3a36 100644 --- a/spec/features/search_filters_spec.rb +++ b/spec/features/search_filters_spec.rb @@ -168,26 +168,16 @@ end it "is collapsed when not selected", js: true do - skip("Test passes locally but not on Travis.") if ENV['TRAVIS'] visit root_path - within('#facets .facets-header') do - page.find('button.navbar-toggler').click - end - within(".blacklight-subject_ssim") do expect(page).not_to have_selector(".card-body", visible: true) end end it "expands when the heading button is clicked", js: true do - skip("Test passes locally but not on Travis.") if ENV['TRAVIS'] visit root_path - within('#facets .facets-header') do - page.find('button.navbar-toggler').click - end - within(".blacklight-subject_ssim") do expect(page).not_to have_selector(".card-body", visible: true) find(".card-header button").click @@ -196,13 +186,8 @@ end it "expands when the button is clicked", js: true do - skip("Test passes locally but not on Travis.") if ENV['TRAVIS'] visit root_path - within('#facets .facets-header') do - page.find('button.navbar-toggler').click - end - within(".blacklight-subject_ssim") do expect(page).not_to have_selector(".card-body", visible: true) find(".card-header").click @@ -211,13 +196,8 @@ end it "keeps selected facets expanded on page load", js: true do - skip("Test passes locally but not on Travis.") if ENV['TRAVIS'] visit root_path - within('#facets .facets-header') do - page.find('button.navbar-toggler').click - end - within(".blacklight-subject_ssim") do page.find('h3.facet-field-heading', text: 'Topic').click expect(page).to have_selector(".panel-collapse", visible: true) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 95c0fe947d..7603318a01 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -20,12 +20,17 @@ require 'rspec/its' require 'rspec/collection_matchers' require 'capybara/rspec' -require 'selenium-webdriver' +require 'capybara/apparition' require 'equivalent-xml' -require 'webdrivers' -Capybara.javascript_driver = :selenium_chrome_headless +Capybara.javascript_driver = :apparition Capybara.disable_animation = true +# Capybara.enable_aria_label = true + +# Uncomment for a headed browser +# Capybara.register_driver :apparition do |app| +# Capybara::Apparition::Driver.new(app, headless: false) +# end # Requires supporting ruby files with custom matchers and macros, etc, # in spec/support/ and its subdirectories.