2025-12-25 22:35:27 +01:00
|
|
|
import { test } from "@playwright/test";
|
2025-12-25 22:06:39 +01:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Set language to English for e2e tests.
|
|
|
|
|
* E2E tests should only test in English according to requirements.
|
2025-12-25 22:35:27 +01:00
|
|
|
* This is applied globally via test.beforeEach in the setup file.
|
2025-12-25 22:06:39 +01:00
|
|
|
*/
|
2025-12-25 22:35:27 +01:00
|
|
|
test.beforeEach(async ({ context }) => {
|
|
|
|
|
// Add init script to set English language before any page loads
|
|
|
|
|
// This must be called before any page.goto() calls
|
|
|
|
|
await context.addInitScript(() => {
|
|
|
|
|
if (typeof window !== "undefined") {
|
|
|
|
|
window.localStorage.setItem("arbret-locale", "en");
|
|
|
|
|
}
|
2025-12-25 22:06:39 +01:00
|
|
|
});
|
2025-12-25 22:35:27 +01:00
|
|
|
});
|