Update git submodules
[lhc/web/wiklou.git] / tests / selenium / wdio.conf.js
index 7b74328..0930a0f 100644 (file)
@@ -1,8 +1,21 @@
 '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 );
@@ -48,7 +61,7 @@ exports.config = {
        ],
        // Patterns to exclude.
        exclude: [
-       // 'path/to/excluded/files'
+               './extensions/CirrusSearch/tests/selenium/specs/**/*.js'
        ],
        //
        // ============
@@ -83,7 +96,12 @@ exports.config = {
                chromeOptions: {
                        // 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' ]
+                       args: (
+                               process.env.DISPLAY ? [] : [ '--headless' ]
+                       ).concat(
+                               // Disable Chrome sandbox when running in Docker
+                               fs.existsSync( '/.dockerenv' ) ? [ '--no-sandbox' ] : []
+                       )
                }
        } ],
        //
@@ -111,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.
@@ -171,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/