1 /* eslint comma-dangle: 0 */
2 /* eslint no-undef: "error"*/
3 /* eslint no-console: 0 */
7 const path
= require( 'path' );
9 function relPath( foo
) {
10 return path
.resolve( __dirname
, '../..', foo
);
21 // Define any custom variables.
24 // Use if from tests with:
25 // browser.options.username
26 username
: process
.env
.MEDIAWIKI_USER
=== undefined ?
28 process
.env
.MEDIAWIKI_USER
,
29 password
: process
.env
.MEDIAWIKI_PASSWORD
=== undefined ?
31 process
.env
.MEDIAWIKI_PASSWORD
,
36 // Define which test specs should run. The pattern is relative to the directory
37 // from which `wdio` was called. Notice that, if you are calling `wdio` from an
38 // NPM script (see https://docs.npmjs.com/cli/run-script) then the current working
39 // directory is where your package.json resides, so `wdio` will be called from there.
42 relPath( './tests/selenium/specs/**/*.js' ),
43 relPath( './extensions/*/tests/selenium/specs/**/*.js' ),
44 relPath( './extensions/VisualEditor/modules/ve-mw/tests/selenium/specs/**/*.js' )
46 // Patterns to exclude.
48 // 'path/to/excluded/files'
54 // Define your capabilities here. WebdriverIO can run multiple capabilities at the same
55 // time. Depending on the number of capabilities, WebdriverIO launches several test
56 // sessions. Within your capabilities you can overwrite the spec and exclude options in
57 // order to group specific specs to a specific capability.
59 // First, you can define how many instances should be started at the same time. Let's
60 // say you have 3 different capabilities (Chrome, Firefox, and Safari) and you have
61 // set maxInstances to 1; wdio will spawn 3 processes. Therefore, if you have 10 spec
62 // files and you set maxInstances to 10, all spec files will get tested at the same time
63 // and 30 processes will get spawned. The property handles how many capabilities
64 // from the same test should run tests.
68 // If you have trouble getting all important capabilities together, check out the
69 // Sauce Labs platform configurator - a great tool to configure your capabilities:
70 // https://docs.saucelabs.com/reference/platforms-configurator
72 // For Chrome/Chromium https://sites.google.com/a/chromium.org/chromedriver/capabilities
74 // maxInstances can get overwritten per capability. So if you have an in-house Selenium
75 // grid with only 5 firefox instances available you can make sure that not more than
76 // 5 instances get started at a time.
79 browserName
: 'chrome',
80 // Since Chrome v57 https://bugs.chromium.org/p/chromedriver/issues/detail?id=1625
82 args
: [ '--enable-automation' ]
86 // ===================
87 // Test Configurations
88 // ===================
89 // Define all options that are relevant for the WebdriverIO instance here
91 // By default WebdriverIO commands are executed in a synchronous way using
92 // the wdio-sync package. If you still want to run your tests in an async way
93 // e.g. using promises you can set the sync option to false.
96 // Level of logging verbosity: silent | verbose | command | data | result | error
99 // Enables colors for log output.
102 // Saves a screenshot to a given path if a command fails.
103 screenshotPath
: './log/',
105 // Set a base URL in order to shorten url command calls. If your url parameter starts
106 // with "/", then the base url gets prepended.
108 process
.env
.MW_SERVER
=== undefined ?
109 'http://127.0.0.1:8080' :
110 process
.env
.MW_SERVER
112 process
.env
.MW_SCRIPT_PATH
=== undefined ?
114 process
.env
.MW_SCRIPT_PATH
117 // Default timeout for all waitFor* commands.
118 waitforTimeout
: 20000,
120 // Default timeout in milliseconds for request
121 // if Selenium Grid doesn't send response
122 connectionRetryTimeout
: 90000,
124 // Default request retries count
125 connectionRetryCount
: 3,
127 // Initialize the browser instance with a WebdriverIO plugin. The object should have the
128 // plugin name as key and the desired plugin options as properties. Make sure you have
129 // the plugin installed before running any tests. The following plugins are currently
131 // WebdriverCSS: https://github.com/webdriverio/webdrivercss
132 // WebdriverRTC: https://github.com/webdriverio/webdriverrtc
133 // Browserevent: https://github.com/webdriverio/browserevent
136 // screenshotRoot: 'my-shots',
137 // failedComparisonsRoot: 'diffs',
138 // misMatchTolerance: 0.05,
139 // screenWidth: [320,480,640,1024]
145 // Test runner services
146 // Services take over a specific job you don't want to take care of. They enhance
147 // your test setup with almost no effort. Unlike plugins, they don't add new
148 // commands. Instead, they hook themselves up into the test process.
150 // Framework you want to run your specs with.
151 // The following are supported: Mocha, Jasmine, and Cucumber
152 // see also: http://webdriver.io/guide/testrunner/frameworks.html
154 // Make sure you have the wdio adapter package for the specific framework installed
155 // before running any tests.
158 // Test reporter for stdout.
159 // The only one supported by default is 'dot'
160 // see also: http://webdriver.io/guide/testrunner/reporters.html
161 reporters
: [ 'spec' ],
163 // Options to be passed to Mocha.
164 // See the full list at http://mochajs.org/
173 // WebdriverIO provides several hooks you can use to interfere with the test process in order to enhance
174 // it and to build services around it. You can either apply a single function or an array of
175 // methods to it. If one of them returns with a promise, WebdriverIO will wait until that promise got
176 // resolved to continue.
178 // Gets executed once before all workers get launched.
179 // onPrepare: function ( config, capabilities ) {
182 // Gets executed before test execution begins. At this point you can access all global
183 // variables, such as `browser`. It is the perfect place to define custom commands.
184 // before: function (capabilities, specs) {
187 // Hook that gets executed before the suite starts
188 // beforeSuite: function (suite) {
191 // Hook that gets executed _before_ a hook within the suite starts (e.g. runs before calling
192 // beforeEach in Mocha)
193 // beforeHook: function () {
196 // Hook that gets executed _after_ a hook within the suite starts (e.g. runs after calling
197 // afterEach in Mocha)
199 // Function to be executed before a test (in Mocha/Jasmine) or a step (in Cucumber) starts.
200 // beforeTest: function (test) {
203 // Runs before a WebdriverIO command gets executed.
204 // beforeCommand: function (commandName, args) {
207 // Runs after a WebdriverIO command gets executed
208 // afterCommand: function (commandName, args, result, error) {
211 // Function to be executed after a test (in Mocha/Jasmine) or a step (in Cucumber) starts.
212 // afterTest: function (test) {
215 // Hook that gets executed after the suite has ended
216 // afterSuite: function (suite) {
219 // Gets executed after all tests are done. You still have access to all global variables from
221 // after: function (result, capabilities, specs) {
224 // Gets executed after all workers got shut down and the process is about to exit. It is not
225 // possible to defer the end of the process using a promise.
226 // onComplete: function(exitCode) {