wdio.main.conf.ts 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. export const config = {
  2. //
  3. // ====================
  4. // Runner Configuration
  5. // ====================
  6. //
  7. //
  8. // ==================
  9. // Specify Test Files
  10. // ==================
  11. // Define which test specs should run. The pattern is relative to the directory
  12. // from which `wdio` was called.
  13. //
  14. // The specs are defined as an array of spec files (optionally using wildcards
  15. // that will be expanded). The test for each spec file will be run in a separate
  16. // worker process. In order to have a group of spec files run in the same worker
  17. // process simply enclose them in an array within the specs array.
  18. //
  19. // If you are calling `wdio` from an NPM script (see https://docs.npmjs.com/cli/run-script),
  20. // then the current working directory is where your `package.json` resides, so `wdio`
  21. // will be called from there.
  22. //
  23. specs: [
  24. './src/suites-all/*.e2e-spec.ts',
  25. './src/suites-local/*.e2e-spec.ts'
  26. ],
  27. // Patterns to exclude.
  28. exclude: [
  29. // 'path/to/excluded/files'
  30. ],
  31. //
  32. // ===================
  33. // Test Configurations
  34. // ===================
  35. // Define all options that are relevant for the WebdriverIO instance here
  36. //
  37. // Level of logging verbosity: trace | debug | info | warn | error | silent
  38. logLevel: 'info',
  39. //
  40. // Set specific log levels per logger
  41. // loggers:
  42. // - webdriver, webdriverio
  43. // - @wdio/browserstack-service, @wdio/devtools-service, @wdio/sauce-service
  44. // - @wdio/mocha-framework, @wdio/jasmine-framework
  45. // - @wdio/local-runner
  46. // - @wdio/sumologic-reporter
  47. // - @wdio/cli, @wdio/config, @wdio/utils
  48. // Level of logging verbosity: trace | debug | info | warn | error | silent
  49. // logLevels: {
  50. // webdriver: 'info',
  51. // '@wdio/appium-service': 'info'
  52. // },
  53. //
  54. // If you only want to run your tests until a specific amount of tests have failed use
  55. // bail (default is 0 - don't bail, run all tests).
  56. bail: 0,
  57. //
  58. // Set a base URL in order to shorten url command calls. If your `url` parameter starts
  59. // with `/`, the base url gets prepended, not including the path portion of your baseUrl.
  60. // If your `url` parameter starts without a scheme or `/` (like `some/path`), the base url
  61. // gets prepended directly.
  62. baseUrl: 'http://127.0.0.1:9001',
  63. //
  64. // Default timeout for all waitFor* commands.
  65. waitforTimeout: 5000,
  66. //
  67. // Default timeout in milliseconds for request
  68. // if browser driver or grid doesn't send response
  69. connectionRetryTimeout: 120000,
  70. //
  71. // Default request retries count
  72. connectionRetryCount: 3,
  73. // Framework you want to run your specs with.
  74. // The following are supported: Mocha, Jasmine, and Cucumber
  75. // see also: https://webdriver.io/docs/frameworks
  76. //
  77. // Make sure you have the wdio adapter package for the specific framework installed
  78. // before running any tests.
  79. framework: 'mocha',
  80. //
  81. // The number of times to retry the entire specfile when it fails as a whole
  82. specFileRetries: 2,
  83. //
  84. // Delay in seconds between the spec file retry attempts
  85. // specFileRetriesDelay: 0,
  86. //
  87. // Whether or not retried specfiles should be retried immediately or deferred to the end of the queue
  88. // specFileRetriesDeferred: false,
  89. //
  90. // Test reporter for stdout.
  91. // The only one supported by default is 'dot'
  92. // see also: https://webdriver.io/docs/dot-reporter
  93. reporters: [ 'spec' ],
  94. //
  95. // Options to be passed to Mocha.
  96. // See the full list at http://mochajs.org/
  97. mochaOpts: {
  98. ui: 'bdd',
  99. timeout: 60000,
  100. bail: true
  101. },
  102. autoCompileOpts: {
  103. autoCompile: true,
  104. tsNodeOpts: {
  105. project: require('path').join(__dirname, './tsconfig.json')
  106. }
  107. },
  108. before: function () {
  109. require('./src/commands/upload')
  110. }
  111. } as Partial<WebdriverIO.Config>