2017-07-28 12:05:35 +00:00
|
|
|
# Selenium tests
|
|
|
|
|
2019-03-26 14:35:11 +00:00
|
|
|
For more information see https://www.mediawiki.org/wiki/Selenium/Node.js and [PATH]/mediawiki/vagrant/mediawiki/tests/selenium/README.md.
|
2017-07-28 12:05:35 +00:00
|
|
|
|
2018-02-27 12:57:46 +00:00
|
|
|
## Setup
|
2017-07-28 12:05:35 +00:00
|
|
|
|
|
|
|
Set up MediaWiki-Vagrant:
|
|
|
|
|
2019-03-26 14:35:11 +00:00
|
|
|
cd [PATH]/mediawiki/vagrant/mediawiki/extensions/Echo
|
2017-07-28 12:05:35 +00:00
|
|
|
vagrant up
|
|
|
|
vagrant roles enable echo
|
|
|
|
vagrant provision
|
2018-02-27 12:57:46 +00:00
|
|
|
npm install
|
2017-07-28 12:05:35 +00:00
|
|
|
|
2019-03-26 14:35:11 +00:00
|
|
|
Chromedriver has to run in one terminal window:
|
2018-02-27 12:57:46 +00:00
|
|
|
|
2019-03-26 14:35:11 +00:00
|
|
|
chromedriver --url-base=wd/hub --port=4444
|
2017-07-28 12:05:35 +00:00
|
|
|
|
2019-03-26 14:35:11 +00:00
|
|
|
## Run all specs
|
2018-02-27 12:57:46 +00:00
|
|
|
|
2019-03-26 14:35:11 +00:00
|
|
|
In another terminal window:
|
2017-07-28 12:05:35 +00:00
|
|
|
|
2019-03-26 14:35:11 +00:00
|
|
|
npm run selenium-test
|
2017-07-28 12:05:35 +00:00
|
|
|
|
2019-03-26 14:35:11 +00:00
|
|
|
## [T171963](https://phabricator.wikimedia.org/T171963) `No active login attempt is in progress for your session`
|
2018-02-27 12:57:46 +00:00
|
|
|
|
2019-03-26 14:35:11 +00:00
|
|
|
If you get this error message when logging in at `127.0.0.1:8080`, the workaround
|
|
|
|
is to log in at `dev.wiki.local.wmftest.net:8080`
|
2018-02-27 12:57:46 +00:00
|
|
|
|
2019-03-26 14:35:11 +00:00
|
|
|
MW_SERVER=http://dev.wiki.local.wmftest.net:8080 npm run selenium-test
|
2018-02-27 12:57:46 +00:00
|
|
|
|
2019-03-26 14:35:11 +00:00
|
|
|
## Run specific tests
|
2018-02-27 12:57:46 +00:00
|
|
|
|
2019-03-26 14:35:11 +00:00
|
|
|
Filter by file name:
|
2017-07-28 12:05:35 +00:00
|
|
|
|
2019-03-26 14:35:11 +00:00
|
|
|
npm run selenium-test -- --spec tests/selenium/specs/[FILE-NAME].js
|
2017-07-28 12:05:35 +00:00
|
|
|
|
2019-03-26 14:35:11 +00:00
|
|
|
Filter by file name and test name:
|
2017-07-28 12:05:35 +00:00
|
|
|
|
2019-03-26 14:35:11 +00:00
|
|
|
npm run selenium-test -- --spec tests/selenium/specs/[FILE-NAME.js] --mochaOpts.grep [TEST-NAME]
|