refactor(webdriverio)!: don't include sync API support by default (#6695)

This commit is contained in:
Haoqun Jiang
2021-09-30 16:41:02 +08:00
committed by GitHub
parent 17081b7dc1
commit 611b892928
5 changed files with 15 additions and 8 deletions
@@ -7,8 +7,8 @@ class App {
/**
* methods
*/
open (path = '/') {
browser.url(path)
async open (path = '/') {
await browser.url(path)
}
}
@@ -1,8 +1,8 @@
<%- hasTS ? 'import App from \'../pageobjects/app.page\'' : 'const App = require(\'../pageobjects/app.page\')' %>
describe('Vue.js app', () => {
it('should open and render', () => {
App.open()
expect(App.heading).toHaveText('Welcome to Your Vue.js <%- hasTS ? '+ TypeScript ' : '' %>App')
it('should open and render', async () => {
await App.open()
await expect(App.heading).toHaveText('Welcome to Your Vue.js <%- hasTS ? '+ TypeScript ' : '' %>App')
})
})
@@ -49,8 +49,8 @@ module.exports = (api, options) => {
info(`Start WebdriverIO: $ wdio ${runArgs.join(' ')}`)
const runner = execa(wdioBinPath, runArgs, { stdio: 'inherit' })
if (server) {
runner.on('exit', () => server.close())
runner.on('error', () => server.close())
runner.on('exit', () => server.stop())
runner.on('error', () => server.stop())
}
if (process.env.VUE_CLI_TEST) {
@@ -17,4 +17,12 @@ module.exports = (api) => {
}
})
}
if (api.fromVersion('<= 5.0.0-beta.4')) {
api.extendPackage({
devDependencies: {
'@wdio/sync': '^7.0.7'
}
})
}
}
@@ -32,7 +32,6 @@
"@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"
},