Skip to content

Commit 3f367b2

Browse files
authored
feat!: update WebDriverIO to v7 (#6295)
1 parent 64c04cb commit 3f367b2

File tree

7 files changed

+27
-22
lines changed

7 files changed

+27
-22
lines changed

docs/migrations/migrate-from-v4.md

+4
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,10 @@ Please consider switching to ESLint. You can check out [`tslint-to-eslint-config
111111
* Cypress is required as a peer dependency.
112112
* Cypress is updated from v3 to v6. See [Cypress Migration Guide](https://docs.cypress.io/guides/references/migration-guide.html) for detailed instructions of the migration process.
113113

114+
### E2E-WebDriverIO Plugin
115+
116+
* WebDriverIO is updated from v6 to v7. Not many user-facing breaking changes. See the [blog post on release](https://webdriver.io/blog/2021/02/09/webdriverio-v7-released) for more details.
117+
114118
### Unit-Jest Plugin
115119

116120
* The underlying `jest`-related packages are upgraded from v24 to v26. For most users the transition would be seamless. See their corresponding changelogs for more detail:

packages/@vue/cli-plugin-e2e-webdriverio/__tests__/wdioGenerator.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@ test('should add types to existing tsconfig.json', async () => {
1919
const tsconfig = await read('tsconfig.json')
2020
expect(tsconfig).toMatch(/\r?\n$/)
2121
expect(JSON.parse(tsconfig).compilerOptions.types)
22-
.toEqual(['some-type', 'mocha', '@wdio/mocha-framework', '@wdio/sync'])
22+
.toEqual(['some-type', 'mocha', '@wdio/mocha-framework', 'webdriverio/sync'])
2323
})

packages/@vue/cli-plugin-e2e-webdriverio/generator/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const applyTS = module.exports.applyTS = (api, invoking) => {
1515
const parsed = JSON.parse(tsconfig)
1616
const types = parsed.compilerOptions.types
1717
if (types) {
18-
for (const t of ['mocha', '@wdio/mocha-framework', '@wdio/sync']) {
18+
for (const t of ['mocha', '@wdio/mocha-framework', 'webdriverio/sync']) {
1919
if (!types.includes(t)) {
2020
types.push(t)
2121
}

packages/@vue/cli-plugin-e2e-webdriverio/generator/template/wdio.shared.conf.js

-10
Original file line numberDiff line numberDiff line change
@@ -59,16 +59,6 @@ exports.config = {
5959
// see also: https://webdriver.io/docs/dot-reporter.html
6060
reporters: ['spec'],
6161
//
62-
// Options to be passed to Mocha.
63-
// See the full list at http://mochajs.org/
64-
mochaOpts: {
65-
ui: 'bdd',
66-
timeout: 30000,
67-
<%_ if (hasTS) { _%>
68-
require: 'ts-node/register',
69-
<%_ } _%>
70-
},
71-
//
7262
// =====
7363
// Hooks
7464
// =====
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
module.exports = (api) => {
2+
if (api.fromVersion('<= 5.0.0-alpha.4')) {
3+
api.render(files => {
4+
if (!files['tsconfig.json']) {
5+
return
6+
}
7+
8+
files['tsconfig.json'] = files['tsconfig.json'].replace('"@wdio/sync"', '"webdriverio/sync"')
9+
})
10+
}
11+
}

packages/@vue/cli-plugin-e2e-webdriverio/package.json

+9-9
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,19 @@
2727
"dependencies": {
2828
"@types/mocha": "^8.2.1",
2929
"@vue/cli-shared-utils": "^5.0.0-alpha.4",
30-
"@wdio/cli": "^6.10.5",
31-
"@wdio/local-runner": "^6.10.5",
32-
"@wdio/mocha-framework": "^6.10.4",
33-
"@wdio/sauce-service": "^6.10.4",
34-
"@wdio/spec-reporter": "^6.8.1",
35-
"@wdio/sync": "^6.10.4",
36-
"eslint-plugin-wdio": "^6.0.12",
37-
"webdriverio": "^6.10.5"
30+
"@wdio/cli": "^7.0.7",
31+
"@wdio/local-runner": "^7.0.7",
32+
"@wdio/mocha-framework": "^7.0.7",
33+
"@wdio/sauce-service": "^7.0.7",
34+
"@wdio/spec-reporter": "^7.0.7",
35+
"@wdio/sync": "^7.0.7",
36+
"eslint-plugin-wdio": "^7.0.0",
37+
"webdriverio": "^7.0.7"
3838
},
3939
"peerDependencies": {
4040
"chromedriver": "*",
4141
"geckodriver": "*",
42-
"wdio-chromedriver-service": "^6.0.4",
42+
"wdio-chromedriver-service": "^7.0.0",
4343
"wdio-geckodriver-service": "^1.1.2"
4444
},
4545
"peerDependenciesMeta": {

packages/@vue/cli-plugin-typescript/generator/template/tsconfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
<%_ if (hasWebDriverIO) { _%>
2626
<% if (!hasMocha && !hasJest) { %>"mocha",<% } %>
2727
"@wdio/mocha-framework",
28-
"@wdio/sync"<% if (hasMocha || hasJest) { %>,<% } %>
28+
"webdriverio/sync"<% if (hasMocha || hasJest) { %>,<% } %>
2929
<%_ } _%>
3030
<%_ if (hasMocha) { _%>
3131
"mocha",

0 commit comments

Comments
 (0)