Merge "search: Add result ranking in MySQL"
[lhc/web/wiklou.git] / tests / selenium / README.md
1 # Selenium tests
2
3 ## Prerequisites
4
5 - [Chrome](https://www.google.com/chrome/)
6 - [ChromeDriver](https://sites.google.com/a/chromium.org/chromedriver/)
7 - [Node.js](https://nodejs.org/en/)
8
9 If using MediaWiki-Vagrant:
10
11 cd mediawiki/vagrant
12 vagrant up
13
14 ## Installation
15
16 cd mediawiki
17 npm install
18
19 ## Usage
20
21 npm run selenium
22
23 By default, Chrome will run in headless mode. If you want to see Chrome, set DISPLAY
24 environment variable to any value:
25
26 DISPLAY=1 npm run selenium
27
28 To run only one file (for example page.js), you first need to spawn the chromedriver:
29
30 chromedriver --url-base=wd/hub --port=4444
31
32 Then in another terminal:
33
34 cd tests/selenium
35 ../../node_modules/.bin/wdio --spec specs/page.js
36
37 To run only one test (name contains string 'preferences'):
38
39 ../../node_modules/.bin/wdio --spec specs/user.js --mochaOpts.grep preferences
40
41 The runner reads the config file `wdio.conf.js` and runs the spec listed in
42 `page.js`.
43
44 The defaults in the configuration files aim are targeting a MediaWiki-Vagrant
45 installation on http://127.0.0.1:8080 with a user Admin and
46 password 'vagrant'. Those settings can be overridden using environment
47 variables:
48
49 `MW_SERVER`: to be set to the value of your $wgServer
50 `MW_SCRIPT_PATH`: ditto with $wgScriptPath
51 `MEDIAWIKI_USER`: username of an account that can create users on the wiki
52 `MEDIAWIKI_PASSWORD`: password for above user
53
54 Example:
55
56 MW_SERVER=http://example.org MW_SCRIPT_PATH=/dev/w npm run selenium
57
58 ## Links
59
60 - [Selenium/Node.js](https://www.mediawiki.org/wiki/Selenium/Node.js)