Page MenuHomePhabricator

Update wdio-mediawiki to work with both WebdriverIO v7 and v8
Closed, ResolvedPublic8 Estimated Story Points

Description

We are patching wdio-mediawiki's LoginPage, because we have found that the current implementation does not consistently work. In specific, it fails to await the appearance of the username input element, password input element, login button element before attempting to set values to the input elements and click to login. We must discover:

To whom and how to report this bug so that it can be fixed
If it is presently working for wdio-mediawiki, and if so, how

Acceptance Criteria:

A bug report, Phabricator ticket, and/or pull request is submitted for the wdio-mediawiki LoginPage code
Information on how to do that is added to some knowledge sharing page for our team, perhaps a relevant wiki

Technical Guidance:

The erroneous code may be found here: https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/core/+/refs/heads/wmf/1.40.0-wmf.24/tests/selenium/wdio-mediawiki/LoginPage.js
The patch we're proposing can be found here: https://github.com/wmde/wikibase-release-pipeline/blob/T343430-wdio-async/test/helpers/pages/SuiteLoginPage.js

During implementation of T346030, patched wdio-mediawiki code:

  • test/helpers/SuiteLoginPage.js patched wdio-mediawiki/LoginPage
  • test/helpers/PagePatch.js patched wdio-mediawiki/Page
  • test/helpers/MediawikiScreenshotPatch.js patched screenshot-related functions in wdio-mediawiki/index.js

As part of this work first evaluate whether we should rely on this MediaWiki WDIO library at all: If not, then this task can become simply better organising our "patches" to be named to be our own library code, and remove the wdio-mediawiki npm dependency. We want to stick with wdio-mediawiki for now.

Event Timeline

As part of this work first evaluate whether we should rely on this MediaWiki WDIO library at all: If not, then this task can become simply better organising our "patches" to be named to be our own library code, and remove the wdio-mediawiki npm dependency.

Change 968629 had a related patch set uploaded (by Zfilipin; author: Ricki Jay):

[mediawiki/core@master] LoginPage.js: Await login waitForDisplayed(), use Process Env Variables Page.js: Use config or options index.js: Optional screenshot path

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

The problem is that wikibase-release-pipeline is using webdriverio v8, while core (and hence wdio-mediawiki) are using v7. After updating to v8, logging in and taking screenshots are broken.

Currently, wikibase-release-pipeline has copy/pasted code from wdio-mediawiki to their repository and patched it there. That is a ok as a temporary workaround, but obviously not so great long term.

The solution(s):

Change 968629 had a related patch set uploaded (by Robert Timm; author: Ricki Jay):

[mediawiki/core@master] browser.config incompatible with wdio v8

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

Change 968629 had a related patch set uploaded (by Zfilipin; author: Ricki Jay):

[mediawiki/core@master] selenium: browser.config incompatible with WebdriverIO v8

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

zeljkofilipin renamed this task from Update WDIO-Mediawiki to work with WDIO v8 to Update wdio-mediawiki to work with both WebdriverIO v7 and v8.Nov 16 2023, 4:17 PM

Change 968629 merged by jenkins-bot:

[mediawiki/core@master] selenium: Screenshots work with both WebdriverIO v7 and v8

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

Change 975025 had a related patch set uploaded (by Zfilipin; author: Zfilipin):

[mediawiki/core@master] WIP selenium: release wdio-mediawiki 2.4.0

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

Change 975025 merged by jenkins-bot:

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

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

Change 976183 had a related patch set uploaded (by Zfilipin; author: Zfilipin):

[mediawiki/core@master] Revert "selenium: Screenshots work with both WebdriverIO v7 and v8"

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

Change 976183 merged by jenkins-bot:

[mediawiki/core@master] Revert "selenium: Screenshots work with both WebdriverIO v7 and v8"

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