'use strict';
-const password = 'vagrant',
- 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 );
],
// Patterns to exclude.
exclude: [
- // 'path/to/excluded/files'
+ './extensions/CirrusSearch/tests/selenium/specs/**/*.js'
],
//
// ============
maxInstances: 1,
//
browserName: 'chrome',
- // Since Chrome v57 https://bugs.chromium.org/p/chromedriver/issues/detail?id=1625
chromeOptions: {
- args: [ '--enable-automation' ]
+ // Run headless when there is no DISPLAY
+ // --headless: since Chrome 59 https://chromium.googlesource.com/chromium/src/+/59.0.3030.0/headless/README.md
+ args: (
+ process.env.DISPLAY ? [] : [ '--headless' ]
+ ).concat(
+ // Disable Chrome sandbox when running in Docker
+ fs.existsSync( '/.dockerenv' ) ? [ '--no-sandbox' ] : []
+ )
}
} ],
//
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.
),
//
// Default timeout for all waitFor* commands.
- waitforTimeout: 20000,
+ waitforTimeout: 10000,
//
// Default timeout in milliseconds for request
// if Selenium Grid doesn't send response
// 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/