mediawiki-extensions-Popups/tests/selenium
vidhi-mody 17a3e59a1e 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.
- wdio-junit-reporter with @wdio/junit-reporter.

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

Commands that return data no longer wrapped in `{ value: … }`.
Values are now returned directly.

Replace:
- `browser.element` with `$`.
- `chromeOptions` with `'goog:chromeOptions'`.
- `password` with `mwPwd`.
- `username` with `mwUser`.
- `moveToObject()` with `moveTo()`.
- `isVisible()` with `isDisplayed()`.

Bug: T258620
Change-Id: If339ff08b5e87c91905a65927ccd7e1b72b9f8e4
2020-07-24 17:17:01 +05:30
..
fixtures Add test for dwelling reference links inside a reference preview 2019-03-25 12:37:05 +00:00
pageobjects Selenium: Update to WebdriverIO v5 2020-07-24 17:17:01 +05:30
specs build: Update eslint-config-wikimedia to 0.16.2 2020-06-26 17:05:56 +01:00
.eslintrc.json build: Update eslint-config-wikimedia to 0.16.2 2020-06-26 17:05:56 +01:00
README.md Docs: Remove incorrect documentation about LocalSettings in tests README 2019-05-13 11:52:55 +00:00
wdio.conf.js Selenium: Update to WebdriverIO v5 2020-07-24 17:17:01 +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 popups
vagrant provision
cd mediawiki
npm install

Start Chromedriver and run all tests

Run both mediawiki/core and extension tests from mediawiki/core repository (usually at mediawiki/vagrant/mediawiki folder):

npm run selenium

Start Chromedriver

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

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

Run test(s) from one file

Then, in another terminal tab (or window) run this from mediawiki/core repository (usually at mediawiki/vagrant/mediawiki folder):

./node_modules/.bin/wdio tests/selenium/wdio.conf.js --spec extensions/EXTENSION-NAME/tests/selenium/specs/FILE-NAME.js

wdio is a dependency of mediawiki/core that you have installed with npm install.

Run specific test(s)

To run only test(s) which name contains string TEST-NAME, run this from mediawiki/core repository (usually at mediawiki/vagrant/mediawiki folder):

./node_modules/.bin/wdio tests/selenium/wdio.conf.js --spec extensions/EXTENSION-NAME/tests/selenium/specs/FILE-NAME.js --mochaOpts.grep TEST-NAME

Make sure Chromedriver is running when executing the above command.