sillsdev / sillsdev/languageforge-lexbox

Add bare-minimum e2e smoke test for platform.bible-extension

Open
#2,488 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
9
Forks
8
Avg merge
2d 13h
Merged PRs (30d)
49

Description

platform.bible-extension has no automated tests today. interlinearizer-extension (a sibling extension) has a working Playwright + Electron e2e smoke tier at e2e-tests/. Port just enough of that infrastructure to run one adapted smoke test — not the full CDP/feature tier.

Scope

Only what tests/smoke/extension-launch.spec.ts needs: fixtures/app.fixture.tsfixtures/helpers.tsprocess-utils.ts, driven by playwright.config.ts + global-setup.ts + global-teardown.ts. Skip everything CDP/feature-tier only (cdp.fixture.ts, global-setup-cdp.ts, global-teardown-cdp.ts, playwright-cdp.config.ts, tests/features/**, tests/_example/**) — none of it is a dependency of the smoke spec.

Files to add under platform.bible-extension/e2e-tests/

  • playwright.config.ts — copy as-is from interlinearizer-extension (already scoped to a single smoke project)
  • global-setup.ts, global-teardown.ts — copy, fix path depth (see below)
  • process-utils.ts — copy verbatim; fully generic, no interlinearizer-specific content
  • fixtures/app.fixture.ts — copy near-verbatim; already generic, no "Interlinearizer" references
  • fixtures/helpers.ts — trimmed copy. Keep: settings backup/seed, launchElectronWithExtension/teardownElectronApp, the PAPI rpc.discover polling primitives, waitForServiceHostsRegistered, waitForDockTabTitlesResolved, withFatalStartupTripwire, waitForAppReady. Drop the Interlinearizer-only helpers not reachable from the smoke spec: waitForInterlinearizerReady, openInterlinearizerFromScriptureEditor, closeSelectProjectPickers, getInterlinearizerFrame, interlinearizerTabLocator, dismissLeftoverModals.
  • tests/smoke/extension-launch.spec.ts — same 4 tests (window created, React root rendered, dock loads, extension PAPI commands registered), describe title and last test renamed from "Interlinearizer" to "Lexicon"
  • .eslintrc.json, tsconfig.json — copy verbatim (generic lint/tsconfig config, not extension-specific)

README.md is documentation-only — optional for "the test runs," cheap to include.

Adaptations required (not a straight copy)

1. Path depth. interlinearizer-extension sits directly under paranext/, so its e2e helpers reach the sibling paranext-core checkout via ../../paranext-core (from e2e-tests/) or ../../../paranext-core (from e2e-tests/fixtures/). platform.bible-extension sits one level deeper (under paranext/languageforge-lexbox/), confirmed by its own package.json ("core:start": "npm --prefix ../../paranext-core start"). Every paranext-core-pointing path needs one extra ../:

  • global-setup.ts / global-teardown.ts: ../../paranext-core../../../paranext-core
  • fixtures/helpers.ts (coreDir, DEV_APPDATA_SETTINGS_PATH): ../../../paranext-core../../../../paranext-core
  • Paths pointing at the extension's own dist (extensionRoot, extensionDist) are unaffected — same repo, same depth. Webpack outputs to dist/src/main.js for both extensions, so the dist-exists check in global-setup.ts needs no change.

2. Extension-specific readiness check. The 4th smoke test calls waitForAppAndInterlinearizerReady, which polls for command:interlinearizer.openForWebView. Replace with a lexicon-specific equivalent (e.g. waitForAppAndLexiconReady polling command:lexicon.lexicons, or another command registered in src/main.ts: lexicon.addEntry, lexicon.selectLexicon, etc.).

package.json changes

  • devDependencies: add @playwright/test, ws, @types/ws (versions matching interlinearizer-extension's: ^1.49.0, ^8.18.0, ^8.5.14). escape-string-regexp is already present.
  • scripts: add "test:e2e:smoke": "playwright test --config e2e-tests/playwright.config.ts --project=smoke". No change needed to core:start/core:stop — the e2e harness calls paranext-core's scripts directly via execSync/spawn, not through this package's own script aliases.

Open item to verify during implementation

launchFwLite() in src/main.ts is synchronous — it calls spawn() and returns a URL string immediately without awaiting FW Lite startup, and command registration proceeds regardless. That suggests task build-fw-lite is not required just to pass this smoke test (dock load + PAPI command registration shouldn't depend on FW Lite actually responding), but that should be confirmed with a real run rather than assumed — a spawn() on a missing binary could still surface as a startup-path error that hasn't been traced fully.


Drafted by Claude Sonnet 5 (claude-sonnet-5) via Claude Code.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Compare platform.bible-extension with interlinearizer-extension/e2e-tests, then start with tests/smoke/extension-launch.spec.ts and the listed fixtures and setup files. Add the scoped smoke harness, adjust paranext-core paths, and use the Lexicon PAPI readiness command from src/main.ts. Run npm run test:e2e:smoke and confirm all four tests pass, verifying whether FW Lite is needed.

Written by the indexing model from the issue text.

Assessment

Tech stack
electron, playwright, typescript
Domain
desktop, testing-qa
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.