Reference files in Playwright more reliably (#32935)

Without assuming the cwd
This commit is contained in:
Michael Telatynski
2026-03-26 11:30:54 +00:00
committed by GitHub
parent 5a074e637a
commit cd429874db
14 changed files with 93 additions and 57 deletions
@@ -6,6 +6,7 @@ Please see LICENSE files in the repository root for full details.
*/
import { test, expect } from "../../element-web-test";
import { getSampleFilePath } from "../../sample-files";
test.describe("Module loading", () => {
test.use({
@@ -20,7 +21,7 @@ test.describe("Module loading", () => {
},
page: async ({ page }, use) => {
await page.route("/modules/example-module.js", async (route) => {
await route.fulfill({ path: "playwright/sample-files/example-module.js" });
await route.fulfill({ path: getSampleFilePath("example-module.js") });
});
await use(page);
},