From 5c77b477e6b152a3a43a731d3c78efb088999965 Mon Sep 17 00:00:00 2001 From: WMDE-Fisch Date: Wed, 23 Oct 2019 17:50:21 +0200 Subject: [PATCH] Use waitForModuleState from Util class Change-Id: Ida52cf73686a1cc5af5ab955ef30daf15a2ec68a --- tests/selenium/pageobjects/diff.page.js | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/tests/selenium/pageobjects/diff.page.js b/tests/selenium/pageobjects/diff.page.js index fe2a8db4..22255b1b 100644 --- a/tests/selenium/pageobjects/diff.page.js +++ b/tests/selenium/pageobjects/diff.page.js @@ -15,23 +15,8 @@ class DiffPage extends Page { getRevision( num ) { return browser.element( '.mw-revslider-revision[data-pos="' + num + '"]' ); } - resourceLoaderModuleStatus( moduleName, moduleStatus, errMsg ) { - // Word of caution: browser.waitUntil returns a Timer class NOT a Promise. - // Webdriver IO will run waitUntil synchronously so not returning it will - // block JavaScript execution while returning it will not. - // http://webdriver.io/api/utility/waitUntil.html - // https://github.com/webdriverio/webdriverio/blob/master/lib/utils/Timer.js - browser.waitUntil( () => { - const result = browser.execute( ( module ) => { - return typeof mw !== 'undefined' && - mw.loader.getState( module.name ) === module.status; - }, { status: moduleStatus, name: moduleName } ); - return result.value; - }, 10000, errMsg ); - } - ready() { - this.resourceLoaderModuleStatus( 'ext.RevisionSlider.lazyJs', 'ready', 'RevisionSlider did not load' ); + Util.waitForModuleState( 'ext.RevisionSlider.lazyJs' ); } prepareFilterTests() {