Skip to content

Expand e2e testing#151

Open
alex-rawlings-yyc wants to merge 24 commits into
mainfrom
expand-e2e-testing
Open

Expand e2e testing#151
alex-rawlings-yyc wants to merge 24 commits into
mainfrom
expand-e2e-testing

Conversation

@alex-rawlings-yyc

@alex-rawlings-yyc alex-rawlings-yyc commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

This change is Reviewable

Summary by CodeRabbit

  • New Features
    • Draft gloss entries persist after closing and reopening the Interlinearizer.
    • Project switching/creation now treats in-progress typing as unsaved work for discard prompting when applicable.
  • Bug Fixes
    • Improved Interlinearizer “Project” modal flows, including reliable cancel behavior and discard-confirm gating during in-progress edits.
  • Documentation
    • Updated E2E test suite guidance and clarified smoke vs feature tier structure and authoring protocol.
  • Tests
    • Added/expanded E2E coverage for draft persistence, gloss round-trip, and Project menu modal dialogs, with more reliable startup/readiness handling.

@alex-rawlings-yyc alex-rawlings-yyc self-assigned this Jul 6, 2026
@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@alex-rawlings-yyc, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 52 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 2907fdc3-eca2-4a08-91e4-99842c432331

📥 Commits

Reviewing files that changed from the base of the PR and between ff77a3a and fd77dfd.

📒 Files selected for processing (2)
  • e2e-tests/fixtures/helpers.ts
  • e2e-tests/global-setup-cdp.ts
📝 Walkthrough

Walkthrough

The PR adds self-managed CDP E2E execution, shared-instance recovery helpers, feature tests, tier-specific CI artifacts, and documentation. It also changes project modal discard guards to include pending edits through a renamed hasUnsavedWork prop.

Changes

Unsaved-work modal guarding

