diff --git a/tests/browser/features/step_definitions/common_article_steps.rb b/tests/browser/features/step_definitions/common_article_steps.rb index 0e89e9e0b..c16a05def 100644 --- a/tests/browser/features/step_definitions/common_article_steps.rb +++ b/tests/browser/features/step_definitions/common_article_steps.rb @@ -27,7 +27,9 @@ When(/^I click the watch star$/) do end Then(/^I should see a toast notification$/) do - expect(on(ArticlePage).toast_element.when_present(10)).to be_visible + # To avoid flakey tests check the notification area element first (T170890) + expect(on(ArticlePage).notification_area_element.when_visible).to be_visible + expect(on(ArticlePage).toast_element.when_visible).to be_visible end Then(/^I should see a toast with message "(.+)"$/) do |msg| diff --git a/tests/browser/features/support/pages/article_page.rb b/tests/browser/features/support/pages/article_page.rb index 064e9a79d..2b733aed0 100644 --- a/tests/browser/features/support/pages/article_page.rb +++ b/tests/browser/features/support/pages/article_page.rb @@ -144,6 +144,7 @@ class ArticlePage div(:spinner_loading, class: 'spinner loading') # toast + div(:notification_area, id: 'mw-notification-area') div(:toast, class: 'mw-notification') # loader