[TAN-8455] Flaky E2E Fix: language_switch.cy.ts — await builder boot - #14512
Merged
Conversation
…diness, persist the delete
Cypress test isolation clears cookies and resets the page between tests, so
the beforeEach locale reset ran without an auth cookie and silently did
nothing, then reloaded about:blank. Restore the login cookie first and let
each test visit the page it needs instead of inheriting one from before().
Gate the builder on #e2e-project-page-content-builder-page, which only
renders once the tenant locales and the layout query have resolved, rather
than racing the toolbox selector against the admin bundle boot. This is the
condition behind the nightly failure ("Expected to find element:
#e2e-draggable-text, but never found it").
The delete test never saved, so its live-page not.exist assertions passed
against a page that had not painted yet — verified by adding a positive
control, which turns them red. Save the layout and assert the project title
is visible before checking for absence.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Stef-Rousset
force-pushed
the
TAN-8455-language-switch
branch
from
August 11, 2026 06:54
9df592b to
f1070af
Compare
Collaborator
|
Stef-Rousset
requested review from
amanda-anderson
and
a lite review from Copilot
August 11, 2026 07:55
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR has been generated by Claude using the fix-flaky-e2e skill.
Changelog
Technical
language_switch.cy.tsE2E spec. It now waits for the projectpage builder to finish booting before interacting with the toolbox, restores the
login cookie before the per-test locale reset, and saves the layout after
deleting a widget so the live-page assertions verify something real.
Generated by Claude
Spec:
front/cypress/e2e/project_description_builder/language_switch.cy.tsRoot cause
Three separate defects, all confirmed by running rather than by inspection:
Test isolation vs. the
beforeEachlocale reset.testIsolationdefaults totrue(Cypress 15), so cookies are cleared and the page is reset toabout:blankbefore every test after the first.
apiUpdateCurrentUserearly-returns when thecl2_jwtcookie is missing, soswitchLocale('en')inbeforeEachsilently didnothing,
cy.reload()reloaded a blank page, andsetAdminLoginCookie()ranafter the reload. The tolerant
/Language \d text\./matcher in the delete testwas a workaround for this broken reset.
The nightly flake. The first test relied on the page
before()visitedsurviving into the test, reloaded it, then immediately queried
#e2e-draggable-text.ProjectPageBuilderPagerendersnulluntil the tenantlocales and layout query resolve, so a slow boot under CI contention blew the
15s default timeout — matching the nightly failure exactly
(
Expected to find element: #e2e-draggable-text, but never found it).The delete test asserted nothing. It deleted a widget but never saved (the
builder has no autosave), then asserted
should('not.exist')on the live pageimmediately after a reload — passing by racing a blank page. Adding only a
positive control, with no other change, turns it red:
Expected not to find content: 'Language 1 text.' but continuously found it.Why this addresses the cause rather than suppressing it
#e2e-project-page-content-builder-page, the container thatrenders only once the app's own readiness condition is met — not a sleep. The
explicit 60s budget covers admin-bundle boot on a contended node.
actually happens instead of failing silently.
switchLocaleasserts the URL locale prefix afterwards. The user's locale winsover the URL's in
utils/locale.ts, and the app rewrites the prefix — so theassertion proves the switch was applied.
not.existis preceded by asserting the projecttitle is visible, so absence means absence.
cy.wait(<ms>)was added, no assertions loosened, no retries relied on.The two pre-existing
cy.wait(1000)calls guarding the craftjs debounce areuntouched.
Stability evidence
retries=0(Cypress's 2 retries disabled, so these arefirst-attempt passes). The first attempt at this fix scored 2/10 and was discarded —
a
cy.intercept+cy.waitgate tripped oncy.wait's 5s request timeout.spec ×3 — 3/3 nodes green, 6/6 test records
success.next few weeks is the real verdict.