QA: Minor tweaks to how we check toast notifications

A toast autohides within 5 seconds and its display properties are
inherited from #mw-notification-area. This slight tweak waits for
mw-notification-area to be visible before verifying toast and its
contents

Change-Id: I89beaf9d131155e958cc9aae84a9e30ffd8e9e4f
This commit is contained in:
jdlrobson 2017-07-31 15:03:18 -07:00
parent 9243513749
commit 0f93115725
2 changed files with 4 additions and 1 deletions

View file

@ -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|

View file

@ -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