From: Ċ½eljko Filipin Date: Sat, 7 Apr 2018 13:56:56 +0000 (+0200) Subject: selenium: Remove Jenkins configuration file X-Git-Tag: 1.31.0-rc.0~73^2 X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=commitdiff_plain;h=4cbd36db87a4aa1888a63120ea41c678fb4be40c selenium: Remove Jenkins configuration file Both Mocha and Cucumber tests should run. Since WebdriverIO supports only running one test framework, the only way to do it is to have a generic configuration file and two framework-specific files (Mocha, Cucumber). Having Jenkins configuration file complicates things, and there is no need for it. Bug: T179190 Change-Id: I710066f7b5479dcad27aa57cd61007c1c2d88931 --- diff --git a/Gruntfile.js b/Gruntfile.js index cb9a20d0a7..69a123cc9f 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -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 index de2b738e28..0000000000 --- a/tests/selenium/wdio.conf.jenkins.js +++ /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/' - } - } -} ); diff --git a/tests/selenium/wdio.conf.js b/tests/selenium/wdio.conf.js index 0b374c848a..0930a0f1fa 100644 --- a/tests/selenium/wdio.conf.js +++ b/tests/selenium/wdio.conf.js @@ -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/