wdio.local.conf.js 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. const base = require('./wdio.base.conf')
  2. const args = require('minimist')(process.argv.slice(2))
  3. // Use "npm run test:endtoend:local -- -b chrome" to test in chrome
  4. // "npm run test:endtoend:local -- -b ie" to test in internet explorer
  5. // "npm run test:endtoend:local -- -b firefox -b chrome" to test in FF and chrome
  6. const capabilities = []
  7. if (args.b) {
  8. if (!Array.isArray(args.b)) args.b = [args.b]
  9. args.b.forEach((browserName) => {
  10. // no clue how to write a single argument with internal spaces on windows, so support an alias with no spaces
  11. if (browserName === 'ie') {
  12. browserName = 'internet explorer'
  13. }
  14. capabilities.push({ browserName })
  15. })
  16. }
  17. // default to testing in firefox
  18. if (capabilities.length === 0) {
  19. capabilities.push({ browserName: 'firefox' })
  20. }
  21. const testingInternetExplorer = capabilities.find((capability) => capability.browserName === 'internet explorer') !== null
  22. exports.config = {
  23. ...base.config,
  24. capabilities,
  25. // If you only want to run your tests until a specific amount of tests have failed use
  26. // bail (default is 0 - don't bail, run all tests).
  27. bail: 0,
  28. // For internet explorer, the IEDriverServer only supports 1 instance at a time.
  29. maxInstances: testingInternetExplorer ? 1 : 5,
  30. // Set a base URL in order to shorten url command calls. If your url parameter starts
  31. // with "/", then the base url gets prepended.
  32. baseUrl: 'http://localhost',
  33. // Options to be passed to Mocha.
  34. // See the full list at http://mochajs.org/
  35. mochaOpts: {
  36. ui: 'bdd',
  37. reporter: 'dot',
  38. timeout: 120000,
  39. },
  40. }