Merge pull request #3072 from consul/backport-1623-fix_flaky_driver_session

[Backport] Fix flaky spec: Welcome screen is not shown to organizations
This commit is contained in:
Javier Martín
2018-11-30 14:14:09 +01:00
committed by GitHub
2 changed files with 6 additions and 5 deletions

View File

@@ -112,7 +112,7 @@ feature "Home" do
end
feature 'IE alert' do
scenario 'IE visitors are presented with an alert until they close it' do
scenario 'IE visitors are presented with an alert until they close it', :page_driver do
# Selenium API does not include page request/response inspection methods
# so we must use Capybara::RackTest driver to set the browser's headers
Capybara.current_session.driver.header(
@@ -133,7 +133,7 @@ feature "Home" do
expect(page.driver.request.cookies['ie_alert_closed']).to eq('true')
end
scenario 'non-IE visitors are not bothered with IE alerts' do
scenario 'non-IE visitors are not bothered with IE alerts', :page_driver do
visit root_path
expect(page).not_to have_xpath(ie_alert_box_xpath, visible: false)
expect(page.driver.request.cookies['ie_alert_closed']).to be_nil

View File

@@ -6,7 +6,7 @@ require 'knapsack_pro'
Dir["./spec/models/concerns/*.rb"].each { |f| require f }
Dir["./spec/support/**/*.rb"].sort.each { |f| require f }
Dir["./spec/shared/**/*.rb"].sort.each { |f| require f }
Dir["./spec/shared/**/*.rb"].sort.each { |f| require f }
RSpec.configure do |config|
config.use_transactional_fixtures = false
@@ -19,6 +19,7 @@ RSpec.configure do |config|
config.include(EmailSpec::Matchers)
config.include(CommonActions)
config.include(ActiveSupport::Testing::TimeHelpers)
config.before(:suite) do
DatabaseCleaner.clean_with :truncation
end
@@ -60,8 +61,8 @@ RSpec.configure do |config|
end
end
config.before(:each, type: :feature) do
Capybara.reset_sessions!
config.after(:each, :page_driver) do
page.driver.reset!
end
config.before do