From f195a217b42e7df5d94d06183ae8938d292335f2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C5=BDeljko=20Filipin?= Date: Thu, 29 Mar 2018 16:12:35 +0200 Subject: [PATCH] Selenium: update WebdriverIO configuration No changes are made to the configuration file. It has just been regenerated with the latest WebdriverIO version. Minor whitespace cleanup has been made to the file after it has been generated so it conforms to our ESLint configuration. This is the first step in updating configuration so videos of failed tests are recorded. Bug: T179188 Change-Id: Id0db3743ae7d828357b1527770bb7dcd2e02f99b --- tests/selenium/wdio.conf.js | 156 ++++++++++++++++++++++++------------ 1 file changed, 106 insertions(+), 50 deletions(-) diff --git a/tests/selenium/wdio.conf.js b/tests/selenium/wdio.conf.js index 5eba0e0b9c..73e6bb9f0c 100644 --- a/tests/selenium/wdio.conf.js +++ b/tests/selenium/wdio.conf.js @@ -9,10 +9,6 @@ function relPath( foo ) { } exports.config = { - - // - // ====== - // // ====== // Custom // ====== @@ -106,11 +102,20 @@ exports.config = { // Enables colors for log output. coloredLogs: true, // + // Warns when a deprecated command is used + deprecationWarnings: true, + // + // If you only want to run your tests until a specific amount of tests have failed use + // bail (default is 0 - don't bail, run all tests). + bail: 0, + // // Saves a screenshot to a given path if a command fails. screenshotPath: './log/', // - // Set a base URL in order to shorten url command calls. If your url parameter starts - // with "/", then the base url gets prepended. + // 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. + // If your `url` parameter starts without a scheme or `/` (like `some/path`), the base url + // gets prepended directly. baseUrl: ( process.env.MW_SERVER === undefined ? 'http://127.0.0.1:8080' : @@ -139,14 +144,14 @@ exports.config = { // WebdriverRTC: https://github.com/webdriverio/webdriverrtc // Browserevent: https://github.com/webdriverio/browserevent // plugins: { - // webdrivercss: { - // screenshotRoot: 'my-shots', - // failedComparisonsRoot: 'diffs', - // misMatchTolerance: 0.05, - // screenWidth: [320,480,640,1024] - // }, - // webdriverrtc: {}, - // browserevent: {} + // webdrivercss: { + // screenshotRoot: 'my-shots', + // failedComparisonsRoot: 'diffs', + // misMatchTolerance: 0.05, + // screenWidth: [320,480,640,1024] + // }, + // webdriverrtc: {}, + // browserevent: {} // }, // // Test runner services @@ -161,7 +166,7 @@ exports.config = { // Make sure you have the wdio adapter package for the specific framework installed // before running any tests. framework: 'mocha', - + // // Test reporter for stdout. // The only one supported by default is 'dot' // see also: http://webdriver.io/guide/testrunner/reporters.html @@ -181,41 +186,65 @@ exports.config = { // it and to build services around it. You can either apply a single function or an array of // methods to it. If one of them returns with a promise, WebdriverIO will wait until that promise got // resolved to continue. - // - // Gets executed once before all workers get launched. - // onPrepare: function ( config, capabilities ) { - // } - // - // Gets executed before test execution begins. At this point you can access all global - // variables, such as `browser`. It is the perfect place to define custom commands. + /** + * Gets executed once before all workers get launched. + * @param {Object} config wdio configuration object + * @param {Array.} capabilities list of capabilities details + */ + // onPrepare: function (config, capabilities) { + // }, + /** + * Gets executed just before initialising the webdriver session and test framework. It allows you + * to manipulate configurations depending on the capability or spec. + * @param {Object} config wdio configuration object + * @param {Array.} capabilities list of capabilities details + * @param {Array.} specs List of spec file paths that are to be run + */ + // beforeSession: function (config, capabilities, specs) { + // }, + /** + * Gets executed before test execution begins. At this point you can access to all global + * variables like `browser`. It is the perfect place to define custom commands. + * @param {Array.} capabilities list of capabilities details + * @param {Array.} specs List of spec file paths that are to be run + */ // before: function (capabilities, specs) { // }, - // - // Hook that gets executed before the suite starts - // beforeSuite: function (suite) { + /** + * Runs before a WebdriverIO command gets executed. + * @param {String} commandName hook command name + * @param {Array} args arguments that command would receive + */ + // beforeCommand: function (commandName, args) { // }, - // - // Hook that gets executed _before_ a hook within the suite starts (e.g. runs before calling - // beforeEach in Mocha) - // beforeHook: function () { + /** + * Hook that gets executed before the suite starts + * @param {Object} suite suite details + */ + // beforeSuite: function (suite) { // }, - // - // Hook that gets executed _after_ a hook within the suite starts (e.g. runs after calling - // afterEach in Mocha) - // - // Function to be executed before a test (in Mocha/Jasmine) or a step (in Cucumber) starts. + /** + * Function to be executed before a test (in Mocha/Jasmine) or a step (in Cucumber) starts. + * @param {Object} test test details + */ // beforeTest: function (test) { // }, - // - // Runs before a WebdriverIO command gets executed. - // beforeCommand: function (commandName, args) { + /** + * Hook that gets executed _before_ a hook within the suite starts (e.g. runs before calling + * beforeEach in Mocha) + */ + // beforeHook: function () { // }, - // - // Runs after a WebdriverIO command gets executed - // afterCommand: function (commandName, args, result, error) { + /** + * Hook that gets executed _after_ a hook within the suite ends (e.g. runs after calling + * afterEach in Mocha) + */ + // afterHook: function () { // }, - // - // Function to be executed after a test (in Mocha/Jasmine) or a step (in Cucumber) starts. + /** + * Function to be executed after a test (in Mocha/Jasmine) or a step (in Cucumber) ends. + * @param {Object} test test details + */ // from https://github.com/webdriverio/webdriverio/issues/269#issuecomment-306342170 afterTest: function ( test ) { var filename, filePath; @@ -232,17 +261,44 @@ exports.config = { console.log( '\n\tScreenshot location:', filePath, '\n' ); } // - // Hook that gets executed after the suite has ended + /** + * Hook that gets executed after the suite has ended + * @param {Object} suite suite details + */ // afterSuite: function (suite) { // }, - // - // Gets executed after all tests are done. You still have access to all global variables from - // the test. + /** + * Runs after a WebdriverIO command gets executed + * @param {String} commandName hook command name + * @param {Array} args arguments that command would receive + * @param {Number} result 0 - command success, 1 - command error + * @param {Object} error error object if any + */ + // afterCommand: function (commandName, args, result, error) { + // }, + /** + * Gets executed after all tests are done. You still have access to all global variables from + * the test. + * @param {Number} result 0 - test pass, 1 - test fail + * @param {Array.} capabilities list of capabilities details + * @param {Array.} specs List of spec file paths that ran + */ // after: function (result, capabilities, specs) { // }, - // - // Gets executed after all workers got shut down and the process is about to exit. It is not - // possible to defer the end of the process using a promise. - // onComplete: function(exitCode) { + /** + * Gets executed right after terminating the webdriver session. + * @param {Object} config wdio configuration object + * @param {Array.} capabilities list of capabilities details + * @param {Array.} specs List of spec file paths that ran + */ + // afterSession: function (config, capabilities, specs) { + // }, + /** + * Gets executed after all workers got shut down and the process is about to exit. + * @param {Object} exitCode 0 - success, 1 - fail + * @param {Object} config wdio configuration object + * @param {Array.} capabilities list of capabilities details + */ + // onComplete: function(exitCode, config, capabilities) { // } }; -- 2.20.1