# Selenium tests
Please see tests/selenium/README.md file in mediawiki/cFor more repository, usually at mediawiki/vagrant/mediawiki folder andinformation see https://www.mediawiki.org/wiki/Selenium/Node.js and [PATH]/mediawiki/vagrant/mediawiki/tests/selenium/README.md.
## Setup
Set up MediaWiki-Vagrant:
cd cd [PATH]/mediawiki/vagrantt/mediawiki/extensions/[EXTENSION]
vagrant up
vagrant roles enable [ROLE]
vagrant provision
cd mediawiki
npm install
## Run all specs
Run test specs from both mediawiki/core and installed extensions:First, start Chromedriver in one terminal window:
cd mediawiki
npm run selenium
## Run specific testschromedriver --url-base=wd/hub --port=4444
To run only some testsThen, you first have to start Chromedriver in onein another terminal window:
chromedriver --url-base=wd/hub --port=4444npm run selenium-test
Then, in another terminal window run this the current extension directory:## Run specific tests
Make sure Chromedriver is running and run:
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.