Skip to content

Commit 80477ac

Browse files
committed
refactor(e2e): dynamically generate spec order
Signed-off-by: Zacharias Fragkiadakis <[email protected]>
1 parent 5814eff commit 80477ac

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

test/e2e/wdio.conf.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import path from 'node:path'
1+
import path, { sep } from 'node:path'
22
import { $ } from 'zx'
33
import type { Options } from '@wdio/types'
44
import {
@@ -29,6 +29,13 @@ switch (process.platform) {
2929
break
3030
}
3131

32+
const orderedSpecPaths = ['./specs/onboarding.spec.ts', './specs/settings.spec.ts'].map(
33+
(specPath) => specPath.replace('/', sep),
34+
)
35+
const specsToExcludeFromGlob = orderedSpecPaths.map((specPath) =>
36+
specPath.split(sep).at(-1)?.replace('.spec.ts', ''),
37+
)
38+
3239
// TODO: Bump webdriverio to v9 once wdio-vscode-service supports it
3340
// Relevant PR: https://github.com/webdriverio-community/wdio-vscode-service/pull/130
3441
// Relevant Issue: https://github.com/webdriverio-community/wdio-vscode-service/issues/140
@@ -40,10 +47,7 @@ export const config: Options.Testrunner = {
4047
transpileOnly: true,
4148
},
4249
},
43-
specs: [
44-
['./specs/onboarding.spec.ts', './specs/settings.spec.ts'],
45-
'./specs/**/!(onboarding|settings).spec.ts',
46-
],
50+
specs: [orderedSpecPaths, `./specs/**/!(${specsToExcludeFromGlob.join('|')}).spec.ts`],
4751
maxInstances: 10,
4852
capabilities: [
4953
{

0 commit comments

Comments
 (0)