selenium: Update README.md file

Bug: T282237
Change-Id: I16d7f7744f01be15e32a2729e9f516dbb508e41e
This commit is contained in:
sahil 2021-05-22 15:27:04 +05:30 committed by Sahilgrewalhere
parent b84f12e76a
commit 9a22c9a028

View file

@ -1,42 +1,21 @@
# 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
Set up MediaWiki-Vagrant:
See https://www.mediawiki.org/wiki/MediaWiki-Docker/Extension/Popups
cd mediawiki/vagrant
vagrant up
vagrant roles enable popups
vagrant provision
cd mediawiki
npm install
## Run all specs
## 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
## 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.
npm run selenium-test -- --spec tests/selenium/specs/[FILE-NAME] --mochaOpts.grep [TEST-NAME]