Conversation
Exercise layer creation, scoring, naming, and JSON export against the production build using existing synthetic STIX fixtures. Run the single Chromium test after the existing quality gate builds Navigator, and retain failure artifacts for seven days.
Temporarily expect score 2 after entering score 1 to prove that the draft PR fails and uploads its diagnostic trace. Restore the assertion after validation.
Restore the exported-score assertion to 1. The separate CI run for the preceding commit retains the deliberately incorrect expectation for failure-path validation.
Use the lockfile-installed CLI for Chromium installation so CI cannot fall back to fetching a package through npx.
Move Playwright tests into e2e alongside the existing Protractor files, with separate filename matching and a smoke tag for focused runs. Use test:e2e across local and CI execution, keep artifacts under tmp, and consolidate contributor and Docker instructions in the E2E README. Leave Protractor removal for a separate change.
Use a shared browser installation path and grant the built-in node user ownership of the test artifact directory. This resolves the SonarCloud finding for the optional Docker setup. Validated the production build and smoke test on Linux arm64 with the documented default Docker run command.
Keep the README focused on the current test setup and rely on the existing tmp ignore rule for Playwright artifacts.
|
jondricek
left a comment
There was a problem hiding this comment.
Overall I approve this pull request, but i'd like you to open a new GitHub issue to update our approach to using mock data for tests in ATT&CK Navigator. We should probably continue to test with various versions of ATT&CK, so we shouldn't completely discount old stuff, but we should also test with current data too, whether mock data or real ATT&CK releases
| // Reuse existing synthetic STIX fixtures; only data responses are replaced. | ||
| await page.route('**/assets/config.json', route => route.fulfill({ | ||
| json: { ...config, collection_index_url: '', versions: configData }, | ||
| })); | ||
| await page.route(configData.entries[0].domains[0].data[0], route => route.fulfill({ | ||
| json: { | ||
| type: 'bundle', | ||
| id: 'bundle-smoke', | ||
| objects: [matrixSDO, TA0000, { ...T0001, name: 'Smoke technique' }, { ...T0003, name: 'Untouched technique' }], | ||
| }, | ||
| })); |
There was a problem hiding this comment.
This looks good, but to me it is highlighting that our mock data that it uses here hasn't been updated in 2+ years and probably longer than that, since https://github.com/mitre-attack/attack-navigator/blob/master/nav-app/src/tests/utils/mock-data.ts has ATT&CK v13 in it which is from April 2023.



Why
Establish a foundation for E2E tests that gives contributors confidence that changes preserve Navigator's core workflows. Begin with smoke coverage and a minimal happy path, then add scenarios within the same test setup as coverage grows.
What Changed
nav-app/e2e, run withnpm run test:e2e. Tests tagged@smokecan be selected with--grep @smoke; the README documents the convention and shared setup.tmp/playwright/test-results; CI uploads failure results and traces for seven days.How To Verify
nav-app/e2e/README.mdto build and run locally. The current tagged smoke test passes and writes its export to the configured artifact directory.Known Gaps
Initial coverage uses synthetic data and checks interaction and export behavior. Full ATT&CK data, layer comparison, import, visual rendering, and other browsers remain future coverage.