QA: Adjustments to account for slow loading of mediawiki.notifications

Changes:
* Use css rather than class for finding toast
* Correct a test typo
* Add a step to wait until the mediawiki.notification module
has been loaded

Bug: T170890
Change-Id: I86e48e00ebb83772149da7c7f20097b5436a0cf5
This commit is contained in:
jdlrobson 2017-08-01 15:06:37 -07:00 committed by Jdlrobson
parent 425deae3a4
commit 96d4955834
3 changed files with 7 additions and 2 deletions

View file

@ -28,6 +28,11 @@ end
Then(/^I should see a toast notification$/) do
# To avoid flakey tests check the notification area element first (T170890)
on(ArticlePage) do |page|
# Minerva loads mediawiki.notify at startup which defers the loading of this module
# We must wait until the lazy loading has happened before checking for the toast (T170890)
page.wait_until_rl_module_ready('mediawiki.notification')
end
expect(on(ArticlePage).notification_area_element.when_visible).to be_visible
expect(on(ArticlePage).toast_element.when_visible).to be_visible
end

View file

@ -145,7 +145,7 @@ class ArticlePage
# toast
div(:notification_area, id: 'mw-notification-area')
div(:toast, class: 'mw-notification')
div(:toast, css: '.mw-notification')
# loader
div(:content_wrapper, id: 'content')

View file

@ -7,7 +7,7 @@ Feature: Manage Watchlist
Scenario: Add an article to the watchlist
Given I am viewing an unwatched page
When I click the watch star
Then I should see a toast with "Added Selenium mobile watch test to your watchlist"
Then I should see a toast with message "Added Selenium mobile watch test to your watchlist"
And the watch star should be selected
Scenario: Remove an article from the watchlist