selenium: Upgrade from webdriver v4 to v5
authorTimo Tijhof <krinklemail@gmail.com>
Fri, 27 Sep 2019 03:08:00 +0000 (04:08 +0100)
committerTimo Tijhof <krinklemail@gmail.com>
Sun, 29 Sep 2019 01:59:44 +0000 (02:59 +0100)
commit1955a8aa5646c10bc3457a519c2a43b0b1dbb2ad
tree1a7b3e9f4a2ae1270400c3f9c132fd162dabc380
parent50cd683080e5401c25bfef1a83abf28b1a4f8876
selenium: Upgrade from webdriver v4 to v5

* Options no longer needed or no longer exist in wdio v5:
  - coloredLogs: Now always on. The underlying 'chalk' library can still
    be influenced via the FORCE_COLOR environment variable.
  - screenshotPath: Removed. Was already disabled in our config.
  - deprecationWarnings: Meh.
  - 'sync: true' – On by default when `@wdio/sync` is installed.
    The wdio v5 config generator doesn't recommend setting manually.

* The selenium.sh script was removed. It existed to start and stop
  chromedriver for local use by developers. This is now done by
  the wdio-chromedriver-service. In WMF CI, Quibble starts its own
  chromedriver (as optimisation, reused across gated repos),
  which is why the 'selenium-test' entry points remains and skips
  this.

* The wdio-mediawiki package now requires wdio v5 and Node 10.
  This doesn't affect extension repos because versions are pinned.
  Upgrade may happen at the earliest convenience.

* Several WDIO methods changed names or signature. Full list at:
  <https://github.com/webdriverio/webdriverio/blob/v5.13.2/CHANGELOG.md#v500-2018-12-20>
  Highlights:
  - browser.element() is now browser.findElement() with "$()" as alias.
  - browser.localStorage replaced by browser.setLocalStorage.
  - browser.deleteCookie() requires `name` param. To delete all at once,
    there is a new method browser.deleteAllCookies().
  - Commands that return data no longer wrapped in `{ value: … }`.
    Values are now returned directly.
  - Custom config keys are now under browser.config instead of browser.options.
    Renamed our username/password keys to be mw-prefixed, to avoid clashes
    and reduce confusion with similar config keys.
  - browser.click(selector) and browser.getText(selector) no longer exist.
    Use $(selector).click() or .getText() instead.

* Fix "no such alert" warning from specs/page.js by removing the apparently
  redundant code.

Bug: T234002
Bug: T213268
Change-Id: I908997569ca8457997af30cb29e98ac41fae3b64
28 files changed:
package-lock.json
package.json
tests/selenium/.eslintrc.json
tests/selenium/pageobjects/createaccount.page.js
tests/selenium/pageobjects/delete.page.js
tests/selenium/pageobjects/edit.page.js
tests/selenium/pageobjects/history.page.js
tests/selenium/pageobjects/preferences.page.js
tests/selenium/pageobjects/recentchanges.page.js
tests/selenium/pageobjects/restore.page.js
tests/selenium/pageobjects/undo.page.js
tests/selenium/pageobjects/watchable.page.js
tests/selenium/pageobjects/watchlist.page.js
tests/selenium/specs/page.js
tests/selenium/specs/rollback.js
tests/selenium/specs/specialrecentchanges.js
tests/selenium/specs/specialwatchlist.js
tests/selenium/specs/user.js
tests/selenium/wdio-mediawiki/Api.js
tests/selenium/wdio-mediawiki/BlankPage.js
tests/selenium/wdio-mediawiki/LoginPage.js
tests/selenium/wdio-mediawiki/Page.js
tests/selenium/wdio-mediawiki/README.md
tests/selenium/wdio-mediawiki/RunJobs.js
tests/selenium/wdio-mediawiki/Util.js
tests/selenium/wdio-mediawiki/index.js
tests/selenium/wdio-mediawiki/package.json
tests/selenium/wdio.conf.js