Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

fix(test): follow up to tests refactoring (#13085)

Pavel Feldmana454328c255f
diff --git a/tests/library/modernizr.spec.ts b/tests/library/modernizr.spec.ts
index 394ca484eb..ef47d88ad4 100644
--- a/tests/library/modernizr.spec.ts
+++ b/tests/library/modernizr.spec.ts
@@ -22,7 +22,7 @@ async function checkFeatures(name: string, context: any, server: any) {
const page = await context.newPage();
await page.goto(server.PREFIX + '/modernizr.html');
const actual = await page.evaluate('window.report');
- const expected = JSON.parse(fs.readFileSync(require.resolve(`./assets/modernizr/${name}.json`), 'utf-8'));
+ const expected = JSON.parse(fs.readFileSync(require.resolve(`../assets/modernizr/${name}.json`), 'utf-8'));
return { actual, expected };
} finally {
await context.close();
diff --git a/utils/build/build.js b/utils/build/build.js
index 4d957996e5..f8c01a59fe 100644
--- a/utils/build/build.js
+++ b/utils/build/build.js
@@ -95,7 +95,7 @@ async function runWatch() {
if (onChange.script)
child_process.spawnSync('node', [onChange.script], { stdio: 'inherit' });
else
- child_process.spawnSync(onChange.command, onChange.args || [], { stdio: 'inherit', cwd: onChange.cwd });
+ child_process.spawnSync(onChange.command, onChange.args || [], { stdio: 'inherit', cwd: onChange.cwd, shell: true });
}
// chokidar will report all files as added in a sync loop, throttle those.
const reschedule = () => {
@@ -166,7 +166,7 @@ async function runBuild() {
if (onChange.script)
runStep({ command: 'node', args: [filePath(onChange.script)], shell: false });
else
- runStep({ command: onChange.command, args: onChange.args, shell: false, cwd: onChange.cwd });
+ runStep({ command: onChange.command, args: onChange.args, shell: true, cwd: onChange.cwd });
}
}
@@ -265,7 +265,7 @@ onChanges.push({
],
command: 'npx',
args: ['vite', 'build'],
- cwd: 'packages/trace-viewer',
+ cwd: path.join(__dirname, '..', '..', 'packages', 'trace-viewer'),
});
onChanges.push({
@@ -279,7 +279,7 @@ onChanges.push({
],
command: 'npx',
args: ['vite', 'build'],
- cwd: 'packages/recorder',
+ cwd: path.join(__dirname, '..', '..', 'packages', 'recorder'),
});
// The recorder and trace viewer have an app_icon.png that needs to be copied.