This repository has been archived by the owner on Jan 4, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(webdriverio): add WebdriverIO local configuration
- Loading branch information
Showing
5 changed files
with
169 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = { | ||
local: require('./wdio.local.conf'), | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
const path = require('path'); | ||
|
||
module.exports = { | ||
/* | ||
* Use the Static Server Service to start serve demos to run our tests against | ||
* https://webdriver.io/docs/static-server-service.html | ||
* https://github.com/webdriverio/webdriverio/tree/master/packages/wdio-static-server-service | ||
*/ | ||
services: ['static-server'], | ||
staticServerFolders: [{ mount: '/', path: './website' }], | ||
staticServerPort: 5000, | ||
/* | ||
* Set the static server, started above, as the base URL | ||
* Will be prepended to the `url` parameter of `browser.url()` calls | ||
* https://webdriver.io/docs/configurationfile.html | ||
* https://webdriver.io/docs/api/browser/url.html | ||
*/ | ||
baseUrl: 'http://localhost:5000', | ||
|
||
/* | ||
* Specify Test Files | ||
* Using absolute path to run test files from the package root | ||
* instead of the directory from which `wdio` was called | ||
* https://webdriver.io/docs/configurationfile.html | ||
*/ | ||
specs: [path.join(__dirname, 'specs/**/*.spec.ts')], | ||
|
||
/* | ||
* Level of logging verbosity | ||
* Can be: trace, debug, info, warn, error, silent | ||
* https://webdriver.io/docs/options.html#loglevel | ||
*/ | ||
logLevel: 'warn', | ||
/* | ||
* Default timeout for all waitForXXX commands | ||
* https://webdriver.io/docs/options.html#waitfortimeout | ||
*/ | ||
waitforTimeout: 10000, | ||
/* | ||
* Stop tests on first fail | ||
* https://webdriver.io/docs/options.html#bail | ||
*/ | ||
bail: 1, | ||
|
||
/* | ||
* Uses Jasmine as test framework | ||
* Since Jest is not supported by WebdriverIO yet we choose to use the Jasmine framework as it has a very close syntax | ||
* https://webdriver.io/docs/options.html#framework | ||
* https://github.com/webdriverio/webdriverio/tree/master/packages/wdio-jasmine-framework | ||
*/ | ||
framework: 'jasmine', | ||
/* | ||
* Specific Jasmine related options | ||
* https://webdriver.io/docs/options.html#mochaopts-jasminenodeopts | ||
* https://github.com/webdriverio/webdriverio/tree/master/packages/wdio-jasmine-framework#configuration | ||
*/ | ||
jasmineNodeOpts: { | ||
defaultTimeoutInterval: 60000, | ||
}, | ||
/* | ||
* List of reporters to use | ||
* https://webdriver.io/docs/options.html#reporters | ||
* https://github.com/webdriverio/webdriverio/tree/master/packages/wdio-spec-reporter | ||
*/ | ||
reporters: ['spec'], | ||
|
||
/* | ||
* Hooks | ||
* https://webdriver.io/docs/options.html#hooks | ||
*/ | ||
|
||
/* | ||
* `before` hook (executed before test execution begins) registering TypeScript to compile our `.ts` files | ||
* https://webdriver.io/docs/typescript.html | ||
*/ | ||
before() { | ||
require('ts-node').register({ | ||
files: true, | ||
transpileOnly: true, | ||
// Force `ts-node` to use the config file from the package root | ||
// instead of the directory from which `wdio` was called | ||
project: path.join(__dirname, './tsconfig.json'), | ||
}); | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
const baseConfig = require('./wdio.base.conf'); | ||
|
||
module.exports = { | ||
...baseConfig, | ||
/* | ||
* Start a Selenium Standalone Service to run our tests on our local machine | ||
* https://webdriver.io/docs/selenium-standalone-service.html | ||
* https://github.com/webdriverio/webdriverio/tree/master/packages/wdio-selenium-standalone-service | ||
*/ | ||
services: [...(baseConfig.services || []), 'selenium-standalone'], | ||
/* | ||
* Platforms where we want to run our tests | ||
* Since it will be run on the local machine and we don't know any of its capacity | ||
* then we stay very vague and only target the most common browser | ||
*/ | ||
capabilities: [ | ||
{ | ||
browserName: 'chrome', | ||
}, | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters