-
-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathrun-e2e.mjs
More file actions
30 lines (25 loc) · 879 Bytes
/
run-e2e.mjs
File metadata and controls
30 lines (25 loc) · 879 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/env node
import { execSync } from 'node:child_process';
import { existsSync, globSync } from 'node:fs';
import { basename, dirname, join } from 'node:path';
const args = process.argv.slice(2).join(' ');
// Find all spec files that have a blueprint.json in the same directory
const projects = globSync('**/*.spec.ts', { ignore: ['node_modules/**'] })
.filter((spec) => existsSync(join(dirname(spec), 'blueprint.json')))
.map((spec) => basename(spec, '.spec.ts'));
console.log(
`Found ${projects.length} test suites:\n${projects.map((p) => ` - ${p}`).join('\n')}\n`,
);
let failed = false;
for (const project of projects) {
console.log(`\n▶ Running: ${project}`);
try {
execSync(
`RUN_PROJECT="${project}" npx playwright test --project="${project}" ${args}`,
{ stdio: 'inherit' },
);
} catch {
failed = true;
}
}
process.exit(failed ? 1 : 0);