mediawiki-extensions-Echo/tests/selenium
vidhi-mody f25ed7e705 Selenium: Update to WebdriverIO v5
Update NPM packages: webdriverio, wdio-mediawiki.

Replace NPM packages:
- wdio-mocha-framework with @wdio/mocha-framework.
- wdio-spec-reporter with @wdio/spec-reporter.

New NPM packages: @wdio/cli, @wdio/local-runner, @wdio/sync.

Replace:
- `browser.element` with `$`.
- `chromeOptions` with `'goog:chromeOptions'`.
- `password` with `mwPwd`.
- `username` with `mwUser`.
- `waitForVisible()` with `waitForDisplayed()`.

Bug: T250610
Change-Id: If7a5ee9588f082be18f27ee45a051ae956c688f5
2020-06-22 15:54:30 +00:00
..
pageobjects Selenium: Update to WebdriverIO v5 2020-06-22 15:54:30 +00:00
specs Selenium: Update to WebdriverIO v5 2020-06-22 15:54:30 +00:00
.eslintrc.json build: Update eslint-config-wikimedia to 0.16.1 2020-06-15 16:19:00 +01:00
README.md Selenium: update and simplify README 2019-03-26 16:27:06 +01:00
wdio.conf.js Selenium: Update to WebdriverIO v5 2020-06-22 15:54:30 +00:00

Selenium tests

For more information see https://www.mediawiki.org/wiki/Selenium/Node.js and [PATH]/mediawiki/vagrant/mediawiki/tests/selenium/README.md.

Setup

Set up MediaWiki-Vagrant:

cd [PATH]/mediawiki/vagrant/mediawiki/extensions/Echo
vagrant up
vagrant roles enable echo
vagrant provision
npm install

Chromedriver has to run in one terminal window:

chromedriver --url-base=wd/hub --port=4444

Run all specs

In another terminal window:

npm run selenium-test

T171963 No active login attempt is in progress for your session

If you get this error message when logging in at 127.0.0.1:8080, the workaround is to log in at dev.wiki.local.wmftest.net:8080

MW_SERVER=http://dev.wiki.local.wmftest.net:8080  npm run selenium-test

Run specific tests

Filter by file name:

npm run selenium-test -- --spec tests/selenium/specs/[FILE-NAME].js

Filter by file name and test name:

npm run selenium-test -- --spec tests/selenium/specs/[FILE-NAME.js] --mochaOpts.grep [TEST-NAME]