Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify capybara wait time helper #3364

Merged
merged 1 commit into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion spec/features/item_admin_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
item.click_button 'Make public'
end

it "toggles the 'blacklight-private' label", default_max_wait_time: 5, js: true do
it "toggles the 'blacklight-private' label", js: true, max_wait_time: 5 do
visit spotlight.admin_exhibit_catalog_path(exhibit)
# The label should be toggled when the checkbox is clicked
expect(page).to have_no_css('tr.blacklight-private')
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

describe 'Oembed and text block', default_max_wait_time: 15, feature: true, versioning: true do
describe 'Oembed and text block', feature: true, max_wait_time: 15, versioning: true do
let(:exhibit) { FactoryBot.create(:exhibit) }
let(:exhibit_curator) { FactoryBot.create(:exhibit_curator, exhibit:) }
let(:feature_page) do
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

RSpec.describe 'Solr Document Block', default_max_wait_time: 30, feature: true, versioning: true do
RSpec.describe 'Solr Document Block', feature: true, max_wait_time: 30, versioning: true do
let(:exhibit) { FactoryBot.create(:exhibit) }
let(:exhibit_curator) { FactoryBot.create(:exhibit_curator, exhibit:) }
let(:feature_page) do
Expand Down
2 changes: 1 addition & 1 deletion spec/features/javascript/edit_in_place_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
end
end

it 'updates the metadata label', default_max_wait_time: 10 do
it 'updates the metadata label', max_wait_time: 10 do
visit spotlight.exhibit_dashboard_path(exhibit)

within '#sidebar' do
Expand Down
2 changes: 1 addition & 1 deletion spec/features/javascript/multi_image_select_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

RSpec.describe 'Multi image selector', default_max_wait_time: 5, js: true, type: :feature, versioning: true do
RSpec.describe 'Multi image selector', js: true, max_wait_time: 5, type: :feature, versioning: true do
let(:exhibit) { FactoryBot.create(:exhibit) }
let(:exhibit_curator) { FactoryBot.create(:exhibit_curator, exhibit:) }
let(:feature_page) { FactoryBot.create(:feature_page, exhibit:) }
Expand Down
2 changes: 1 addition & 1 deletion spec/features/javascript/reindex_monitor_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

describe 'Reindex Monitor', default_max_wait_time: 10, js: true do
describe 'Reindex Monitor', js: true, max_wait_time: 10 do
let(:resources) do
FactoryBot.create_list(:resource, 1)
end
Expand Down
2 changes: 1 addition & 1 deletion spec/features/javascript/search_config_admin_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

before { login_as user }

describe 'search fields', default_max_wait_time: 5 do
describe 'search fields', max_wait_time: 5 do
it 'allows the curator to disable all search fields' do
visit spotlight.exhibit_home_page_path(exhibit, exhibit.home_page)
expect(page).to have_css 'select#search_field'
Expand Down
2 changes: 1 addition & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
config.include Rails.application.routes.url_helpers
config.include Rails.application.routes.mounted_helpers
config.include Spotlight::TestFeaturesHelpers, type: :feature
config.include CapybaraDefaultMaxWaitMetadataHelper, type: :feature
config.include CapybaraWaitMetadataHelper, type: :feature

config.expect_with :rspec do |expectations|
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
Expand Down
20 changes: 0 additions & 20 deletions spec/support/features/capybara_default_max_wait_metadata_helper.rb

This file was deleted.

13 changes: 13 additions & 0 deletions spec/support/features/capybara_wait_metadata_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# frozen_string_literal: true

module CapybaraWaitMetadataHelper
extend ActiveSupport::Concern

included do
around do |example|
using_wait_time example.metadata[:max_wait_time] || Capybara.default_max_wait_time do
example.run
end
end
end
end
Loading