Skip to content

Commit

Permalink
feat!: update WebDriverIO to v7 (#6295)
Browse files Browse the repository at this point in the history
  • Loading branch information
haoqunjiang committed Feb 21, 2021
1 parent 64c04cb commit 3f367b2
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 22 deletions.
4 changes: 4 additions & 0 deletions docs/migrations/migrate-from-v4.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,10 @@ Please consider switching to ESLint. You can check out [`tslint-to-eslint-config
* Cypress is required as a peer dependency.
* 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.

### E2E-WebDriverIO Plugin

* 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.

### Unit-Jest Plugin

* 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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ test('should add types to existing tsconfig.json', async () => {
const tsconfig = await read('tsconfig.json')
expect(tsconfig).toMatch(/\r?\n$/)
expect(JSON.parse(tsconfig).compilerOptions.types)
.toEqual(['some-type', 'mocha', '@wdio/mocha-framework', '@wdio/sync'])
.toEqual(['some-type', 'mocha', '@wdio/mocha-framework', 'webdriverio/sync'])
})
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const applyTS = module.exports.applyTS = (api, invoking) => {
const parsed = JSON.parse(tsconfig)
const types = parsed.compilerOptions.types
if (types) {
for (const t of ['mocha', '@wdio/mocha-framework', '@wdio/sync']) {
for (const t of ['mocha', '@wdio/mocha-framework', 'webdriverio/sync']) {
if (!types.includes(t)) {
types.push(t)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,6 @@ exports.config = {
// see also: https://webdriver.io/docs/dot-reporter.html
reporters: ['spec'],
//
// Options to be passed to Mocha.
// See the full list at http://mochajs.org/
mochaOpts: {
ui: 'bdd',
timeout: 30000,
<%_ if (hasTS) { _%>
require: 'ts-node/register',
<%_ } _%>
},
//
// =====
// Hooks
// =====
Expand Down
11 changes: 11 additions & 0 deletions packages/@vue/cli-plugin-e2e-webdriverio/migrator/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module.exports = (api) => {
if (api.fromVersion('<= 5.0.0-alpha.4')) {
api.render(files => {
if (!files['tsconfig.json']) {
return
}

files['tsconfig.json'] = files['tsconfig.json'].replace('"@wdio/sync"', '"webdriverio/sync"')
})
}
}
18 changes: 9 additions & 9 deletions packages/@vue/cli-plugin-e2e-webdriverio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,19 @@
"dependencies": {
"@types/mocha": "^8.2.1",
"@vue/cli-shared-utils": "^5.0.0-alpha.4",
"@wdio/cli": "^6.10.5",
"@wdio/local-runner": "^6.10.5",
"@wdio/mocha-framework": "^6.10.4",
"@wdio/sauce-service": "^6.10.4",
"@wdio/spec-reporter": "^6.8.1",
"@wdio/sync": "^6.10.4",
"eslint-plugin-wdio": "^6.0.12",
"webdriverio": "^6.10.5"
"@wdio/cli": "^7.0.7",
"@wdio/local-runner": "^7.0.7",
"@wdio/mocha-framework": "^7.0.7",
"@wdio/sauce-service": "^7.0.7",
"@wdio/spec-reporter": "^7.0.7",
"@wdio/sync": "^7.0.7",
"eslint-plugin-wdio": "^7.0.0",
"webdriverio": "^7.0.7"
},
"peerDependencies": {
"chromedriver": "*",
"geckodriver": "*",
"wdio-chromedriver-service": "^6.0.4",
"wdio-chromedriver-service": "^7.0.0",
"wdio-geckodriver-service": "^1.1.2"
},
"peerDependenciesMeta": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<%_ if (hasWebDriverIO) { _%>
<% if (!hasMocha && !hasJest) { %>"mocha",<% } %>
"@wdio/mocha-framework",
"@wdio/sync"<% if (hasMocha || hasJest) { %>,<% } %>
"webdriverio/sync"<% if (hasMocha || hasJest) { %>,<% } %>
<%_ } _%>
<%_ if (hasMocha) { _%>
"mocha",
Expand Down

0 comments on commit 3f367b2

Please sign in to comment.