Maintenance: Stabilize capybara tests.

This commit is contained in:
Martin Gruner 2022-02-18 09:12:37 +01:00 committed by Dominik Klein
parent f7bf58b022
commit f40c5ea01e
5 changed files with 18 additions and 7 deletions

View file

@ -60,7 +60,11 @@ RSpec.describe 'Profile > Language', type: :system do
let(:priority) { 'PRIORITY' }
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'
@ -150,7 +154,11 @@ RSpec.describe 'Profile > Language', type: :system do
let(:priority) { 'PRIORITÄT' }
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'

View file

@ -50,7 +50,7 @@ RSpec.describe 'System > Translations', type: :system do
let(:admin) { create(:admin, preferences: { locale: 'de-de' }) }
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'))"
end
@ -102,7 +102,7 @@ RSpec.describe 'System > Translations', type: :system do
let(:admin) { create(:admin, preferences: { locale: 'de-de' }) }
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'))"
end

View file

@ -35,7 +35,7 @@ RSpec.describe 'Ticket history', type: :system, time_zone: 'Europe/London', auth
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'))"
refresh

View file

@ -1935,6 +1935,9 @@ RSpec.describe 'Ticket zoom', type: :system do
it 'does setup the last behaviour' do
click '.js-attributeBar .dropup div'
click 'span[data-type=stayOnTab]'
wait.until do
User.find_by(email: 'admin@example.com').preferences['secondaryAction'] == 'stayOnTab'
end
visit "ticket/zoom/#{ticket1.id}"
expect(page).to have_text('Stay on tab')
end
@ -2014,7 +2017,7 @@ RSpec.describe 'Ticket zoom', type: :system do
def switch_language_german
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.find('.js-input').click
page.find('.js-input').set('Deutsch')

View file

@ -198,7 +198,7 @@ class AgentTicketEmailReplyKeepBodyTest < TestCase
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'))"
# switch user profile language to German