Zfilipin has uploaded a new change for review.

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

Change subject: WIP Add helper to Selenium that allows you to query whether 
JavaScript module has loaded
......................................................................

WIP Add helper to Selenium that allows you to query whether JavaScript module 
has loaded

Bug: T146292
Change-Id: Id1c5d91dfdc285e859e553d8a03c2bd29200899c
---
M lib/mediawiki_selenium/pages.rb
A lib/mediawiki_selenium/pages/article_page.rb
2 files changed, 19 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/selenium 
refs/changes/47/312047/1

diff --git a/lib/mediawiki_selenium/pages.rb b/lib/mediawiki_selenium/pages.rb
index d0326eb..93eca2a 100644
--- a/lib/mediawiki_selenium/pages.rb
+++ b/lib/mediawiki_selenium/pages.rb
@@ -1,3 +1,4 @@
+require 'mediawiki_selenium/pages/article_page'
 require 'mediawiki_selenium/pages/login_page'
 require 'mediawiki_selenium/pages/random_page'
 require 'mediawiki_selenium/pages/reset_preferences_page'
diff --git a/lib/mediawiki_selenium/pages/article_page.rb 
b/lib/mediawiki_selenium/pages/article_page.rb
new file mode 100644
index 0000000..0cebd79
--- /dev/null
+++ b/lib/mediawiki_selenium/pages/article_page.rb
@@ -0,0 +1,18 @@
+require 'page-object'
+
+class ArticlePage
+  include PageObject
+
+    #
+    # Wait until a Resource Loader module has loaded.
+    #
+    # @example
+    #   on(WikiPage).wait_until_module_ready("mobile.talk")
+    #
+    # @param name [String] The name of the Resource Loader module
+    def wait_until_rl_module_ready(name)
+      self.wait_until do
+        browser.execute_script("return mw.loader.getState('#{name}') === 
'ready'")
+      end
+    end
+end

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id1c5d91dfdc285e859e553d8a03c2bd29200899c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/selenium
Gerrit-Branch: master
Gerrit-Owner: Zfilipin <zfili...@wikimedia.org>

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

Reply via email to