Layer / File(s) Summary
Pending-edit discard guard
src/components/InterlinearizerLoader.tsx, src/components/modals/ProjectModals.tsx, src/__tests__/components/*, user-questions.md
Project switching and creation now use hasUnsavedWork, including in-progress edits, with corresponding loader wiring, tests, and decision documentation.

E2E test infrastructure and feature coverage

Layer / File(s) Summary
CDP runner lifecycle and test output
e2e-tests/global-setup*.ts, e2e-tests/global-teardown*.ts, e2e-tests/process-utils.ts, e2e-tests/playwright*.config.ts, .github/workflows/test.yml, package.json, .gitignore
CDP runs can launch and terminate isolated Electron instances, clean process trees cross-platform, separate smoke/CDP artifacts, and execute on Linux and Windows CI jobs.
Shared Interlinearizer and draft-state helpers
e2e-tests/fixtures/helpers.ts
Readiness checks, layout-tolerant opening, modal cleanup, Scripture navigation, project activation and rescue, draft wiping, and tab closing are added for shared CDP instances and smoke launches.
Feature specs and readiness migration
e2e-tests/tests/features/*, e2e-tests/tests/_example/*, e2e-tests/tests/smoke/*
Adds gloss round-trip, draft persistence, and project-modal cancellation coverage, while migrating existing tests to consolidated readiness synchronization.
E2E usage documentation and spell-check support
e2e-tests/README.md, e2e-tests/fixtures/cdp.fixture.ts, cspell.json
Documents smoke/CDP execution, shared-instance mutation rules, local reproduction, CDP prerequisites, and newly recognized terminology.

Estimated code review effort: 4 (Complex) | ~60 minutes

Possibly related PRs

Suggested labels: 🟨Medium

Suggested reviewers: imnasnainaec

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title is related to the changes, but it is too vague to convey the main e2e testing expansion. Use a more specific title like “Add CDP e2e suite and shared test helpers” so the primary change is clear.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch expand-e2e-testing

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@alex-rawlings-yyc alex-rawlings-yyc linked an issue Jul 7, 2026 that may be closed by this pull request
coderabbitai[bot]

This comment was marked as outdated.

@alex-rawlings-yyc alex-rawlings-yyc left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alex-rawlings-yyc resolved 4 discussions.
Reviewable status: 0 of 56 files reviewed, all discussions resolved (waiting on alex-rawlings-yyc).

@alex-rawlings-yyc alex-rawlings-yyc marked this pull request as ready for review July 7, 2026 21:31
coderabbitai[bot]

This comment was marked as outdated.

@alex-rawlings-yyc

This comment was marked as outdated.

@coderabbitai

This comment was marked as outdated.

coderabbitai[bot]

This comment was marked as outdated.

@imnasnainaec

Copy link
Copy Markdown
Contributor

When I pull this branch and run npm run test:e2e, it only runs the smoke tests and not the new tests (same as npm run test:e2e:smoke).

When I run npm run test:e2e:cdp, all 5 new tests fail.

@alex-rawlings-yyc

Copy link
Copy Markdown
Contributor Author

Whoops. I'll have another look. I assume we want npm run test:e2e to run both :smoke and :cdp

coderabbitai[bot]

This comment was marked as outdated.

@alex-rawlings-yyc alex-rawlings-yyc left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alex-rawlings-yyc resolved 1 discussion.
Reviewable status: 0 of 70 files reviewed, all discussions resolved (waiting on alex-rawlings-yyc).

@sillsdev sillsdev deleted a comment from coderabbitai Bot Jul 10, 2026
@sillsdev sillsdev deleted a comment from coderabbitai Bot Jul 10, 2026
@sillsdev sillsdev deleted a comment from coderabbitai Bot Jul 10, 2026

@imnasnainaec imnasnainaec left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@imnasnainaec partially reviewed 53 files and made 1 comment.
Reviewable status: 50 of 73 files reviewed, 1 unresolved discussion (waiting on alex-rawlings-yyc).


.github/workflows/test.yml line 114 at r9 (raw file):

            if ($LASTEXITCODE -eq 0) { exit 0 }
            Write-Host "npm ci failed (exit $LASTEXITCODE); verifying cache before retry"
            npm cache verify

Claude suggestion from a Devin nit:

worth a one-liner after npm cache verify (e.g., if ($LASTEXITCODE -ne 0) { Write-Host "npm cache verify failed (exit $LASTEXITCODE)" } for clearer diagnostics)

alex-rawlings-yyc and others added 8 commits July 13, 2026 13:02
Exclude the "Open Interlinearizer" project-picker tab from the four
broad
.dock-tab matches (ensureInterlinearizerOpenOnWeb, isDraftDirty,
closeInterlinearizerTab, rescueDraftToNewProject) so they target the
real
WebView tab. Also anchor the active-project check in
ensureE2eProjectActive
to match E2E_PROJECT_NAME exactly instead of via unanchored includes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The e2e feature helpers couldn't reliably pass on the shared CDP
instance:
- ensureE2eProjectActive matched the project entry by the button's
  accessible
  name, but the modal renders name/badge/language spans with no
  separating
  whitespace, so the anchored regex never matched — every mutating test
  fell
  into the create branch and re-created an existing project. Match the
  name
  element by exact text instead (also fixes the "E2E Test Project 2"
  overmatch).
- The create branch hung on a dirty draft (Create defers behind the
  discard
  confirm); dismiss it when dirty.
- closeInterlinearizerTab used hover()+click(), which times out when the
  tab
  overflows off-viewport on CI; use dispatchEvent('click') like
  paranext-core.
- ensureInterlinearizerOpenOnWeb settles the dock before its isVisible()
  branch.
- Extract interlinearizerTabLocator/escapeRegExp helpers.

The tab's unsaved marker used dirty||pendingEdits but ProjectModals
gated its
discard confirmation on committed dirty only, so opening/creating a
project
mid-typing silently discarded the uncommitted gloss. Rename the prop to
hasUnsavedWork and feed it the combined state so the guard and marker
agree.

Document the broadened discard-on-swap behavior in user-questions.md.
globalSetup now launches and tears down its own Platform.Bible instance
(reusing a warm start:cdp when the CDP port is in use), and .or() tab
waits get .first() so a docked Interlinearizer + WEB tab no longer trip
Playwright strict mode.
Kill the CDP app's whole process tree (taskkill /T /F on Windows, POSIX
process-group SIGKILL elsewhere) so no orphans hold port 8876, and
stream
the launched app's output to a log instead of discarding it, so a
startup
crash shows its cause rather than an opaque WebSocket-port timeout.
* Suggested changes on expand-e2e-testing

* Fix Linux CI
Self-heal any modal a prior failed test left mounted
(dismissLeftoverModals
in ensureInterlinearizerOpenOnWeb) so its full-viewport overlay can't
intercept
every downstream test's clicks, force-click through the wipe modal's
settle
race, and enable CI retries now that each attempt starts clean. Also
race the
CDP-port wait against the early-exit sentinel so a late startup crash
fails fast
instead of timing out.
  Disable electron-debug's auto-opened DevTools (ELECTRON_IS_DEV=0) and
  pin
  the window to 1280x960 so dock panels and modals are not clipped; gate
  readiness on dock-tab titles resolving (no "Unknown" tabs) in both
  waitForAppReady and CDP global setup so a broken instance fails fast
  with
  its startup log; upload the dotfile startup log (include-hidden-files)
  and
  force X11 on Linux so headless xvfb runs work on Wayland machines.
The e2e job's full core install intermittently fails on windows-latest
with EEXIST in the shared npm cache; retry up to 3x with cache verify
between attempts. Linux keeps its single-shot install.
The "Open Interlinearizer" picker is a floating dock tab that opening a
project never disposes; on the shared CDP instance it accumulated until
a
bare .select-project-dialog read tripped strict mode and reddened every
downstream test. Scope the locator to .first(), close the picker after
selecting a project, and self-heal leftover pickers in the open
precondition.

Also log npm cache verify failures during the Windows ci retry.
navigateToScriptureRef drove the platform toolbar's book-chapter
control,
which is permanently disabled in simple interface mode with no
main-editor
project (the CDP instance's state) — so trigger.click() retried for the
full
test timeout, hanging every navigating feature test for 6 minutes. Wait
a
bounded time for the control to enable and skip navigation if it never
does;
the view already shows its default reference and callers assert on
tokens.
The dock-readiness gate failed if any tab anywhere said "Unknown", so a
single leftover panel poisoned every later feature test on the shared
instance. Make it accept a lenient mode (dock mounted + >=1 tab
resolved)
for CDP feature tests while smoke/cold-start stay strict, report a
closed-page teardown distinctly, and capture the smoke app's stdout.
The readiness wait used the 120s cold-start budget on every attempt, so
a
dead shared instance cost ~6 min per test (120s x 3 retries) before
reporting. Add CDP_FEATURE_READY_TIMEOUT (30s), passed by the feature
specs, and split waitForAppAndInterlinearizerReady's timeout across both
the app-ready and extension-registration waits so the short budget caps
the whole check — a dead instance now fails in ~90s. Smoke tests keep
the
generous cold-start default.
coderabbitai[bot]

This comment was marked as outdated.

Wait on the settings/menu-data/theme data-provider objects in
rpc.discover before the dock-tab-title check, so a slow cold start
resolves against its real cause instead of an opaque "Unknown"-tab
timeout. Also fast-fail the cold-start wait on the fatal theme-settle
page error, turning a 120s dead wait into a fast, labeled failure that
retries onto a fresh launch.

@alex-rawlings-yyc alex-rawlings-yyc left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alex-rawlings-yyc resolved 1 discussion.
Reviewable status: 50 of 73 files reviewed, all discussions resolved (waiting on alex-rawlings-yyc and imnasnainaec).

Cut paranext-core internals (serialization shape, magic numbers,
symbol names) that go stale silently; keep the observable contract
and flag the few comments that still track an upstream detail.
coderabbitai[bot]

This comment was marked as outdated.

Also fix the smoke launcher's dual stdout/stderr pipe: use { end: false
}
so neither stream ends the shared log early, and flush it before
dumping.
Replaces the manual process-group kill in launchElectronWithExtension
and
teardownElectronApp with the shared killProcessTree utility, matching
both
global-teardown files and closing the Windows tree-kill gap.
The dock-tab and service-host waits floored their leftover budget to 1ms
(Math.max(1, ...)), which clears waitForDockTabTitlesResolved's
timeout<=0
guard but expires during the CDP round-trip before the first predicate
evaluation — failing "tabs still Unknown" on a healthy app. Floor to
1000ms
to match waitForAppReady, and correct its stale "mirrors Math.max(1,
...)"
comment.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a few basic e2e tests

2 participants