|
| 1 | +jest.setTimeout(process.env.APPVEYOR ? 120000 : 60000) |
| 2 | + |
| 3 | +const create = require('@vue/cli-test-utils/createTestProject') |
| 4 | + |
| 5 | +const CONFIG_FILES = ['wdio.shared.conf.json', 'wdio.local.conf.json'] |
| 6 | + |
| 7 | +test('should work', async () => { |
| 8 | + const project = await create('e2e-webdriverio', { |
| 9 | + plugins: { |
| 10 | + '@vue/cli-plugin-babel': {}, |
| 11 | + '@vue/cli-plugin-e2e-webdriverio': {}, |
| 12 | + '@vue/cli-plugin-eslint': { |
| 13 | + config: 'airbnb', |
| 14 | + lintOn: 'save' |
| 15 | + } |
| 16 | + } |
| 17 | + }) |
| 18 | + |
| 19 | + await Promise.all(CONFIG_FILES.map(async (configFile) => { |
| 20 | + const config = JSON.parse(await project.read(configFile)) |
| 21 | + await project.write(configFile, JSON.stringify(config)) |
| 22 | + })) |
| 23 | + |
| 24 | + if (!process.env.CI) { |
| 25 | + await project.run(`vue-cli-service test:e2e`) |
| 26 | + } else if (!process.env.APPVEYOR) { |
| 27 | + await project.run(`vue-cli-service test:e2e --headless`) |
| 28 | + } |
| 29 | +}) |
| 30 | + |
| 31 | +test('should work with TS', async () => { |
| 32 | + const project = await create('e2e-webdriverio-ts', { |
| 33 | + plugins: { |
| 34 | + '@vue/cli-plugin-typescript': { |
| 35 | + 'classComponent': true, |
| 36 | + 'tsLint': true, |
| 37 | + 'lintOn': ['save'] |
| 38 | + }, |
| 39 | + '@vue/cli-plugin-e2e-webdriverio': {} |
| 40 | + } |
| 41 | + }) |
| 42 | + |
| 43 | + await Promise.all(CONFIG_FILES.map(async (configFile) => { |
| 44 | + const config = JSON.parse(await project.read(configFile)) |
| 45 | + await project.write(configFile, JSON.stringify(config)) |
| 46 | + })) |
| 47 | + |
| 48 | + if (!process.env.CI) { |
| 49 | + await project.run(`vue-cli-service test:e2e`) |
| 50 | + } else if (!process.env.APPVEYOR) { |
| 51 | + await project.run(`vue-cli-service test:e2e --headless`) |
| 52 | + } |
| 53 | +}) |
0 commit comments