Page MenuHomePhabricator

Refactor wdio-mediawiki from sync to async mode
Open, Needs TriagePublic

Description

I came across a major blocker when dealing with upgrading some of the browser tests to async mode. In Two-Column-Edit-Conflict-Merge we're using waitForModuleState from the wdio-mediawiki's Util.js. In the browser tests of the Two-Column-Edit-Conflict-Merge extension we need to make sure that loading of the modules is finished before the test continues.

This did not work with the current way waitForModuleState method is implemented since it seems to be incompatible when using async mode.

As a workaround and proof of concept I added a minor fork of the Util.js to the extensions test suite, where I added async support. At least that fix should go upstream into a new wdio-mediawiki release.

See the patch where I got these insights from: https://gerrit.wikimedia.org/r/c/mediawiki/extensions/TwoColConflict/+/906082

Event Timeline

Change 923326 had a related patch set uploaded (by WMDE-Fisch; author: WMDE-Fisch):

[mediawiki/core@master] [wdio-mediawiki] Refactor waitForModuleState to async

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

Change 923326 merged by jenkins-bot:

[mediawiki/core@master] [wdio-mediawiki] Refactor waitForModuleState to async

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

@WMDE-Fisch the only related commit is merged. Is there something else to do, or can this task be resolved?

@WMDE-Fisch the only related commit is merged. Is there something else to do, or can this task be resolved?

Thanks for the nudge. There are some other parts in the lib that are not converted to async/await yet. But my use case is covered and I'm not sure about the other files. So we could either narrow this ticket down to the Utils part or we keep it open for tracking.

Change 951466 had a related patch set uploaded (by WMDE-Fisch; author: Hashar):

[mediawiki/core@master] wdio-mediawiki: await saveScreenshot

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

Change 951466 merged by jenkins-bot:

[mediawiki/core@master] wdio-mediawiki: await saveScreenshot

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

Change 952805 had a related patch set uploaded (by Hashar; author: Hashar):

[mediawiki/core@REL1_40] wdio-mediawiki: await saveScreenshot

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

Change 953206 had a related patch set uploaded (by Hashar; author: Hashar):

[mediawiki/core@REL1_39] wdio-mediawiki: await saveScreenshot

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

Change 953206 merged by jenkins-bot:

[mediawiki/core@REL1_39] wdio-mediawiki: await saveScreenshot

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

Change 952805 merged by jenkins-bot:

[mediawiki/core@REL1_40] wdio-mediawiki: await saveScreenshot

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

I went to fix the browser.saveScreenshot which was not awaited for ( https://gerrit.wikimedia.org/r/q/message:saveScreenshot ).

And I have send a tiny documentation update Upstream https://github.com/webdriverio/webdriverio/pull/11005/files which got merged 🏆 .

Change 959812 had a related patch set uploaded (by WMDE-Fisch; author: WMDE-Fisch):

[mediawiki/core@master] wdio-mediawiki: Release 2.3.0

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

Change 959812 merged by jenkins-bot:

[mediawiki/core@master] wdio-mediawiki: Release 2.3.0

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

I have fixed wdio-mediawiki to await browser.saveScreenshot but through Code Search https://codesearch.wmcloud.org/search/?q=saveScreenshot&files=&excludeFiles=&repos= I found a couple more in CirrusSearch and Wikibase

Change 960039 had a related patch set uploaded (by Hashar; author: Hashar):

[mediawiki/extensions/CirrusSearch@master] selenium: await browser.saveScreenshot

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

Change 960040 had a related patch set uploaded (by Hashar; author: Hashar):

[mediawiki/extensions/Wikibase@master] bridge: selenium: await browser.saveScreenshot

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

Change 960039 merged by jenkins-bot:

[mediawiki/extensions/CirrusSearch@master] selenium: await browser.saveScreenshot

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

Change 960040 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] bridge: selenium: await browser.saveScreenshot

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