Fix e2e tests: Set English language before navigation
- 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
This commit is contained in:
parent
246553c402
commit
d2fc7d8850
6 changed files with 52 additions and 46 deletions
|
|
@ -70,7 +70,13 @@ async function clearProfileData(page: Page) {
|
|||
}
|
||||
|
||||
test.describe("Profile - Regular User Access", () => {
|
||||
test.beforeEach(async ({ page }) => {
|
||||
test.beforeEach(async ({ context, page }) => {
|
||||
// Set English language before any navigation
|
||||
await context.addInitScript(() => {
|
||||
if (typeof window !== "undefined") {
|
||||
window.localStorage.setItem("arbret-locale", "en");
|
||||
}
|
||||
});
|
||||
await clearAuth(page);
|
||||
await loginUser(page, REGULAR_USER.email, REGULAR_USER.password);
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue