Maintenance: Stabilize capybara tests.
This commit is contained in:
parent
f7bf58b022
commit
f40c5ea01e
5 changed files with 18 additions and 7 deletions
|
@ -60,7 +60,11 @@ RSpec.describe 'Profile > Language', type: :system do
|
||||||
let(:priority) { 'PRIORITY' }
|
let(:priority) { 'PRIORITY' }
|
||||||
let(:owner) { 'OWNER' }
|
let(:owner) { 'OWNER' }
|
||||||
|
|
||||||
before { visit path }
|
before do
|
||||||
|
visit path
|
||||||
|
# Suppress the modal dialog that invites to contributions for translations that are < 90% as this breaks the tests for de-de.
|
||||||
|
page.evaluate_script "App.LocalStorage.set('translation_support_no', true, App.Session.get('id'))"
|
||||||
|
end
|
||||||
|
|
||||||
it_behaves_like 'displaying the current language'
|
it_behaves_like 'displaying the current language'
|
||||||
|
|
||||||
|
@ -150,7 +154,11 @@ RSpec.describe 'Profile > Language', type: :system do
|
||||||
let(:priority) { 'PRIORITÄT' }
|
let(:priority) { 'PRIORITÄT' }
|
||||||
let(:owner) { 'BESITZER' }
|
let(:owner) { 'BESITZER' }
|
||||||
|
|
||||||
before { visit path }
|
before do
|
||||||
|
visit path
|
||||||
|
# Suppress the modal dialog that invites to contributions for translations that are < 90% as this breaks the tests for de-de.
|
||||||
|
page.evaluate_script "App.LocalStorage.set('translation_support_no', true, App.Session.get('id'))"
|
||||||
|
end
|
||||||
|
|
||||||
it_behaves_like 'displaying the current language'
|
it_behaves_like 'displaying the current language'
|
||||||
|
|
||||||
|
|
|
@ -50,7 +50,7 @@ RSpec.describe 'System > Translations', type: :system do
|
||||||
let(:admin) { create(:admin, preferences: { locale: 'de-de' }) }
|
let(:admin) { create(:admin, preferences: { locale: 'de-de' }) }
|
||||||
|
|
||||||
before do
|
before do
|
||||||
# Suppress the modal dialog that invites to contributions for translations that are < 95% as this breaks the tests for de-de.
|
# Suppress the modal dialog that invites to contributions for translations that are < 90% as this breaks the tests for de-de.
|
||||||
page.evaluate_script "App.LocalStorage.set('translation_support_no', true, App.Session.get('id'))"
|
page.evaluate_script "App.LocalStorage.set('translation_support_no', true, App.Session.get('id'))"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -102,7 +102,7 @@ RSpec.describe 'System > Translations', type: :system do
|
||||||
let(:admin) { create(:admin, preferences: { locale: 'de-de' }) }
|
let(:admin) { create(:admin, preferences: { locale: 'de-de' }) }
|
||||||
|
|
||||||
before do
|
before do
|
||||||
# Suppress the modal dialog that invites to contributions for translations that are < 95% as this breaks the tests for de-de.
|
# Suppress the modal dialog that invites to contributions for translations that are < 90% as this breaks the tests for de-de.
|
||||||
page.evaluate_script "App.LocalStorage.set('translation_support_no', true, App.Session.get('id'))"
|
page.evaluate_script "App.LocalStorage.set('translation_support_no', true, App.Session.get('id'))"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -35,7 +35,7 @@ RSpec.describe 'Ticket history', type: :system, time_zone: 'Europe/London', auth
|
||||||
|
|
||||||
travel_back
|
travel_back
|
||||||
|
|
||||||
# Suppress the modal dialog that invites to contributions for translations that are < 95% as this breaks the tests for de-de.
|
# Suppress the modal dialog that invites to contributions for translations that are < 90% as this breaks the tests for de-de.
|
||||||
page.evaluate_script "App.LocalStorage.set('translation_support_no', true, App.Session.get('id'))"
|
page.evaluate_script "App.LocalStorage.set('translation_support_no', true, App.Session.get('id'))"
|
||||||
|
|
||||||
refresh
|
refresh
|
||||||
|
|
|
@ -1935,6 +1935,9 @@ RSpec.describe 'Ticket zoom', type: :system do
|
||||||
it 'does setup the last behaviour' do
|
it 'does setup the last behaviour' do
|
||||||
click '.js-attributeBar .dropup div'
|
click '.js-attributeBar .dropup div'
|
||||||
click 'span[data-type=stayOnTab]'
|
click 'span[data-type=stayOnTab]'
|
||||||
|
wait.until do
|
||||||
|
User.find_by(email: 'admin@example.com').preferences['secondaryAction'] == 'stayOnTab'
|
||||||
|
end
|
||||||
visit "ticket/zoom/#{ticket1.id}"
|
visit "ticket/zoom/#{ticket1.id}"
|
||||||
expect(page).to have_text('Stay on tab')
|
expect(page).to have_text('Stay on tab')
|
||||||
end
|
end
|
||||||
|
@ -2014,7 +2017,7 @@ RSpec.describe 'Ticket zoom', type: :system do
|
||||||
|
|
||||||
def switch_language_german
|
def switch_language_german
|
||||||
visit '#profile/language'
|
visit '#profile/language'
|
||||||
# Suppress the modal dialog that invites to contributions for translations that are < 95% as this breaks the tests for de-de.
|
# Suppress the modal dialog that invites to contributions for translations that are < 90% as this breaks the tests for de-de.
|
||||||
page.evaluate_script "App.LocalStorage.set('translation_support_no', true, App.Session.get('id'))"
|
page.evaluate_script "App.LocalStorage.set('translation_support_no', true, App.Session.get('id'))"
|
||||||
page.find('.js-input').click
|
page.find('.js-input').click
|
||||||
page.find('.js-input').set('Deutsch')
|
page.find('.js-input').set('Deutsch')
|
||||||
|
|
|
@ -198,7 +198,7 @@ class AgentTicketEmailReplyKeepBodyTest < TestCase
|
||||||
submit_css: '.modal #ui_ticket_zoom_article_email_full_quote .btn[type="submit"]',
|
submit_css: '.modal #ui_ticket_zoom_article_email_full_quote .btn[type="submit"]',
|
||||||
)
|
)
|
||||||
|
|
||||||
# Suppress the modal dialog that invites to contributions for translations that are < 95% as this breaks the tests for de-de.
|
# Suppress the modal dialog that invites to contributions for translations that are < 90% as this breaks the tests for de-de.
|
||||||
@browser.execute_script "App.LocalStorage.set('translation_support_no', true, App.Session.get('id'))"
|
@browser.execute_script "App.LocalStorage.set('translation_support_no', true, App.Session.get('id'))"
|
||||||
|
|
||||||
# switch user profile language to German
|
# switch user profile language to German
|
||||||
|
|
Loading…
Reference in a new issue