Add 3D filetype for STL files
[lhc/web/wiklou.git] / tests / selenium / wdio.conf.js
1 /* eslint comma-dangle: 0 */
2 /* eslint no-undef: "error" */
3 /* eslint no-console: 0 */
4 /* eslint-env node */
5 'use strict';
6
7 const path = require( 'path' );
8
9 function relPath( foo ) {
10 return path.resolve( __dirname, '../..', foo );
11 }
12
13 exports.config = {
14
15 //
16 // ======
17 //
18 // ======
19 // Custom
20 // ======
21 // Define any custom variables.
22 // Example:
23 // username: 'Admin',
24 // Use if from tests with:
25 // browser.options.username
26 username: process.env.MEDIAWIKI_USER === undefined ?
27 'Admin' :
28 process.env.MEDIAWIKI_USER,
29 password: process.env.MEDIAWIKI_PASSWORD === undefined ?
30 'vagrant' :
31 process.env.MEDIAWIKI_PASSWORD,
32 //
33 // ==================
34 // Specify Test Files
35 // ==================
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.
40 //
41 specs: [
42 relPath( './tests/selenium/specs/**/*.js' ),
43 relPath( './extensions/*/tests/selenium/specs/**/*.js' ),
44 relPath( './extensions/VisualEditor/modules/ve-mw/tests/selenium/specs/**/*.js' )
45 ],
46 // Patterns to exclude.
47 exclude: [
48 // 'path/to/excluded/files'
49 ],
50 //
51 // ============
52 // Capabilities
53 // ============
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.
58 //
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.
65 //
66 maxInstances: 1,
67 //
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
71 //
72 // For Chrome/Chromium https://sites.google.com/a/chromium.org/chromedriver/capabilities
73 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.
77 maxInstances: 1,
78 //
79 browserName: 'chrome',
80 // Since Chrome v57 https://bugs.chromium.org/p/chromedriver/issues/detail?id=1625
81 chromeOptions: {
82 args: [ '--enable-automation' ]
83 }
84 } ],
85 //
86 // ===================
87 // Test Configurations
88 // ===================
89 // Define all options that are relevant for the WebdriverIO instance here
90 //
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.
94 sync: true,
95 //
96 // Level of logging verbosity: silent | verbose | command | data | result | error
97 logLevel: 'error',
98 //
99 // Enables colors for log output.
100 coloredLogs: true,
101 //
102 // Saves a screenshot to a given path if a command fails.
103 screenshotPath: './log/',
104 //
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.
107 baseUrl: (
108 process.env.MW_SERVER === undefined ?
109 'http://127.0.0.1:8080' :
110 process.env.MW_SERVER
111 ) + (
112 process.env.MW_SCRIPT_PATH === undefined ?
113 '/w' :
114 process.env.MW_SCRIPT_PATH
115 ),
116 //
117 // Default timeout for all waitFor* commands.
118 waitforTimeout: 20000,
119 //
120 // Default timeout in milliseconds for request
121 // if Selenium Grid doesn't send response
122 connectionRetryTimeout: 90000,
123 //
124 // Default request retries count
125 connectionRetryCount: 3,
126 //
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
130 // available:
131 // WebdriverCSS: https://github.com/webdriverio/webdrivercss
132 // WebdriverRTC: https://github.com/webdriverio/webdriverrtc
133 // Browserevent: https://github.com/webdriverio/browserevent
134 // plugins: {
135 // webdrivercss: {
136 // screenshotRoot: 'my-shots',
137 // failedComparisonsRoot: 'diffs',
138 // misMatchTolerance: 0.05,
139 // screenWidth: [320,480,640,1024]
140 // },
141 // webdriverrtc: {},
142 // browserevent: {}
143 // },
144 //
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.
149 // services: [],//
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
153 //
154 // Make sure you have the wdio adapter package for the specific framework installed
155 // before running any tests.
156 framework: 'mocha',
157
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' ],
162 //
163 // Options to be passed to Mocha.
164 // See the full list at http://mochajs.org/
165 mochaOpts: {
166 ui: 'bdd',
167 timeout: 20000
168 },
169 //
170 // =====
171 // Hooks
172 // =====
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.
177 //
178 // Gets executed once before all workers get launched.
179 // onPrepare: function ( config, capabilities ) {
180 // }
181 //
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) {
185 // },
186 //
187 // Hook that gets executed before the suite starts
188 // beforeSuite: function (suite) {
189 // },
190 //
191 // Hook that gets executed _before_ a hook within the suite starts (e.g. runs before calling
192 // beforeEach in Mocha)
193 // beforeHook: function () {
194 // },
195 //
196 // Hook that gets executed _after_ a hook within the suite starts (e.g. runs after calling
197 // afterEach in Mocha)
198 //
199 // Function to be executed before a test (in Mocha/Jasmine) or a step (in Cucumber) starts.
200 // beforeTest: function (test) {
201 // },
202 //
203 // Runs before a WebdriverIO command gets executed.
204 // beforeCommand: function (commandName, args) {
205 // },
206 //
207 // Runs after a WebdriverIO command gets executed
208 // afterCommand: function (commandName, args, result, error) {
209 // },
210 //
211 // Function to be executed after a test (in Mocha/Jasmine) or a step (in Cucumber) starts.
212 // afterTest: function (test) {
213 // },
214 //
215 // Hook that gets executed after the suite has ended
216 // afterSuite: function (suite) {
217 // },
218 //
219 // Gets executed after all tests are done. You still have access to all global variables from
220 // the test.
221 // after: function (result, capabilities, specs) {
222 // },
223 //
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) {
227 // }
228 };