Merge "selenium: Run wdio directly without grunt"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Thu, 3 May 2018 07:29:40 +0000 (07:29 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Thu, 3 May 2018 07:29:40 +0000 (07:29 +0000)
Gruntfile.js
package.json
tests/selenium/.eslintrc.json
tests/selenium/README.md
tests/selenium/selenium.sh

index 69a123c..898b48f 100644 (file)
@@ -13,7 +13,6 @@ module.exports = function ( grunt ) {
        grunt.loadNpmTasks( 'grunt-jsonlint' );
        grunt.loadNpmTasks( 'grunt-karma' );
        grunt.loadNpmTasks( 'grunt-stylelint' );
-       grunt.loadNpmTasks( 'grunt-webdriver' );
 
        karmaProxy[ wgScriptPath ] = {
                target: wgServer + wgScriptPath,
@@ -104,15 +103,7 @@ module.exports = function ( grunt ) {
                                        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 () {
index b9a7ccc..7b779a6 100644 (file)
@@ -6,7 +6,7 @@
     "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",
@@ -21,7 +21,6 @@
     "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",
index 85fc310..e39226c 100644 (file)
@@ -9,6 +9,6 @@
                "browser": false
        },
        "rules":{
-               "no-console":0
+               "no-console": 0
        }
 }
index b15d407..274eb14 100644 (file)
@@ -5,9 +5,8 @@
 - [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
@@ -24,7 +23,7 @@ Set up MediaWiki-Vagrant:
 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:
 
index 6b71019..4a5c254 100755 (executable)
@@ -1,5 +1,8 @@
 #!/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() {