Skip to content

Commit 18928bd

Browse files
committed
docs: add Playwright migration spec and plan
1 parent bbb74dd commit 18928bd

2 files changed

Lines changed: 130 additions & 0 deletions

File tree

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Items Planning Playwright Migration — Implementation Plan
2+
3+
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development to implement this plan task-by-task.
4+
5+
**Goal:** Migrate items-planning WDIO e2e tests to Playwright with CI jobs.
6+
7+
**Architecture:** 3 page objects + 8 test files across folders a/b/c. Uses shared Playwright page objects from eform-angular-frontend.
8+
9+
**Tech Stack:** Playwright Test, TypeScript, GitHub Actions
10+
11+
---
12+
13+
See spec at `docs/superpowers/specs/2026-04-04-items-planning-playwright-migration-design.md` for detailed conversion patterns.
14+
15+
Tasks:
16+
1. Create `playwright.config.ts`
17+
2. Port `ItemsPlanningPlanningPage.ts` (main page + PlanningRowObject + PlanningCreateUpdate)
18+
3. Port `ItemsPlanningModal.page.ts` (create/edit/delete modals)
19+
4. Port `ItemsPlanningPairingPage.ts` (pairing grid)
20+
5. Copy `PlanningsTestImport.data.ts` (pure data, no WDIO deps)
21+
6. Port folder `a/` test (plugin activation)
22+
7. Port folder `b/` tests (add, edit, delete)
23+
8. Port folder `c/` tests (sorting, multiple-delete, tags, import, pairing)
24+
9. Update master workflow
25+
10. Update PR workflow
26+
11. Create PR
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
# Items Planning Plugin — Playwright Migration Design Spec
2+
3+
## Goal
4+
5+
Migrate WDIO e2e tests in `eform-angular-items-planning-plugin` to Playwright, following patterns from `eform-angular-workflow-plugin` PR #1346. WDIO tests remain in place.
6+
7+
## Current State
8+
9+
- **10 WDIO test files** (+ 1 placeholder `assert-true.spec.ts`)
10+
- **4 WDIO page objects** in `eform-client/e2e/Page objects/ItemsPlanning/`
11+
- **CI uses matrix [a,b,c]** mapping to `wdio-headless-plugin-step2{a,b,c}.conf.ts`
12+
- Config `a` runs only `assert-true.spec.ts` (placeholder), `b` same, `c` runs tags/import/pairing/plugins-page
13+
- No Playwright files exist
14+
15+
## Target State
16+
17+
### New Files
18+
19+
```
20+
eform-client/playwright.config.ts
21+
eform-client/playwright/e2e/plugins/items-planning-pn/
22+
├── ItemsPlanningPlanningPage.ts
23+
├── ItemsPlanningModal.page.ts
24+
├── ItemsPlanningPairingPage.ts
25+
├── PlanningsTestImport.data.ts
26+
├── a/
27+
│ └── items-planning-settings.spec.ts # plugin activation
28+
├── b/
29+
│ ├── items-planning.add.spec.ts
30+
│ ├── items-planning.edit.spec.ts
31+
│ └── items-planning.delete.spec.ts
32+
└── c/
33+
├── items-planning.sorting.spec.ts
34+
├── items-planning.multiple-delete.spec.ts
35+
├── items-planning.tags.spec.ts
36+
├── items-planning.import.spec.ts
37+
└── items-planning.pairing.spec.ts
38+
```
39+
40+
### Modified Files
41+
42+
| File | Change |
43+
|------|--------|
44+
| `.github/workflows/dotnet-core-master.yml` | Add `items-planning-playwright-test` job |
45+
| `.github/workflows/dotnet-core-pr.yml` | Add `items-planning-playwright-test` job |
46+
47+
## Excluded Tests
48+
49+
- `items-planning.settings.spec.ts` — references missing `ItemsPlanningSettings.page`, not run in CI
50+
- `assert-true.spec.ts` — placeholder canary
51+
52+
## WDIO → Playwright Conversion Patterns
53+
54+
| WDIO | Playwright |
55+
|------|-----------|
56+
| `$('#id')` | `this.page.locator('#id')` |
57+
| `$$('sel')` | `this.page.locator('sel')` |
58+
| `element.getText()` | `locator.textContent()` + `.trim()` |
59+
| `element.getValue()` | `locator.inputValue()` |
60+
| `element.setValue(v)` | `locator.fill(v)` |
61+
| `element.addValue(v)` | `locator.pressSequentially(v)` |
62+
| `element.getProperty('checked')` | `locator.isChecked()` |
63+
| `element.getAttribute('style')` | `locator.getAttribute('style')` |
64+
| `element.waitForDisplayed()` | `locator.waitFor({state:'visible'})` |
65+
| `element.waitForDisplayed({reverse:true})` | `locator.waitFor({state:'hidden'})` |
66+
| `element.waitForClickable()` | `locator.waitFor({state:'visible'})` (Playwright auto-waits on click) |
67+
| `element.isClickable()` | `await locator.isVisible()` |
68+
| `element.isExisting()` | `await locator.count() > 0` |
69+
| `browser.pause(n)` | `page.waitForTimeout(n)` |
70+
| `browser.keys(['Return'])` | `page.keyboard.press('Enter')` |
71+
| `browser.keys(['Escape'])` | `page.keyboard.press('Escape')` |
72+
| `browser.uploadFile(path)` | `locator.setInputFiles(path)` |
73+
| `export default new Class()` | `export class Class { constructor(page: Page) {} }` |
74+
| `selectValueInNgSelector(element, value)` | `selectValueInNgSelector(page, '#selector', value)` |
75+
| `selectDateOnDatePicker(y,m,d)` | `selectDateOnNewDatePicker(page, y, m, d)` |
76+
| `customDaLocale` date format `P` | `format(date, 'dd.MM.yyyy')` (equivalent output) |
77+
78+
## Shared Dependencies from eform-angular-frontend
79+
80+
Page objects (already Playwright-ready):
81+
- `LoginPage`, `MyEformsPage`, `PluginPage`, `FoldersPage`, `DeviceUsersPage`, `TagsModalPage`
82+
83+
Helper functions:
84+
- `generateRandmString`, `getRandomInt`, `selectValueInNgSelector`, `selectDateOnNewDatePicker`, `testSorting`
85+
86+
Import paths from `plugins/items-planning-pn/`:
87+
- Shared page objects: `../../Page objects/X.page`
88+
- Helper functions: `../../helper-functions`
89+
- From test files in `a/`, `b/`, `c/`: `../../../Page objects/X.page`, `../../../helper-functions`
90+
- Plugin page objects from same plugin dir: `../ItemsPlanningPlanningPage`
91+
92+
## CI Job Design
93+
94+
New `items-planning-playwright-test` job:
95+
- `needs: build`, matrix `[a,b,c]`
96+
- Copies plugin source + Playwright tests + config into frontend
97+
- For matrix `a`: no plugin enable (activation test), loads DB dump from cypress path
98+
- For matrix `b`,`c`: enables plugin in DB, restarts container
99+
- Runs `npx playwright test playwright/e2e/plugins/items-planning-pn/${{matrix.test}}/`
100+
- Uploads Playwright report artifact on failure
101+
102+
## Assets
103+
104+
The import test requires `e2e/Assets/Skabelon Døvmark NEW.xlsx`. This needs to be copied to the frontend in CI. The Playwright test uses `page.setInputFiles()` instead of WDIO's `browser.uploadFile()`.

0 commit comments

Comments
 (0)