Problem
The test "Settings page >> Verify settings page" fails when verifying French translations after switching the language to Français. The test times out waiting for "Profil" (French for "Profile") to appear, but the page still displays "Profile" (English).
Test Location: e2e/settings.spec.ts:27:3
Error: TimeoutError: locator.waitFor: Timeout 10000ms exceeded.
The test fails at line 66 when trying to verify the French translation of "profileCard.title":
await uiHelper.verifyText(fr["user-settings"][langfr]["profileCard.title"]);
Expected: "Profil" (French)
Actual: "Profile" (English - shown in page snapshot)
Root Cause
Race condition: The test switches to French language (line 58) and immediately starts verifying French translations (line 66) without waiting for the page to re-render with the new language. The language change requires time for:
1. The UI to update
2. Components to re-render with new translations
3. Text content to be replaced
Proposed Fix
Add a wait condition after the language selection to ensure the page has updated with French translations before verifying:
await page.getByRole("option", { name: "Français" }).click(); await expect(page.getByTestId("select").locator("div")).toContainText( "Français", ); // Add wait for language change to take effect await expect(page.getByText("Profil", { exact: true })).toBeVisible({ timeout: 15000 }); const fr = getLocale("fr"); const langfr = "fr"; await uiHelper.verifyText(fr["user-settings"][langfr]["profileCard.title"]);
Alternatively, wait for any reliable French text that should appear after the language change, or add a page.waitForLoadState('networkidle') after the language selection.
Additional Context
- CI Job: pull-ci-redhat-developer-rhdh-main-e2e-ocp-helm/1981599123337383936
- Failure Point: ui-helper.ts:398 in verifyTextInLocator() method
- Page Snapshot: Shows "Profile" (English) instead of "Profil" (French)
Assisted-by: Cursor