Skip to content

Commit a81e984

Browse files
test: update tests to run against WebdriverIO v7
- update @wdio/cli to v7.3.1 - regenerate wdio.conf.js and install other deps using `wdio config` - remove unnecessary @babel/register package - add 'jest' to test tsconfig types as expect was no longer in the global namespace
1 parent e68e4ab commit a81e984

File tree

4 files changed

+22
-19
lines changed

4 files changed

+22
-19
lines changed

package.json

+6-8
Original file line numberDiff line numberDiff line change
@@ -31,23 +31,21 @@
3131
"webdriverio": "*"
3232
},
3333
"devDependencies": {
34-
"@babel/register": "^7.13.8",
3534
"@typescript-eslint/eslint-plugin": "^4.14.0",
3635
"@typescript-eslint/parser": "^4.14.0",
37-
"@wdio/cli": "^6.11.3",
38-
"@wdio/local-runner": "^6.12.0",
39-
"@wdio/mocha-framework": "^6.11.0",
40-
"@wdio/spec-reporter": "^6.11.0",
41-
"@wdio/sync": "^6.11.0",
36+
"@wdio/cli": "^7.3.1",
37+
"@wdio/local-runner": "^7.3.1",
38+
"@wdio/mocha-framework": "^7.3.1",
39+
"@wdio/spec-reporter": "^7.3.1",
40+
"@wdio/sync": "^7.3.1",
4241
"chromedriver": "^89.0.0",
4342
"eslint": "^7.6.0",
4443
"kcd-scripts": "^5.0.0",
4544
"npm-run-all": "^4.1.5",
4645
"semantic-release": "^17.0.2",
4746
"ts-node": "^9.1.1",
4847
"typescript": "^4.1.3",
49-
"wdio-chromedriver-service": "^6.0.4",
50-
"webdriverio": "^6.12.0"
48+
"wdio-chromedriver-service": "^7.0.0"
5149
},
5250
"repository": {
5351
"type": "git",

test/async/tsconfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"extends": "../../tsconfig.json",
33
"compilerOptions": {
4-
"types": ["node", "webdriverio", "@wdio/mocha-framework"],
4+
"types": ["node", "jest", "webdriverio/async", "@wdio/mocha-framework"],
55
"baseUrl": "."
66
},
77
"exclude": [],

test/sync/tsconfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"extends": "../../tsconfig.json",
33
"compilerOptions": {
4-
"types": ["node", "@wdio/sync", "@wdio/mocha-framework"]
4+
"types": ["node", "jest", "webdriverio/sync", "@wdio/mocha-framework"]
55
},
66
"exclude": [],
77
"include": ["**/*.ts"]

wdio.conf.js

+14-9
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,16 @@ exports.config = {
1414
// Specify Test Files
1515
// ==================
1616
// Define which test specs should run. The pattern is relative to the directory
17-
// from which `wdio` was called. Notice that, if you are calling `wdio` from an
18-
// NPM script (see https://docs.npmjs.com/cli/run-script) then the current working
19-
// directory is where your package.json resides, so `wdio` will be called from there.
17+
// from which `wdio` was called.
18+
//
19+
// The specs are defined as an array of spec files (optionally using wildcards
20+
// that will be expanded). The test for each spec file will be run in a separate
21+
// worker process. In order to have a group of spec files run in the same worker
22+
// process simply enclose them in an array within the specs array.
23+
//
24+
// If you are calling `wdio` from an NPM script (see https://docs.npmjs.com/cli/run-script),
25+
// then the current working directory is where your `package.json` resides, so `wdio`
26+
// will be called from there.
2027
//
2128
specs: ['./test/**/*.e2e.{js,ts}'],
2229
// Patterns to exclude.
@@ -114,7 +121,7 @@ exports.config = {
114121

115122
// Framework you want to run your specs with.
116123
// The following are supported: Mocha, Jasmine, and Cucumber
117-
// see also: https://webdriver.io/docs/frameworks.html
124+
// see also: https://webdriver.io/docs/frameworks
118125
//
119126
// Make sure you have the wdio adapter package for the specific framework installed
120127
// before running any tests.
@@ -131,7 +138,7 @@ exports.config = {
131138
//
132139
// Test reporter for stdout.
133140
// The only one supported by default is 'dot'
134-
// see also: https://webdriver.io/docs/dot-reporter.html
141+
// see also: https://webdriver.io/docs/dot-reporter
135142
reporters: ['spec'],
136143

137144
//
@@ -140,7 +147,6 @@ exports.config = {
140147
mochaOpts: {
141148
ui: 'bdd',
142149
timeout: 60000,
143-
compiler: ['ts-node/register']
144150
},
145151
//
146152
// =====
@@ -184,9 +190,8 @@ exports.config = {
184190
* @param {Array.<String>} specs List of spec file paths that are to be run
185191
* @param {Object} browser instance of created browser/device session
186192
*/
187-
before: function () {
188-
require("@babel/register")({ extensions: ['.js', '.jsx', '.ts', '.tsx'] });
189-
},
193+
// before: function (capabilities, specs) {
194+
// },
190195
/**
191196
* Runs before a WebdriverIO command gets executed.
192197
* @param {String} commandName hook command name

0 commit comments

Comments
 (0)