wdio.remote.conf.js 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252
  1. exports.config = {
  2. //
  3. // ==================
  4. // Specify Test Files
  5. // ==================
  6. // Define which test specs should run. The pattern is relative to the directory
  7. // from which `wdio` was called. Notice that, if you are calling `wdio` from an
  8. // NPM script (see https://docs.npmjs.com/cli/run-script) then the current working
  9. // directory is where your package.json resides, so `wdio` will be called from there.
  10. //
  11. specs: [
  12. 'test/endtoend/specs/**/*.js'
  13. ],
  14. // Patterns to exclude.
  15. exclude: [
  16. // 'path/to/excluded/files'
  17. ],
  18. //
  19. // ============
  20. // Capabilities
  21. // ============
  22. // Define your capabilities here. WebdriverIO can run multiple capabilities at the same
  23. // time. Depending on the number of capabilities, WebdriverIO launches several test
  24. // sessions. Within your capabilities you can overwrite the spec and exclude options in
  25. // order to group specific specs to a specific capability.
  26. //
  27. // First, you can define how many instances should be started at the same time. Let's
  28. // say you have 3 different capabilities (Chrome, Firefox, and Safari) and you have
  29. // set maxInstances to 1; wdio will spawn 3 processes. Therefore, if you have 10 spec
  30. // files and you set maxInstances to 10, all spec files will get tested at the same time
  31. // and 30 processes will get spawned. The property handles how many capabilities
  32. // from the same test should run tests.
  33. //
  34. maxInstances: 5,
  35. //
  36. // If you have trouble getting all important capabilities together, check out the
  37. // Sauce Labs platform configurator - a great tool to configure your capabilities:
  38. // https://docs.saucelabs.com/reference/platforms-configurator
  39. //
  40. capabilities: [
  41. { browserName: 'firefox', version: '38.0', platform: 'Linux', 'tunnel-identifier': process.env.TRAVIS_JOB_NUMBER, build: process.env.TRAVIS_BUILD_NUMBER },
  42. { browserName: 'internet explorer', version: '10.0', platform: 'Windows 7', 'tunnel-identifier': process.env.TRAVIS_JOB_NUMBER, build: process.env.TRAVIS_BUILD_NUMBER },
  43. { browserName: 'chrome', version: '50.0', platform: 'Windows 7', 'tunnel-identifier': process.env.TRAVIS_JOB_NUMBER, build: process.env.TRAVIS_BUILD_NUMBER },
  44. { browserName: 'MicrosoftEdge', version: '14.14393', platform: 'Windows 10', 'tunnel-identifier': process.env.TRAVIS_JOB_NUMBER, build: process.env.TRAVIS_BUILD_NUMBER },
  45. { browserName: 'safari', version: '11.0', platform: 'macOS 10.12', 'tunnel-identifier': process.env.TRAVIS_JOB_NUMBER, build: process.env.TRAVIS_BUILD_NUMBER }
  46. // { browserName: 'safari', version: '11.0', platformName: 'iOS', platformVersion: '10.0', deviceOrientation: 'portrait', deviceName: 'iPhone 6 Simulator', appiumVersion: '1.7.1' },
  47. // { browserName: 'chrome', platformName: 'Android', platformVersion: '6.0', deviceOrientation: 'portrait', deviceName: 'Android Emulator', appiumVersion: '1.7.1' }
  48. ],
  49. //
  50. // ===================
  51. // Test Configurations
  52. // ===================
  53. // Define all options that are relevant for the WebdriverIO instance here
  54. //
  55. // By default WebdriverIO commands are executed in a synchronous way using
  56. // the wdio-sync package. If you still want to run your tests in an async way
  57. // e.g. using promises you can set the sync option to false.
  58. sync: true,
  59. //
  60. // Level of logging verbosity: silent | verbose | command | data | result | error
  61. logLevel: 'silent',
  62. //
  63. // Enables colors for log output.
  64. coloredLogs: true,
  65. //
  66. // If you only want to run your tests until a specific amount of tests have failed use
  67. // bail (default is 0 - don't bail, run all tests).
  68. bail: 3,
  69. //
  70. // Saves a screenshot to a given path if a command fails.
  71. // screenshotPath: './endtoend/screenshots',
  72. //
  73. // Set a base URL in order to shorten url command calls. If your url parameter starts
  74. // with "/", then the base url gets prepended.
  75. baseUrl: 'http://localhost',
  76. //
  77. // Default timeout for all waitFor* commands.
  78. waitforTimeout: 10000,
  79. //
  80. // Default timeout in milliseconds for request
  81. // if Selenium Grid doesn't send response
  82. connectionRetryTimeout: 90000,
  83. //
  84. // Default request retries count
  85. connectionRetryCount: 3,
  86. //
  87. // Initialize the browser instance with a WebdriverIO plugin. The object should have the
  88. // plugin name as key and the desired plugin options as properties. Make sure you have
  89. // the plugin installed before running any tests. The following plugins are currently
  90. // available:
  91. // WebdriverCSS: https://github.com/webdriverio/webdrivercss
  92. // WebdriverRTC: https://github.com/webdriverio/webdriverrtc
  93. // Browserevent: https://github.com/webdriverio/browserevent
  94. // plugins: {
  95. // webdrivercss: {
  96. // screenshotRoot: 'my-shots',
  97. // failedComparisonsRoot: 'diffs',
  98. // misMatchTolerance: 0.05,
  99. // screenWidth: [320,480,640,1024]
  100. // },
  101. // webdriverrtc: {},
  102. // browserevent: {}
  103. // },
  104. //
  105. // Test runner services
  106. // Services take over a specific job you don't want to take care of. They enhance
  107. // your test setup with almost no effort. Unlike plugins, they don't add new
  108. // commands. Instead, they hook themselves up into the test process.
  109. services: ['static-server', 'sauce'],
  110. user: process.env.SAUCE_USERNAME,
  111. key: process.env.SAUCE_ACCESS_KEY,
  112. // sauceConnect: true,
  113. staticServerFolders: [
  114. { mount: '/', path: './test/endtoend/dist' }
  115. ],
  116. //
  117. // Framework you want to run your specs with.
  118. // The following are supported: Mocha, Jasmine, and Cucumber
  119. // see also: http://webdriver.io/guide/testrunner/frameworks.html
  120. //
  121. // Make sure you have the wdio adapter package for the specific framework installed
  122. // before running any tests.
  123. framework: 'mocha',
  124. //
  125. // Test reporter for stdout.
  126. // The only one supported by default is 'dot'
  127. // see also: http://webdriver.io/guide/testrunner/reporters.html
  128. // reporters: ['dot'],
  129. //
  130. // Options to be passed to Mocha.
  131. // See the full list at http://mochajs.org/
  132. mochaOpts: {
  133. ui: 'dot',
  134. timeout: 30000
  135. },
  136. //
  137. // =====
  138. // Hooks
  139. // =====
  140. // WebdriverIO provides several hooks you can use to interfere with the test process in order to enhance
  141. // it and to build services around it. You can either apply a single function or an array of
  142. // methods to it. If one of them returns with a promise, WebdriverIO will wait until that promise got
  143. // resolved to continue.
  144. /**
  145. * Gets executed once before all workers get launched.
  146. * @param {Object} config wdio configuration object
  147. * @param {Array.<Object>} capabilities list of capabilities details
  148. */
  149. // onPrepare: function (config, capabilities) {
  150. // },
  151. /**
  152. * Gets executed just before initialising the webdriver session and test framework. It allows you
  153. * to manipulate configurations depending on the capability or spec.
  154. * @param {Object} config wdio configuration object
  155. * @param {Array.<Object>} capabilities list of capabilities details
  156. * @param {Array.<String>} specs List of spec file paths that are to be run
  157. */
  158. // beforeSession: function (config, capabilities, specs) {
  159. // },
  160. /**
  161. * Gets executed before test execution begins. At this point you can access to all global
  162. * variables like `browser`. It is the perfect place to define custom commands.
  163. * @param {Array.<Object>} capabilities list of capabilities details
  164. * @param {Array.<String>} specs List of spec file paths that are to be run
  165. */
  166. before: function (capabilities, specs) {
  167. var chai = require('chai')
  168. global.expect = chai.expect
  169. global.capabilities = capabilities
  170. chai.Should()
  171. }
  172. //
  173. /**
  174. * Hook that gets executed before the suite starts
  175. * @param {Object} suite suite details
  176. */
  177. // beforeSuite: function (suite) {
  178. // },
  179. /**
  180. * Hook that gets executed _before_ a hook within the suite starts (e.g. runs before calling
  181. * beforeEach in Mocha)
  182. */
  183. // beforeHook: function () {
  184. // },
  185. /**
  186. * Hook that gets executed _after_ a hook within the suite starts (e.g. runs after calling
  187. * afterEach in Mocha)
  188. */
  189. // afterHook: function () {
  190. // },
  191. /**
  192. * Function to be executed before a test (in Mocha/Jasmine) or a step (in Cucumber) starts.
  193. * @param {Object} test test details
  194. */
  195. // beforeTest: function (test) {
  196. // },
  197. /**
  198. * Runs before a WebdriverIO command gets executed.
  199. * @param {String} commandName hook command name
  200. * @param {Array} args arguments that command would receive
  201. */
  202. // beforeCommand: function (commandName, args) {
  203. // },
  204. /**
  205. * Runs after a WebdriverIO command gets executed
  206. * @param {String} commandName hook command name
  207. * @param {Array} args arguments that command would receive
  208. * @param {Number} result 0 - command success, 1 - command error
  209. * @param {Object} error error object if any
  210. */
  211. // afterCommand: function (commandName, args, result, error) {
  212. // },
  213. /**
  214. * Function to be executed after a test (in Mocha/Jasmine) or a step (in Cucumber) starts.
  215. * @param {Object} test test details
  216. */
  217. // afterTest: function (test) {
  218. // },
  219. /**
  220. * Hook that gets executed after the suite has ended
  221. * @param {Object} suite suite details
  222. */
  223. // afterSuite: function (suite) {
  224. // },
  225. /**
  226. * Gets executed after all tests are done. You still have access to all global variables from
  227. * the test.
  228. * @param {Number} result 0 - test pass, 1 - test fail
  229. * @param {Array.<Object>} capabilities list of capabilities details
  230. * @param {Array.<String>} specs List of spec file paths that ran
  231. */
  232. // after: function (result, capabilities, specs) {
  233. // },
  234. /**
  235. * Gets executed right after terminating the webdriver session.
  236. * @param {Object} config wdio configuration object
  237. * @param {Array.<Object>} capabilities list of capabilities details
  238. * @param {Array.<String>} specs List of spec file paths that ran
  239. */
  240. // afterSession: function (config, capabilities, specs) {
  241. // },
  242. /**
  243. * Gets executed after all workers got shut down and the process is about to exit. It is not
  244. * possible to defer the end of the process using a promise.
  245. * @param {Object} exitCode 0 - success, 1 - fail
  246. */
  247. // onComplete: function(exitCode) {
  248. // }
  249. }