Skip to content

Ideas to make Playground E2E tests less flaky + easier to maintain #154

@screenfluent

Description

@screenfluent

Hey @umaranis during the Lexical upgrade chain I noticed a few things that made CI/test maintenance slower than it needed to be. Everything is green now, but I wanted to share a couple of ideas that could make future upgrades and CI a bit smoother.

  1. Flaky WebKit collab timing
    I saw a collab test on WebKit fail randomly and pass on re-run. It looks like fixed short sleeps (for example 50ms between operations) are sometimes not enough. Using explicit waits for “sync/state reached” instead of sleeps (or increasing sleep only where unavoidable) would likely reduce reruns.

2.Platform/browser-specific hacks
There is quite a bit of conditional logic in tests like IS_WINDOWS, browserName === 'firefox', and “ArrowUp x2/x3 depending on platform”. These work but are brittle and easy to break. In one flaky case I stabilized the test by switching to deterministic navigation helpers (for example moving caret deterministically before asserting), which felt more reliable than platform branching.

  1. dir="auto" behavior is not documented
    The dir="auto" change (Lexical 0.35.0+) took me a while to figure out. The rule I observed is: Lexical adds dir="auto" only to DOM elements that are direct children of RootNode (nested elements shouldn’t get it). A short note/comment in the test utils would probably save time for whoever does the next upgrade.

  2. Size-limit churn
    After upgrades the bundle grows slightly and I end up bumping size limits by a few hundred bytes. Not a huge deal, but it’s repetitive. Maybe a small margin (or more centralized size-limit config) would reduce the churn while still keeping the check meaningful.

If any of this sounds useful, I’m happy to open small, incremental PRs (I’m not trying to rewrite the whole E2E suite, just stability and maintenance improvements).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions