Maintenance: Make login message system spec more stable by using default wait time to prevent WS event race condition.
This commit is contained in:
parent
05fb40a3f8
commit
da7cffd7bc
1 changed files with 3 additions and 5 deletions
|
@ -13,7 +13,7 @@ RSpec.describe 'Login Message', type: :system, authenticated_as: false do
|
||||||
it 'shows message' do
|
it 'shows message' do
|
||||||
open_login_page
|
open_login_page
|
||||||
|
|
||||||
expect(page).to have_text(message)
|
expect(page).to have_css('.js-maintenanceLogin', text: message)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'hides message on the go' do
|
it 'hides message on the go' do
|
||||||
|
@ -21,7 +21,7 @@ RSpec.describe 'Login Message', type: :system, authenticated_as: false do
|
||||||
|
|
||||||
Setting.set 'maintenance_login', false
|
Setting.set 'maintenance_login', false
|
||||||
|
|
||||||
expect(page).to have_no_css('.js-maintenanceLogin', text: message, wait: 10)
|
expect(page).to have_no_css('.js-maintenanceLogin', text: message)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'changes message text on the go' do
|
it 'changes message text on the go' do
|
||||||
|
@ -29,7 +29,7 @@ RSpec.describe 'Login Message', type: :system, authenticated_as: false do
|
||||||
|
|
||||||
Setting.set 'maintenance_login_message', alt_message
|
Setting.set 'maintenance_login_message', alt_message
|
||||||
|
|
||||||
expect(page).to have_css('.js-maintenanceLogin', text: alt_message, wait: 10)
|
expect(page).to have_css('.js-maintenanceLogin', text: alt_message)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -47,8 +47,6 @@ RSpec.describe 'Login Message', type: :system, authenticated_as: false do
|
||||||
|
|
||||||
Setting.set 'maintenance_login', true
|
Setting.set 'maintenance_login', true
|
||||||
|
|
||||||
wait(10).until_exists { find '.js-maintenanceLogin', text: message, wait: false }
|
|
||||||
|
|
||||||
expect(page).to have_css('.js-maintenanceLogin', text: message)
|
expect(page).to have_css('.js-maintenanceLogin', text: message)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue