Skip to content

Commit 903a16a

Browse files
committed
ci: update smoke tests
1 parent c29c82a commit 903a16a

5 files changed

Lines changed: 46 additions & 45 deletions

File tree

.github/workflows/ci-lint.yml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Lint
1+
name: Static code analysis
22

33
on:
44
workflow_call:
@@ -28,13 +28,6 @@ jobs:
2828
with:
2929
node-version: ${{ matrix.node-version }}
3030

31-
- name: ⬇️ Download Build Archive
32-
uses: ./.github/workflows/actions/download-archive
33-
with:
34-
name: vscode-webdriverio
35-
path: .
36-
filename: vscode-webdriverio-build.zip
37-
3831
- name: 📃 Run the lint
3932
run: pnpm run style:fix
4033
shell: bash

.github/workflows/ci.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,33 +21,32 @@ jobs:
2121
os: 'ubuntu-latest'
2222

2323
lint:
24-
name: Lint
25-
needs: [build]
24+
name: Static code analysis
2625
uses: ./.github/workflows/ci-lint.yml
2726

2827
typecheck:
2928
name: Typecheck
30-
needs: [build]
29+
needs: [lint, build]
3130
uses: ./.github/workflows/ci-typecheck.yml
3231

3332
unit:
3433
name: Unit
35-
needs: [build]
34+
needs: [lint, build]
3635
uses: ./.github/workflows/ci-unit.yml
3736

3837
e2e:
3938
name: E2E
40-
needs: [build]
39+
needs: [lint, build]
4140
uses: ./.github/workflows/ci-e2e.yml
4241

4342
compatibility:
4443
name: Compatibility
45-
needs: [build]
44+
needs: [lint, build]
4645
uses: ./.github/workflows/ci-e2e.yml
4746
with:
4847
compatibility-mode: 'yes'
4948

5049
smoke:
5150
name: Smoke
52-
needs: [build, e2e]
51+
needs: [lint, build, e2e, compatibility]
5352
uses: ./.github/workflows/ci-smoke.yml

e2e/tests/updateConfig.spec.ts

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -85,20 +85,23 @@ describe('VS Code Extension Testing (Update config)', function () {
8585

8686
// Emulate the changing configuration
8787
shell.cp('-f', afterConfig, beforeConfig)
88-
await new Promise((resolve) => setTimeout(resolve, 1000))
8988
await browser.waitUntil(
9089
async () => {
91-
if (!(await items[0].isExpanded())) {
92-
await items[0].expand()
93-
}
94-
95-
const children = await items[0].getChildren()
96-
const target = children[0]
97-
if (!target) {
90+
try {
91+
if (!(await items[0].isExpanded())) {
92+
await items[0].expand()
93+
}
94+
95+
const children = await items[0].getChildren()
96+
const target = children[0]
97+
if (!target) {
98+
return false
99+
}
100+
const regex = new RegExp('after.test.ts')
101+
return regex.test(await target.getLabel())
102+
} catch {
98103
return false
99104
}
100-
const regex = new RegExp('after.test.ts')
101-
return regex.test(await target.getLabel())
102105
},
103106
{ timeoutMsg: 'The label "after.test.ts" is not found.' }
104107
)

e2e/tests/updateErrorSpec.spec.ts

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -89,20 +89,23 @@ describe('VS Code Extension Testing (Update config)', function () {
8989

9090
// Emulate the changing configuration
9191
shell.cp('-f', spec.after, spec.before)
92-
await new Promise((resolve) => setTimeout(resolve, 1000))
9392
await browser.waitUntil(
9493
async () => {
95-
if (!(await items[0].isExpanded())) {
96-
await items[0].expand()
97-
}
98-
99-
const children = await items[0].getChildren()
100-
const target = children[0]
101-
if (!target) {
94+
try {
95+
if (!(await items[0].isExpanded())) {
96+
await items[0].expand()
97+
}
98+
99+
const children = await items[0].getChildren()
100+
const target = children[0]
101+
if (!target) {
102+
return false
103+
}
104+
const regex = new RegExp('before.spec.ts')
105+
return regex.test(await target.getLabel())
106+
} catch {
102107
return false
103108
}
104-
const regex = new RegExp('before.spec.ts')
105-
return regex.test(await target.getLabel())
106109
},
107110
{
108111
timeoutMsg: 'The label "before.spec.ts" is not found.',

e2e/tests/updateSpec.spec.ts

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -89,20 +89,23 @@ describe('VS Code Extension Testing (Update config)', function () {
8989

9090
// Emulate the changing configuration
9191
shell.cp('-f', spec.after, spec.before)
92-
await new Promise((resolve) => setTimeout(resolve, 1000))
9392
await browser.waitUntil(
9493
async () => {
95-
if (!(await items[0].isExpanded())) {
96-
await items[0].expand()
97-
}
98-
99-
const children = await items[0].getChildren()
100-
const target = children[0]
101-
if (!target) {
94+
try {
95+
if (!(await items[0].isExpanded())) {
96+
await items[0].expand()
97+
}
98+
99+
const children = await items[0].getChildren()
100+
const target = children[0]
101+
if (!target) {
102+
return false
103+
}
104+
const regex = new RegExp('before.spec.ts')
105+
return regex.test(await target.getLabel())
106+
} catch {
102107
return false
103108
}
104-
const regex = new RegExp('before.spec.ts')
105-
return regex.test(await target.getLabel())
106109
},
107110
{
108111
timeoutMsg: 'The label "before.spec.ts" is not found.',

0 commit comments

Comments
 (0)