Quest 2 testing suite - #24
Open
JoeArmani wants to merge 4 commits into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a comprehensive “Quest 2” automated test suite to the repository (Vitest + Playwright), including an offline/deterministic harness and a locked production-questionnaire corpus so future refactors (event handling, accessibility, DOM changes) can be made with strong regression protection.
Changes:
- Introduces Vitest unit/integration/corpus tests plus shared jsdom setup and coverage thresholds.
- Adds a Playwright end-to-end harness with an offline network policy, cross-browser project matrix, and visual snapshot coverage.
- Pins and verifies a locked production questionnaire corpus (fetch/verify scripts, schema, personas) and wires CI to run the required lanes.
Reviewed changes
Copilot reviewed 107 out of 120 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| vitest.config.js | Adds Vitest config for jsdom/unit/integration/corpus + coverage. |
| vite.config.js | Adds Vite config used by the Playwright harness web server. |
| tests/unit/tree.spec.js | Unit coverage for Tree behavior. |
| tests/unit/testOnlyScope.spec.js | Unit tests for the “test-only scope” gate script. |
| tests/unit/knownFunctions.spec.js | Unit tests for knownFunctions utilities. |
| tests/unit/knownDefectRegistry.spec.js | Ensures known-defect registry entries are complete and unexpired. |
| tests/unit/evaluateConditions.spec.js | Unit coverage for condition evaluation + fallback behavior. |
| tests/unit/buildGrid.spec.js | Unit coverage for grid parsing/rendering. |
| tests/setup/jsdom.js | Shared jsdom test setup (offline boundary, bootstrap stubs, globals). |
| tests/scripts/runKnownDefects.mjs | Runner that executes known-defect Vitest + Playwright lanes. |
| tests/README.md | Test-suite documentation and command reference. |
| tests/quality/scripts/checkTestOnlyScope.mjs | Script that enforces “test-only PR” allowlist changes. |
| tests/knownDefects/vitest.config.js | Separate Vitest config for known-defects lane. |
| tests/knownDefects/registry.js | Registry of accepted/waived known defects + expiry policy. |
| tests/integration/validation.spec.js | jsdom integration tests for validateInput behavior. |
| tests/integration/restoreResponses.spec.js | jsdom integration tests for persisted response restoration. |
| tests/integration/responsePiping.spec.js | jsdom integration tests for piped variables and summaries. |
| tests/integration/offlineBoundary.spec.js | Verifies jsdom offline network boundary behavior. |
| tests/integration/mainRender.spec.js | jsdom integration tests for transform.render and core lifecycle. |
| tests/integration/hostFailures.spec.js | jsdom integration tests for retrieve/store failure handling. |
| tests/integration/eventHandlers.spec.js | jsdom integration tests for delegated event handling. |
| tests/integration/accessibilityBehavior.spec.js | jsdom integration tests for keyboard/screen-reader behaviors. |
| tests/helpers/questRuntime.js | Helper utilities for rendering Quest in jsdom for integration tests. |
| tests/harness/participant.html | Connect-shaped Playwright participant harness page. |
| tests/harness/mathjsLocal.js | Import-map adapter mapping production MathJS CDN specifier to local dep. |
| tests/harness/connectHost.css | Minimal Connect-like host styling for stable harness rendering. |
| tests/fixtures/canonical/validation.txt | Canonical fixture for validation behavior. |
| tests/fixtures/canonical/runtimeControls.txt | Canonical fixture covering common control types. |
| tests/fixtures/canonical/nestedTextPresence.txt | Canonical fixture for nested-text + presence conditions. |
| tests/fixtures/canonical/navigationState.txt | Canonical fixture for navigation + state restoration. |
| tests/fixtures/canonical/navigationBoundaries.txt | Canonical fixture for navigation boundary behaviors. |
| tests/fixtures/canonical/nativeSelect.txt | Canonical fixture for native select behavior. |
| tests/fixtures/canonical/module4AddressPathsSpanish.txt | Production-shaped Spanish address-path extract fixture. |
| tests/fixtures/canonical/module4AddressPaths.txt | Production-shaped English address-path extract fixture. |
| tests/fixtures/canonical/loopBoundaries.txt | Canonical fixture for loop iteration boundaries. |
| tests/fixtures/canonical/imageAlt.txt | Canonical fixture for image markup behavior. |
| tests/fixtures/canonical/gridResponsive.txt | Canonical fixture for responsive grid layout behavior. |
| tests/fixtures/canonical/gridCheckboxFocus.txt | Canonical fixture for checkbox-grid focus behavior. |
| tests/fixtures/canonical/asyncQuestion.txt | Canonical fixture for async question rendering. |
| tests/fixtures/canonical/allConstructs.txt | Canonical fixture exercising broad Markdown/render constructs. |
| tests/e2e/windowsEnvironment.spec.js | Playwright coverage for Windows-specific participant behaviors. |
| tests/e2e/visual.spec.js | Visual regression snapshots for participant/authoring UI. |
| tests/e2e/temporalInputPartitions.spec.js | Cross-browser Playwright coverage for date/month/time/number validation. |
| tests/e2e/support/test.js | Playwright test fixture + offline request policy + diagnostics utilities. |
| tests/e2e/support/harness.js | Playwright harness helpers (open, navigation, snapshots, health checks). |
| tests/e2e/support/gridDeepCoverageFixtures.js | Production-shaped deep grid coverage helpers/fixtures. |
| tests/e2e/support/corpus.js | Helpers for reading pinned corpus artifacts and building tree state. |
| tests/e2e/support/axe.js | Axe helper utilities and known-defect matching. |
| tests/e2e/storageConcurrency.spec.js | Playwright contract for overlapping host-store settlement ordering. |
| tests/e2e/responsive.spec.js | Responsive layout and geometry assertions (incl. visual). |
| tests/e2e/productionCompoundForms.spec.js | Locked production compound-form behavior checks. |
| tests/e2e/popoverAccessibility.spec.js | Keyboard popover accessibility checks across desktop engines. |
| tests/e2e/participantControls.spec.js | Canonical participant control walkthrough and keyboard action checks. |
| tests/e2e/participantAsync.spec.js | Async host-question injection success/error coverage. |
| tests/e2e/module2PregnancyPaths.spec.js | Locked corpus participant paths for Module 2 pregnancy flows. |
| tests/e2e/gridDeepCoverageKnownDefects.spec.js | Known-defect coverage for grid lifecycle issues. |
| tests/e2e/gridDeepCoverage.spec.js | Deep grid behavior coverage (desktop + phone). |
| tests/e2e/corpusParticipant.spec.js | Locked corpus startup smoke coverage (participant mode). |
| tests/e2e/corpusFullRender.spec.js | Locked corpus full-list (renderer) conversion contract. |
| tests/e2e/corpusConditionProbeRegressions.spec.js | Targeted corpus regression probes. |
| tests/e2e/corpusAsyncHooks.spec.js | Locked corpus async hook execution under deterministic outcomes. |
| tests/e2e/constructs.spec.js | Full construct renderer assertions in Playwright. |
| tests/e2e/connectExperiencePaths.spec.js | Locked corpus derived-condition participant paths. |
| tests/e2e/backDeletion.spec.js | Back-navigation deletion + pruning contract coverage. |
| tests/e2e/authoringKnownDefects.spec.js | Known defect characterization for authoring behavior. |
| tests/e2e/assets/fonts/OFL-Libre-Baskerville.txt | Bundled font license for visual baseline assets. |
| tests/e2e/assets/fonts.lock.json | Lock metadata for bundled font assets. |
| tests/e2e/accessibilityLifecycleKnownDefects.spec.js | Known-defect lifecycle checks around accessibility regressions. |
| tests/corpus/scripts/verifyCorpus.mjs | CLI tool to verify pinned corpus artifacts. |
| tests/corpus/scripts/lib/artifacts.mjs | Shared artifact path helpers/constants. |
| tests/corpus/scripts/fetchCorpus.mjs | CLI tool to fetch immutable corpus archive and verify hashes. |
| tests/corpus/schemas/lock.schema.json | JSON schema for corpus lock format. |
| tests/corpus/README.md | Documentation for the locked corpus and catalog workflow. |
| tests/corpus/hostPersonas.json | Deterministic host personas + async hook fixtures. |
| tests/corpus/corpusIntegrity.spec.js | Vitest coverage for corpus lock + verification behavior. |
| tests/config/moduleResolution.js | Vite/Vitest resolver mapping production MathJS CDN import to local dep. |
| playwright.config.js | Playwright projects matrix + webServer boot configuration. |
| package.json | Adds test scripts and pins devDependencies for the suite. |
| docs/accessibilityManualTest.md | Manual accessibility test matrix/protocol (VoiceOver/JAWS/keyboard). |
| .nvmrc | Pins Node runtime version for test suite. |
| .node-version | Pins Node runtime version for test suite. |
| .gitignore | Ignores cache, coverage, Playwright reports, and generated outputs. |
| .github/workflows/quest-pr.yml | CI workflow running Vitest+coverage, corpus verification, and Playwright lanes. |
| README.md | Links to the test-suite documentation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Quest 2 automated testing suite
We needed a detailed automated testing suite here so we can safely work on the codebase when needed without encountering regressions or having to manually run all our surveys through testing.
This suite includes unit and Playwright tests, pinned to locked versions of our surveys, to address the cases and edge cases we've encountered over 2+ years of work on this system, with extra emphasis on survey grids, forid handling, piped variables, conditional evaluation, functions, statefulness, and tree handling.
This precedes upcoming event-handling and accessibility work that will very likely require DOM management and some structural changes, and should make it safer for developers to work in the repo without risking cascading bugs when making changes.
It also includes already-identified issues to resolve when working through episphere/connect#1587 & episphere/connect#1079