mediawiki-extensions-Cite/tests/selenium
vidhi-mody 76c38c766d 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 `$`.
- `browser.elements` with `$$`.
- `chromeOptions` with `'goog:chromeOptions'`.
- `password` with `mwPwd`.
- `username` with `mwUser`.
- `waitForVisible()` with `waitForDisplayed()`.
- `isVisible()` with `isDisplayed()`.

Bug: T253343
Change-Id: Ia656c8bc9fa76ae80bc356dc18c821a93b8cd875
2020-06-25 01:19:38 +05:30
..
pageobjects Selenium: Update to WebdriverIO v5 2020-06-25 01:19:38 +05:30
specs Selenium: Update to WebdriverIO v5 2020-06-25 01:19:38 +05:30
.eslintrc.json build: Update devDependencies 2020-06-09 11:29:03 +01:00
README.md Add first browser test 2018-11-19 16:08:42 +00:00
wdio.conf.js Selenium: Update to WebdriverIO v5 2020-06-25 01:19:38 +05:30

Selenium tests

Please see tests/selenium/README.md file in mediawiki/core repository, usually at mediawiki/vagrant/mediawiki folder.

Setup

Set up MediaWiki-Vagrant:

cd mediawiki/vagrant
vagrant up
vagrant roles enable cite
vagrant provision
cd mediawiki
npm install

Run all specs

Run test specs from both mediawiki/core and installed extensions:

cd mediawiki
npm run selenium

Run specific tests

To run only some tests, you first have to start Chromedriver in one terminal window:

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

Then, in another terminal window run this the current extension directory:

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

You can also filter specific test(s) by name:

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

Make sure Chromedriver is running when executing the above command.