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