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

Fix flaky spec with sleep #5783

Merged
merged 2 commits into from
Jun 12, 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
1 change: 1 addition & 0 deletions admin/spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
end
Capybara.javascript_driver = (ENV['CAPYBARA_DRIVER'] || :selenium_chrome_headless).to_sym
Capybara.default_max_wait_time = ENV['DEFAULT_MAX_WAIT_TIME'].to_f if ENV['DEFAULT_MAX_WAIT_TIME'].present?
Capybara.enable_aria_label = true

# DATABASE CLEANER
require 'database_cleaner'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@

it "lists products", :js do
visit "/admin/orders"
find("button[aria-label=Filter]").click

sleep 1

click_button "Filter"

within("div[role=search]") do
expect(page).to have_content("Promotions")
find(:xpath, "//summary[normalize-space(text())='Promotions']").click
Expand Down
1 change: 1 addition & 0 deletions legacy_promotions/spec/rails_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
require 'axe-capybara'

Capybara.javascript_driver = (ENV['CAPYBARA_DRIVER'] || :selenium_chrome_headless).to_sym
Capybara.enable_aria_label = true

RSpec.configure do |config|
config.fixture_path = File.join(__dir__, "fixtures")
Expand Down