[E2E P2] data-testid selector convention across walked components #315

Closed
opened 2026-07-01 21:16:48 +00:00 by spikerj · 2 comments
Owner

Phase P2 of epic #307.

The app has no data-testid/data-e2e convention (only the diagram dev-tool lib uses data-testid). The anonymous walk already had to work around fragile targets (Angular host elements with zero-height boxes — see #309).

  • Define the convention (naming scheme, lint guidance, where they're required)
  • Add test ids to the shell (menu-bar, toolbar, login, language picker, footer)
  • Add test ids to components the P1 walk interacts with
  • Migrate existing specs off structural selectors (mat-toolbar.main-toolbar etc.) onto test ids
Phase P2 of epic #307. The app has no `data-testid`/`data-e2e` convention (only the diagram dev-tool lib uses `data-testid`). The anonymous walk already had to work around fragile targets (Angular host elements with zero-height boxes — see #309). - [ ] Define the convention (naming scheme, lint guidance, where they're required) - [ ] Add test ids to the shell (menu-bar, toolbar, login, language picker, footer) - [ ] Add test ids to components the P1 walk interacts with - [ ] Migrate existing specs off structural selectors (`mat-toolbar.main-toolbar` etc.) onto test ids
spikerj added the enhancement label 2026-07-01 21:16:48 +00:00
Author
Owner

PR open: spikersoft-angular#93 (spikerj/spikersoft-angular#93), branch test/issue-315-data-testid-convention off master.

What it covers against this issue's checklist:

  • Define the conventione2e/support/testids.ts is the source of truth; kebab-case, area-prefixed (nav-* / mobile-* / app-*); documented in .cursor/rules/e2e-conventions.mdc. Guidance: prefer data-testid over structural + text/role selectors (the app switches i18n at runtime).
  • Shell test ids — toolbar, language, user menu, management, login, mobile trigger/drawer/login (menu-bar.component.html) + version display (app.component.html).
  • Components the P1 walk interacts with — the anonymous walk only asserts the shell/toolbar today; that target is now tagged.
  • Migrate existing specs — anonymous walk moved from mat-toolbar.main-toolbar to getByTestId(TESTIDS.toolbar). No other spec referenced the structural shell selectors.

Additive only (no runtime/behavioral change). Full walk not run locally (needs built dist over TLS + VPN-internal API/Keycloak) — relying on the e2e-smoke CI job. Will close once #93 merges.

PR open: spikersoft-angular#93 (https://git.spikersoft.com/spikerj/spikersoft-angular/pulls/93), branch `test/issue-315-data-testid-convention` off `master`. What it covers against this issue's checklist: - [x] **Define the convention** — `e2e/support/testids.ts` is the source of truth; kebab-case, area-prefixed (`nav-*` / `mobile-*` / `app-*`); documented in `.cursor/rules/e2e-conventions.mdc`. Guidance: prefer `data-testid` over structural + text/role selectors (the app switches i18n at runtime). - [x] **Shell test ids** — toolbar, language, user menu, management, login, mobile trigger/drawer/login (`menu-bar.component.html`) + version display (`app.component.html`). - [x] **Components the P1 walk interacts with** — the anonymous walk only asserts the shell/toolbar today; that target is now tagged. - [x] **Migrate existing specs** — anonymous walk moved from `mat-toolbar.main-toolbar` to `getByTestId(TESTIDS.toolbar)`. No other spec referenced the structural shell selectors. Additive only (no runtime/behavioral change). Full walk not run locally (needs built dist over TLS + VPN-internal API/Keycloak) — relying on the `e2e-smoke` CI job. Will close once #93 merges.
Author
Owner

Resolved in spikersoft-angular PR #93 (merged to master). data-testid convention established: e2e/support/testids.ts as source of truth (kebab-case, nav-*/mobile-*/app-* prefixes), shell landmarks + nav triggers tagged in menu-bar.component.html and app.component.html, anonymous walk migrated off mat-toolbar.main-toolbar onto getByTestId, convention documented in .cursor/rules/e2e-conventions.mdc. Closing.

Resolved in spikersoft-angular PR #93 (merged to `master`). `data-testid` convention established: `e2e/support/testids.ts` as source of truth (kebab-case, `nav-*`/`mobile-*`/`app-*` prefixes), shell landmarks + nav triggers tagged in `menu-bar.component.html` and `app.component.html`, anonymous walk migrated off `mat-toolbar.main-toolbar` onto `getByTestId`, convention documented in `.cursor/rules/e2e-conventions.mdc`. Closing.
Sign in to join this conversation.