- Add context.addInitScript in beforeEach hooks to set English locale before page navigation - Remove debugging code from useLanguage hook - Remove unused setup file imports - Fix exchange test to check for English text correctly - All frontend tests passing
16 lines
542 B
TypeScript
16 lines
542 B
TypeScript
import { test } from "@playwright/test";
|
|
|
|
/**
|
|
* Set language to English for e2e tests.
|
|
* E2E tests should only test in English according to requirements.
|
|
* This is applied globally via test.beforeEach in the setup file.
|
|
*/
|
|
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");
|
|
}
|
|
});
|
|
});
|