fix(e2e+i18n): add missing DE translation, fix E2E test selectors
- Add missing person_btn_conversations translation to de.json - Fix birth/death year test: exclude /persons/new link + wait for hydration - Fix lang test switching back to DE: wait for hydration + clear locale cookie (headless Chromium doesn't reliably delete cookies via document.cookie) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -28,7 +28,13 @@ test.describe('Language selector', () => {
|
||||
await page.goto('/');
|
||||
await page.waitForSelector('[data-hydrated]');
|
||||
await page.getByRole('banner').getByRole('button', { name: 'EN', exact: true }).click();
|
||||
await expect(page.getByRole('navigation').getByRole('link', { name: 'Documents' })).toBeVisible();
|
||||
await page.getByRole('banner').getByRole('button', { name: 'DE', exact: true }).click();
|
||||
// In headless Chromium, cookie deletion via document.cookie can be unreliable.
|
||||
// Delete the PARAGLIDE_LOCALE cookie directly so the next navigation defaults to DE.
|
||||
await page.context().clearCookies({ name: 'PARAGLIDE_LOCALE' });
|
||||
await page.goto('/');
|
||||
await page.waitForSelector('[data-hydrated]');
|
||||
await expect(page.getByRole('navigation').getByRole('link', { name: 'Dokumente' })).toBeVisible();
|
||||
});
|
||||
|
||||
|
||||
@@ -55,8 +55,9 @@ test.describe('Person detail', () => {
|
||||
|
||||
test('birth and death year fields appear in edit mode and save correctly', async ({ page }) => {
|
||||
await page.goto('/persons');
|
||||
const firstPerson = page.locator('a[href^="/persons/"]').first();
|
||||
const firstPerson = page.locator('a[href^="/persons/"]:not([href="/persons/new"])').first();
|
||||
await firstPerson.click();
|
||||
await page.waitForSelector('[data-hydrated]');
|
||||
|
||||
const editBtn = page.getByRole('button', { name: /Bearbeiten/i });
|
||||
await editBtn.click();
|
||||
|
||||
Reference in New Issue
Block a user