Jdlrobson has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/316020

Change subject: QA: Ensure JavaScript has loaded before running references and 
search tests
......................................................................

QA: Ensure JavaScript has loaded before running references and search tests

Both of these tests make a big assumption that JavaScript for the modules
that progressively enhance references and the search input have loaded.

This avoids any kind of error by checking the state of the modules before
continuing.

Change-Id: I47de5df3a45db4ccb7285b2c4f21c8d4948db1f3
---
M tests/browser/features/step_definitions/references_steps.rb
M tests/browser/features/step_definitions/search_steps.rb
2 files changed, 2 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend 
refs/changes/20/316020/1

diff --git a/tests/browser/features/step_definitions/references_steps.rb 
b/tests/browser/features/step_definitions/references_steps.rb
index a3d17cb..b647a85 100644
--- a/tests/browser/features/step_definitions/references_steps.rb
+++ b/tests/browser/features/step_definitions/references_steps.rb
@@ -1,5 +1,6 @@
 When(/^I click on a reference$/) do
   on(ArticlePage) do |page|
+    page.wait_until_rl_module_ready('skins.minerva.scripts')
     page.reference_element.click
     page.reference_drawer_element.when_present
   end
diff --git a/tests/browser/features/step_definitions/search_steps.rb 
b/tests/browser/features/step_definitions/search_steps.rb
index 818899c..8e07b40 100644
--- a/tests/browser/features/step_definitions/search_steps.rb
+++ b/tests/browser/features/step_definitions/search_steps.rb
@@ -3,6 +3,7 @@
 end
 
 When(/^I click the placeholder search box$/) do
+  on(ArticlePage).wait_until_rl_module_ready('skins.minerva.scripts')
   on(ArticlePage).search_box_placeholder_element.when_present.click
   # this check is needed to accommodate for the hack for opening the virtual
   # keyboard (see comments in search.js)

-- 
To view, visit https://gerrit.wikimedia.org/r/316020
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I47de5df3a45db4ccb7285b2c4f21c8d4948db1f3
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson <jrob...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to