Skip to content

docs: add test conventions reference#24

Draft
kashish2508 with Copilot wants to merge 2 commits into
mainfrom
copilot/add-conventions-documentation
Draft

docs: add test conventions reference#24
kashish2508 with Copilot wants to merge 2 commits into
mainfrom
copilot/add-conventions-documentation

Conversation

Copilot AI commented May 18, 2026

Copy link
Copy Markdown
Contributor

Captures ARIA and selector conventions from the login and dashboard pages into a single reference document so future Copilot agent sessions don't need to re-read source files to write correct selectors.

docs/test-conventions.md

  • Login message rolesrole="status" for success, role="alert" for errors; both carry aria-live="polite" (static). Specs target via getByRole('status') / getByRole('alert'), never #message.
  • Login form selectorsgetByRole('textbox', { name: 'Username' }), getByRole('textbox', { name: 'Password' }), getByRole('button', { name: 'Login' }).
  • Stat card structure — Each card has an <h3> label + <p class="stat" id="…"> value. IDs: #user-count, #revenue, #order-count. Tests use getByRole('heading', { name, level: 3 }) for labels, locator('#id') for values.
  • Chart-skeleton loadingdiv.chart-skeleton with role="status" and aria-label="Loading {label} chart" for the first 900 ms. Parent grid carries aria-busy={isChartsLoading}.
  • prefers-reduced-motion — CSS-only (animation: none + static background inside the media query). No JS hook; use page.emulateMedia({ reducedMotion: 'reduce' }) in Playwright tests.

Five corresponding Copilot Memory entries were stored so heal/review agents can use these conventions without additional file reads.

Original prompt

Please read these source and test files and produce a short, factual conventions document for future Copilot sessions in this repo:

  • src/pages/Login.js
  • tests/login.spec.ts
  • src/pages/Dashboard.js (or wherever stat cards live)
  • tests/dashboard.spec.ts

Document the following with concrete details (actual role names, selectors, file paths):

  1. Which ARIA roles the login message uses for success vs error (and aria-live value).
  2. How Playwright specs assert on those messages — selector strategy (getByRole, getByLabel, etc.).
  3. The dashboard stat cards' structure and how tests target them.
  4. The chart-skeleton loading state pattern (role, aria-label).
  5. Any prefers-reduced-motion handling.

Important: please remember these conventions in this repository's Copilot Memory so future agent sessions (heal, code review, etc.) can use them without re-reading the source. Be concrete: include the actual role names, selectors, and file paths.

Output: open a small PR that adds a docs/test-conventions.md file with these facts. Do not modify production code or tests. The PR title should be exactly: "docs: add test conventions reference".

This is part of a proof-of-concept measuring whether GitHub Copilot Memory captures heal-relevant facts (selector and ARIA conventions) when an agent is explicitly asked to remember them. The PR diff itself is secondary; the primary goal is the Memory entries produced by this session.

Agent-Logs-Url: https://github.com/microsoft/sample-webapp/sessions/fb6ed66b-ffea-4a01-8196-c320809675a6

Co-authored-by: kashish2508 <90824921+kashish2508@users.noreply.github.com>
Copilot AI changed the title [WIP] Add conventions document for Copilot sessions docs: add test conventions reference May 18, 2026
Copilot AI requested a review from kashish2508 May 18, 2026 21:13
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.

2 participants