mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/RelatedArticles
synced 2024-11-24 00:05:50 +00:00
selenium: Update README.md file
Bug: T282237 Change-Id: Ia14349e8630e7a075e5f3ce8dea1572027309ef3
This commit is contained in:
parent
68cd3839e7
commit
2578a87e28
|
@ -1,43 +1,21 @@
|
||||||
# Selenium tests
|
# Selenium tests
|
||||||
|
|
||||||
Please see tests/selenium/README.md file in mediawiki/core repository, usually at mediawiki/vagrant/mediawiki folder.
|
For more information see https://www.mediawiki.org/wiki/Selenium
|
||||||
|
|
||||||
## Setup
|
## Setup
|
||||||
|
|
||||||
Set up MediaWiki-Vagrant:
|
See https://www.mediawiki.org/wiki/MediaWiki-Docker/Extension/RelatedArticles
|
||||||
|
|
||||||
cd mediawiki/vagrant
|
## Run all specs
|
||||||
vagrant up
|
|
||||||
vagrant roles enable mobilefrontend relatedarticles
|
|
||||||
vagrant provision
|
|
||||||
cd mediawiki
|
|
||||||
npm install
|
|
||||||
echo 'include_once "$IP/extensions/RelatedArticles/tests/selenium/LocalSettings.php";' >> LocalSettings.php
|
|
||||||
|
|
||||||
## Start Chromedriver and run all tests
|
npm run selenium-test
|
||||||
|
|
||||||
Run both mediawiki/core and extension tests from mediawiki/core repository (usually at mediawiki/vagrant/mediawiki folder):
|
## Run specific tests
|
||||||
|
|
||||||
npm run selenium
|
Filter by file name:
|
||||||
|
|
||||||
## Start Chromedriver
|
npm run selenium-test -- --spec tests/selenium/specs/[FILE-NAME]
|
||||||
|
|
||||||
To run only some tests, you first have to start Chromedriver in one terminal tab (or window):
|
Filter by file name and test name:
|
||||||
|
|
||||||
chromedriver --url-base=wd/hub --port=4444
|
npm run selenium-test -- --spec tests/selenium/specs/[FILE-NAME] --mochaOpts.grep [TEST-NAME]
|
||||||
|
|
||||||
## 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.
|
|
Loading…
Reference in a new issue