Merge "selenium: Remove Jenkins configuration file"
authorKrinkle <krinklemail@gmail.com>
Sat, 14 Apr 2018 00:11:56 +0000 (00:11 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Sat, 14 Apr 2018 00:11:56 +0000 (00:11 +0000)
Gruntfile.js
tests/selenium/wdio.conf.jenkins.js [deleted file]
tests/selenium/wdio.conf.js

index cb9a20d..69a123c 100644 (file)
@@ -4,7 +4,6 @@ module.exports = function ( grunt ) {
 
        var wgServer = process.env.MW_SERVER,
                wgScriptPath = process.env.MW_SCRIPT_PATH,
-               WebdriverIOconfigFile,
                karmaProxy = {};
 
        grunt.loadNpmTasks( 'grunt-banana-checker' );
@@ -21,12 +20,6 @@ module.exports = function ( grunt ) {
                changeOrigin: true
        };
 
-       if ( process.env.JENKINS_HOME ) {
-               WebdriverIOconfigFile = './tests/selenium/wdio.conf.jenkins.js';
-       } else {
-               WebdriverIOconfigFile = './tests/selenium/wdio.conf.js';
-       }
-
        grunt.initConfig( {
                eslint: {
                        all: [
@@ -116,7 +109,7 @@ module.exports = function ( grunt ) {
                // Configure WebdriverIO task
                webdriver: {
                        test: {
-                               configFile: WebdriverIOconfigFile
+                               configFile: './tests/selenium/wdio.conf.js'
                        }
                }
 
diff --git a/tests/selenium/wdio.conf.jenkins.js b/tests/selenium/wdio.conf.jenkins.js
deleted file mode 100644 (file)
index de2b738..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-'use strict';
-const merge = require( 'deepmerge' ),
-       password = 'testpass',
-       username = 'WikiAdmin',
-       wdioConf = require( './wdio.conf.js' );
-
-// Overwrite default settings
-exports.config = merge( wdioConf.config, {
-       username: process.env.MEDIAWIKI_USER === undefined ?
-               username :
-               process.env.MEDIAWIKI_USER,
-       password: process.env.MEDIAWIKI_PASSWORD === undefined ?
-               password :
-               process.env.MEDIAWIKI_PASSWORD,
-       screenshotPath: '../log/',
-       baseUrl: process.env.MW_SERVER + process.env.MW_SCRIPT_PATH,
-       exclude: [
-               './extensions/CirrusSearch/tests/selenium/specs/**/*.js'
-       ],
-       reporters: [ 'spec', 'junit' ],
-       reporterOptions: {
-               junit: {
-                       outputDir: '../log/'
-               }
-       }
-} );
index 0b374c8..0930a0f 100644 (file)
@@ -1,9 +1,21 @@
 'use strict';
 
-const password = 'vagrant',
-       fs = require( 'fs' ),
-       path = require( 'path' ),
+const fs = require( 'fs' ),
+       path = require( 'path' );
+
+let logPath, password, username;
+
+// username and password will be used only if
+// MEDIAWIKI_USER or MEDIAWIKI_PASSWORD environment variables are not set
+if ( process.env.JENKINS_HOME ) {
+       logPath = '../log/';
+       password = 'testpass';
+       username = 'WikiAdmin';
+} else {
+       logPath = './log/';
+       password = 'vagrant';
        username = 'Admin';
+}
 
 function relPath( foo ) {
        return path.resolve( __dirname, '../..', foo );
@@ -49,7 +61,7 @@ exports.config = {
        ],
        // Patterns to exclude.
        exclude: [
-       // 'path/to/excluded/files'
+               './extensions/CirrusSearch/tests/selenium/specs/**/*.js'
        ],
        //
        // ============
@@ -117,7 +129,7 @@ exports.config = {
        bail: 0,
        //
        // Saves a screenshot to a given path if a command fails.
-       screenshotPath: './log/',
+       screenshotPath: logPath,
        //
        // Set a base URL in order to shorten url command calls. If your `url` parameter starts
        // with `/`, the base url gets prepended, not including the path portion of your baseUrl.
@@ -177,7 +189,12 @@ exports.config = {
        // Test reporter for stdout.
        // The only one supported by default is 'dot'
        // see also: http://webdriver.io/guide/testrunner/reporters.html
-       reporters: [ 'spec' ],
+       reporters: [ 'spec', 'junit' ],
+       reporterOptions: {
+               junit: {
+                       outputDir: logPath
+               }
+       },
        //
        // Options to be passed to Mocha.
        // See the full list at http://mochajs.org/