|
před 5 roky | |
---|---|---|
.. | ||
pageobjects | před 5 roky | |
specs | před 5 roky | |
wdio-mediawiki | před 5 roky | |
.eslintrc.json | před 6 roky | |
README.md | před 6 roky | |
selenium.sh | před 6 roky | |
wdio.conf.js | před 6 roky |
If using MediaWiki-Vagrant:
cd mediawiki/vagrant
vagrant up
cd mediawiki
npm install
npm run selenium
By default, Chrome will run in headless mode. If you want to see Chrome, set DISPLAY environment variable to any value:
DISPLAY=1 npm run selenium
To run only one test (for example specs/page.js), you first need to start Chromedriver:
chromedriver --url-base=wd/hub --port=4444
Then, in another terminal:
npm run selenium-test -- --spec tests/selenium/specs/page.js
You can also filter specific cases, for ones that contain the string 'preferences':
npm run selenium-test -- tests/selenium/specs/user.js --mochaOpts.grep preferences
The runner reads the configuration from wdio.conf.js
. The defaults target
a MediaWiki-Vagrant installation on http://127.0.0.1:8080
with a user "Admin"
and password "vagrant". Those settings can be overridden using environment
variables:
MW_SERVER
: to be set to the value of your $wgServerMW_SCRIPT_PATH
: ditto with $wgScriptPathMEDIAWIKI_USER
: username of an account that can create users on the wikiMEDIAWIKI_PASSWORD
: password for above userExample:
MW_SERVER=http://example.org MW_SCRIPT_PATH=/dev/w npm run selenium