Skip to content

Commit bda5d0d

Browse files
authored
test: fix flaky localization tests with race conditions (#15777)
### What Fixed two flaky localization tests that were consistently timing out in CI. <img width="1257" height="575" alt="Screenshot 2026-02-26 at 3 36 09 PM" src="https://github.com/user-attachments/assets/50ab01d4-72b9-4022-a056-b0f6ae91b5f8" /> ### Why Tests were failing on slow networks (CI with CPU throttling) because elements weren't fully ready for interaction after navigation or dynamic rendering. Interactions were attempted before elements were hydrated, causing timeouts. ### How - Added `waitFor({ state: 'visible' })` before filling blocks field in duplicate test - Added `waitFor({ state: 'visible' })` after navigation in copy locale overwrite test - Removed unnecessary final `changeLocale` call that served no testing purpose
1 parent d5706ee commit bda5d0d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

test/localization/e2e.spec.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,8 @@ describe('Localization', () => {
338338
await page.locator('#field-title').fill(englishTitle)
339339
await page.locator('#field-nav__layout .blocks-field__drawer-toggler').click()
340340
await page.locator('button[title="Text"]').click()
341-
await page.fill('#field-nav__layout__0__text', 'test')
341+
await page.locator('#field-nav__layout__0__text').waitFor({ state: 'visible' })
342+
await page.locator('#field-nav__layout__0__text').fill('test')
342343
await expect(page.locator('#field-nav__layout__0__text')).toHaveValue('test')
343344
await saveDocAndAssert(page)
344345
const originalID = await page.locator('.id-label').innerText()
@@ -496,8 +497,8 @@ describe('Localization', () => {
496497
const overwriteCheckbox = page.locator('#field-overwriteExisting')
497498
await overwriteCheckbox.click()
498499
await runCopy({ page, toLocale: spanishLocale })
500+
await page.locator('#field-title').waitFor({ state: 'visible' })
499501
await expect(page.locator('#field-title')).toHaveValue(englishTitle)
500-
await changeLocale(page, defaultLocale)
501502
})
502503

503504
test('should not include current locale in toLocale options', async () => {

0 commit comments

Comments
 (0)