From 96d49558340845a32cfb8c7fda555ae2c4e4cb0b Mon Sep 17 00:00:00 2001 From: jdlrobson Date: Tue, 1 Aug 2017 15:06:37 -0700 Subject: [PATCH] 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 --- .../features/step_definitions/common_article_steps.rb | 5 +++++ tests/browser/features/support/pages/article_page.rb | 2 +- tests/browser/features/watchstar.feature | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/browser/features/step_definitions/common_article_steps.rb b/tests/browser/features/step_definitions/common_article_steps.rb index 453bc8a23..df5d4fd4f 100644 --- a/tests/browser/features/step_definitions/common_article_steps.rb +++ b/tests/browser/features/step_definitions/common_article_steps.rb @@ -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 diff --git a/tests/browser/features/support/pages/article_page.rb b/tests/browser/features/support/pages/article_page.rb index 2b733aed0..44eb8482a 100644 --- a/tests/browser/features/support/pages/article_page.rb +++ b/tests/browser/features/support/pages/article_page.rb @@ -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') diff --git a/tests/browser/features/watchstar.feature b/tests/browser/features/watchstar.feature index 76ef5b020..f319633f5 100644 --- a/tests/browser/features/watchstar.feature +++ b/tests/browser/features/watchstar.feature @@ -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