Skip to content

Commit d9fa1a0

Browse files
docs: Align UI testing convention examples with current login test IDs and credentials for consistency with the framework.
1 parent b3c176d commit d9fa1a0

2 files changed

Lines changed: 9 additions & 7 deletions

File tree

.codex/skills/playwright-pom-agent-skills-quality-tooling/SKILL.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Maintain the framework infrastructure that supports test execution quality and d
2727

2828
## Follow These Rules
2929

30-
- Keep `config/test-config.json` as the single config source.
30+
- Keep `config/test-config.json` as the single config source for base URLs, role credentials, and shared waits.
3131
- Keep framework timeout derivation in `utils/common/Waits.ts`.
3232
- Keep scoped logging via `logger.withScope(...)`.
3333
- Keep the custom reporter at `utils/common/CustomReporter.ts`.
@@ -42,6 +42,7 @@ Maintain the framework infrastructure that supports test execution quality and d
4242
3. Reuse an existing script or helper before adding a new one.
4343
4. Keep claims in docs limited to what the framework actually implements.
4444

45+
4546
## Preferred Change Order
4647

4748
1. Change configuration or shared helper logic first.

.codex/skills/playwright-pom-agent-skills-ui-pom/references/testing-conventions.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ Bad:
4747

4848
```ts
4949
// ui/specs/login.spec.ts
50-
await page.getByTestId("username-input").fill("admin");
51-
await page.getByTestId("password-input").fill("wrong-password");
52-
await page.getByRole("button", { name: "Sign in" }).click();
50+
await page.getByTestId("login-username").fill("admin");
51+
await page.getByTestId("login-password").fill("wrong-password");
52+
await page.getByTestId("login-submit").click();
5353
await expect(page.getByTestId("login-error")).toBeVisible();
5454
```
5555

@@ -109,9 +109,9 @@ Before:
109109
```ts
110110
// generated-style test
111111
await page.goto("/login");
112-
await page.getByTestId("username-input").fill("admin");
113-
await page.getByTestId("password-input").fill("adminpass");
114-
await page.getByRole("button", { name: "Sign in" }).click();
112+
await page.getByTestId("login-username").fill("admin");
113+
await page.getByTestId("login-password").fill("admin123");
114+
await page.getByTestId("login-submit").click();
115115
await expect(page.getByTestId("home-title")).toBeVisible();
116116
```
117117

@@ -170,3 +170,4 @@ Why:
170170
- `ui/pages/LoginPage.ts`
171171
- `ui/pages/HomePage.ts`
172172
- `ui/pages/FoldersPage.ts`
173+

0 commit comments

Comments
 (0)