Doesn't seem to add anything, except complexity.
This has the benefit of matching more closely the way the README
recommends running individual tests.
Also add a check for 'chromedriver' before running it.
Normally the -e and pipefail would suffice, but because
it runs in the background, the error can be buried,
hard to find, or even not cause exit code to be set
properly. Thus, do a simple 'hash' check that will
print a useful command and exit cleanly.
Before:
> $ something &
> [1] 57922
> -bash: something: command not found
> [1]+ Exit 127 something
> $ echo $?
> 0
After:
> $ hash something
> -bash: hash: something: not found
> (exit: 1) $ echo $?
> 1
Change-Id: Id95f18927b5443defe679a77a82c5cbdd127c716
grunt.loadNpmTasks( 'grunt-jsonlint' );
grunt.loadNpmTasks( 'grunt-karma' );
grunt.loadNpmTasks( 'grunt-stylelint' );
grunt.loadNpmTasks( 'grunt-jsonlint' );
grunt.loadNpmTasks( 'grunt-karma' );
grunt.loadNpmTasks( 'grunt-stylelint' );
- grunt.loadNpmTasks( 'grunt-webdriver' );
karmaProxy[ wgScriptPath ] = {
target: wgServer + wgScriptPath,
karmaProxy[ wgScriptPath ] = {
target: wgServer + wgScriptPath,
return require( 'path' ).join( dest, src.replace( 'resources/', '' ) );
}
}
return require( 'path' ).join( dest, src.replace( 'resources/', '' ) );
}
}
- },
-
- // Configure WebdriverIO task
- webdriver: {
- test: {
- configFile: './tests/selenium/wdio.conf.js'
- }
} );
grunt.registerTask( 'assert-mw-env', function () {
} );
grunt.registerTask( 'assert-mw-env', function () {
"doc": "jsduck",
"postdoc": "grunt copy:jsduck",
"selenium": "./tests/selenium/selenium.sh",
"doc": "jsduck",
"postdoc": "grunt copy:jsduck",
"selenium": "./tests/selenium/selenium.sh",
- "selenium-test": "grunt webdriver:test"
+ "selenium-test": "wdio ./tests/selenium/wdio.conf.js"
},
"devDependencies": {
"bluebird": "3.5.1",
},
"devDependencies": {
"bluebird": "3.5.1",
"grunt-jsonlint": "1.1.0",
"grunt-karma": "2.0.0",
"grunt-stylelint": "0.10.0",
"grunt-jsonlint": "1.1.0",
"grunt-karma": "2.0.0",
"grunt-stylelint": "0.10.0",
- "grunt-webdriver": "2.0.3",
"karma": "1.7.1",
"karma-chrome-launcher": "2.2.0",
"karma-firefox-launcher": "1.0.1",
"karma": "1.7.1",
"karma-chrome-launcher": "2.2.0",
"karma-firefox-launcher": "1.0.1",
"browser": false
},
"rules":{
"browser": false
},
"rules":{
- [Chrome](https://www.google.com/chrome/)
- [ChromeDriver](https://sites.google.com/a/chromium.org/chromedriver/)
- [Node.js](https://nodejs.org/en/)
- [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:
+If using MediaWiki-Vagrant:
cd mediawiki/vagrant
vagrant up
cd mediawiki/vagrant
vagrant up
By default, Chrome will run in headless mode. If you want to see Chrome, set DISPLAY
environment variable to any value:
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
+ DISPLAY=1 npm run selenium
To run only one file (for example page.js), you first need to spawn the chromedriver:
To run only one file (for example page.js), you first need to spawn the chromedriver:
#!/usr/bin/env bash
set -euo pipefail
#!/usr/bin/env bash
set -euo pipefail
+# Check the command before running in background so
+# that it can actually fail and have a descriptive error
+hash chromedriver
chromedriver --url-base=/wd/hub --port=4444 &
# Make sure it is killed to prevent file descriptors leak
function kill_chromedriver() {
chromedriver --url-base=/wd/hub --port=4444 &
# Make sure it is killed to prevent file descriptors leak
function kill_chromedriver() {