@sun-asterisk/sungen 2.4.5 → 2.4.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/commands/delivery.d.ts +7 -0
- package/dist/cli/commands/delivery.d.ts.map +1 -0
- package/dist/cli/commands/delivery.js +348 -0
- package/dist/cli/commands/delivery.js.map +1 -0
- package/dist/cli/commands/update.d.ts.map +1 -1
- package/dist/cli/commands/update.js +64 -1
- package/dist/cli/commands/update.js.map +1 -1
- package/dist/cli/index.js +4 -2
- package/dist/cli/index.js.map +1 -1
- package/dist/exporters/csv-exporter.d.ts +32 -0
- package/dist/exporters/csv-exporter.d.ts.map +1 -0
- package/dist/exporters/csv-exporter.js +311 -0
- package/dist/exporters/csv-exporter.js.map +1 -0
- package/dist/exporters/feature-parser.d.ts +48 -0
- package/dist/exporters/feature-parser.d.ts.map +1 -0
- package/dist/exporters/feature-parser.js +178 -0
- package/dist/exporters/feature-parser.js.map +1 -0
- package/dist/exporters/package-info.d.ts +9 -0
- package/dist/exporters/package-info.d.ts.map +1 -0
- package/dist/exporters/package-info.js +73 -0
- package/dist/exporters/package-info.js.map +1 -0
- package/dist/exporters/playwright-report-parser.d.ts +21 -0
- package/dist/exporters/playwright-report-parser.d.ts.map +1 -0
- package/dist/exporters/playwright-report-parser.js +184 -0
- package/dist/exporters/playwright-report-parser.js.map +1 -0
- package/dist/exporters/scenario-merger.d.ts +21 -0
- package/dist/exporters/scenario-merger.d.ts.map +1 -0
- package/dist/exporters/scenario-merger.js +51 -0
- package/dist/exporters/scenario-merger.js.map +1 -0
- package/dist/exporters/spec-parser.d.ts +20 -0
- package/dist/exporters/spec-parser.d.ts.map +1 -0
- package/dist/exporters/spec-parser.js +259 -0
- package/dist/exporters/spec-parser.js.map +1 -0
- package/dist/exporters/step-formatter.d.ts +32 -0
- package/dist/exporters/step-formatter.d.ts.map +1 -0
- package/dist/exporters/step-formatter.js +76 -0
- package/dist/exporters/step-formatter.js.map +1 -0
- package/dist/exporters/test-data-resolver.d.ts +20 -0
- package/dist/exporters/test-data-resolver.d.ts.map +1 -0
- package/dist/exporters/test-data-resolver.js +96 -0
- package/dist/exporters/test-data-resolver.js.map +1 -0
- package/dist/exporters/types.d.ts +104 -0
- package/dist/exporters/types.d.ts.map +1 -0
- package/dist/exporters/types.js +6 -0
- package/dist/exporters/types.js.map +1 -0
- package/dist/exporters/xlsx-exporter.d.ts +19 -0
- package/dist/exporters/xlsx-exporter.d.ts.map +1 -0
- package/dist/exporters/xlsx-exporter.js +309 -0
- package/dist/exporters/xlsx-exporter.js.map +1 -0
- package/dist/generators/test-generator/utils/selector-resolver.d.ts.map +1 -1
- package/dist/generators/test-generator/utils/selector-resolver.js +26 -0
- package/dist/generators/test-generator/utils/selector-resolver.js.map +1 -1
- package/dist/orchestrator/ai-rules-updater.d.ts.map +1 -1
- package/dist/orchestrator/ai-rules-updater.js +12 -0
- package/dist/orchestrator/ai-rules-updater.js.map +1 -1
- package/dist/orchestrator/project-initializer.d.ts +12 -1
- package/dist/orchestrator/project-initializer.d.ts.map +1 -1
- package/dist/orchestrator/project-initializer.js +84 -64
- package/dist/orchestrator/project-initializer.js.map +1 -1
- package/dist/orchestrator/screen-manager.d.ts.map +1 -1
- package/dist/orchestrator/screen-manager.js +2 -0
- package/dist/orchestrator/screen-manager.js.map +1 -1
- package/dist/orchestrator/templates/ai-instructions/claude-cmd-add-screen.md +15 -17
- package/dist/orchestrator/templates/ai-instructions/claude-cmd-create-test.md +7 -5
- package/dist/orchestrator/templates/ai-instructions/claude-cmd-delivery.md +71 -0
- package/dist/orchestrator/templates/ai-instructions/claude-cmd-run-test.md +27 -0
- package/dist/orchestrator/templates/ai-instructions/claude-config.md +12 -2
- package/dist/orchestrator/templates/ai-instructions/claude-skill-capture-figma.md +142 -0
- package/dist/orchestrator/templates/ai-instructions/claude-skill-capture-live.md +100 -0
- package/dist/orchestrator/templates/ai-instructions/claude-skill-capture-local.md +73 -0
- package/dist/orchestrator/templates/ai-instructions/claude-skill-delivery.md +103 -0
- package/dist/orchestrator/templates/ai-instructions/claude-skill-gherkin-syntax.md +2 -0
- package/dist/orchestrator/templates/ai-instructions/claude-skill-selector-keys.md +22 -0
- package/dist/orchestrator/templates/ai-instructions/copilot-cmd-add-screen.md +13 -15
- package/dist/orchestrator/templates/ai-instructions/copilot-cmd-create-test.md +6 -4
- package/dist/orchestrator/templates/ai-instructions/copilot-cmd-delivery.md +71 -0
- package/dist/orchestrator/templates/ai-instructions/copilot-cmd-run-test.md +38 -14
- package/dist/orchestrator/templates/ai-instructions/copilot-config.md +12 -2
- package/dist/orchestrator/templates/ai-instructions/github-skill-sungen-capture-figma.md +142 -0
- package/dist/orchestrator/templates/ai-instructions/github-skill-sungen-capture-live.md +100 -0
- package/dist/orchestrator/templates/ai-instructions/github-skill-sungen-capture-local.md +73 -0
- package/dist/orchestrator/templates/ai-instructions/github-skill-sungen-delivery.md +103 -0
- package/dist/orchestrator/templates/ai-instructions/github-skill-sungen-gherkin-syntax.md +2 -0
- package/dist/orchestrator/templates/ai-instructions/github-skill-sungen-selector-keys.md +22 -0
- package/dist/orchestrator/templates/playwright.config.d.ts.map +1 -1
- package/dist/orchestrator/templates/playwright.config.js +6 -1
- package/dist/orchestrator/templates/playwright.config.js.map +1 -1
- package/dist/orchestrator/templates/playwright.config.ts +6 -1
- package/package.json +2 -1
- package/src/cli/commands/delivery.ts +348 -0
- package/src/cli/commands/update.ts +84 -2
- package/src/cli/index.ts +4 -2
- package/src/exporters/csv-exporter.ts +304 -0
- package/src/exporters/feature-parser.ts +168 -0
- package/src/exporters/package-info.ts +35 -0
- package/src/exporters/playwright-report-parser.ts +168 -0
- package/src/exporters/scenario-merger.ts +63 -0
- package/src/exporters/spec-parser.ts +247 -0
- package/src/exporters/step-formatter.ts +80 -0
- package/src/exporters/test-data-resolver.ts +59 -0
- package/src/exporters/types.ts +112 -0
- package/src/exporters/xlsx-exporter.ts +301 -0
- package/src/generators/test-generator/utils/selector-resolver.ts +26 -0
- package/src/orchestrator/ai-rules-updater.ts +12 -0
- package/src/orchestrator/project-initializer.ts +103 -70
- package/src/orchestrator/screen-manager.ts +2 -0
- package/src/orchestrator/templates/ai-instructions/claude-cmd-add-screen.md +15 -17
- package/src/orchestrator/templates/ai-instructions/claude-cmd-create-test.md +7 -5
- package/src/orchestrator/templates/ai-instructions/claude-cmd-delivery.md +71 -0
- package/src/orchestrator/templates/ai-instructions/claude-cmd-run-test.md +27 -0
- package/src/orchestrator/templates/ai-instructions/claude-config.md +12 -2
- package/src/orchestrator/templates/ai-instructions/claude-skill-capture-figma.md +142 -0
- package/src/orchestrator/templates/ai-instructions/claude-skill-capture-live.md +100 -0
- package/src/orchestrator/templates/ai-instructions/claude-skill-capture-local.md +73 -0
- package/src/orchestrator/templates/ai-instructions/claude-skill-delivery.md +103 -0
- package/src/orchestrator/templates/ai-instructions/claude-skill-gherkin-syntax.md +2 -0
- package/src/orchestrator/templates/ai-instructions/claude-skill-selector-keys.md +22 -0
- package/src/orchestrator/templates/ai-instructions/copilot-cmd-add-screen.md +13 -15
- package/src/orchestrator/templates/ai-instructions/copilot-cmd-create-test.md +6 -4
- package/src/orchestrator/templates/ai-instructions/copilot-cmd-delivery.md +71 -0
- package/src/orchestrator/templates/ai-instructions/copilot-cmd-run-test.md +38 -14
- package/src/orchestrator/templates/ai-instructions/copilot-config.md +12 -2
- package/src/orchestrator/templates/ai-instructions/github-skill-sungen-capture-figma.md +142 -0
- package/src/orchestrator/templates/ai-instructions/github-skill-sungen-capture-live.md +100 -0
- package/src/orchestrator/templates/ai-instructions/github-skill-sungen-capture-local.md +73 -0
- package/src/orchestrator/templates/ai-instructions/github-skill-sungen-delivery.md +103 -0
- package/src/orchestrator/templates/ai-instructions/github-skill-sungen-gherkin-syntax.md +2 -0
- package/src/orchestrator/templates/ai-instructions/github-skill-sungen-selector-keys.md +22 -0
- package/src/orchestrator/templates/playwright.config.ts +6 -1
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: sungen-delivery
|
|
3
|
+
description: 'Export Gherkin scenarios + Playwright results → CSV test case deliverable. Auto-loaded by delivery command.'
|
|
4
|
+
user-invocable: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Purpose
|
|
8
|
+
|
|
9
|
+
Export test cases from Sungen screens to a standardized CSV file (format BM-2-901-13) for QA delivery.
|
|
10
|
+
|
|
11
|
+
**This skill delegates all heavy work to the `sungen delivery` CLI.** The CLI is the single source of truth for parsing logic — do NOT re-parse files in AI. Your role is only to:
|
|
12
|
+
|
|
13
|
+
1. Invoke the CLI
|
|
14
|
+
2. Show its output verbatim
|
|
15
|
+
3. Help the user react to pre-flight failures
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Architecture
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
User → /sungen:delivery [screen...]
|
|
23
|
+
│
|
|
24
|
+
▼
|
|
25
|
+
sungen delivery CLI (deterministic — no AI tokens)
|
|
26
|
+
├─ Scope detection (no-arg = all screens)
|
|
27
|
+
├─ Pre-flight source checks per screen
|
|
28
|
+
├─ Parse .feature (metadata)
|
|
29
|
+
├─ Parse .spec.ts (resolved Playwright code — source of truth)
|
|
30
|
+
├─ Parse test-data.yaml (resolve {{vars}})
|
|
31
|
+
├─ Parse test-results/results.json (match test titles)
|
|
32
|
+
├─ Merge sources + generate CSV rows
|
|
33
|
+
└─ Write qa/deliverables/<screen>-testcases.csv
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Source modules: `src/exporters/*.ts`
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## Required sources (CLI pre-flight checks these)
|
|
41
|
+
|
|
42
|
+
| # | Source | Path | Created by |
|
|
43
|
+
|---|--------|------|------------|
|
|
44
|
+
| 1 | Feature file | `qa/screens/<screen>/features/<screen>.feature` | `/sungen:add-screen` + `/sungen:create-test` |
|
|
45
|
+
| 2 | Test data | `qa/screens/<screen>/test-data/<screen>.yaml` | `/sungen:create-test` |
|
|
46
|
+
| 3 | Selectors | `qa/screens/<screen>/selectors/<screen>.yaml` | `/sungen:run-test` |
|
|
47
|
+
| 4 | Compiled spec | `specs/generated/<screen>/<screen>.spec.ts` | `sungen generate` (during `/sungen:run-test`) |
|
|
48
|
+
| 5 | Test results | `specs/generated/<screen>/<screen>-test-result.json` (per-screen) or `test-results/results.json` (global fallback) | `/sungen:run-test` |
|
|
49
|
+
|
|
50
|
+
**Sources 1-4 are blocking** — CLI aborts if any is missing.
|
|
51
|
+
**Source 5 is optional** — CSV is still generated but Test Result/Date/Executor/Env columns are empty (all tests show as Pending).
|
|
52
|
+
|
|
53
|
+
The CLI reads the **per-screen result file first** (co-located with `.spec.ts`), then falls back to the global `test-results/results.json`. Per-screen is preferred because the global file gets OVERWRITTEN each time Playwright runs, losing results from earlier screens.
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## Column mapping (handled by CLI)
|
|
58
|
+
|
|
59
|
+
| CSV Column | Source |
|
|
60
|
+
|------------|--------|
|
|
61
|
+
| TC ID | Generated: `<SCREEN_UPPER>-<VP>-<NNN>` |
|
|
62
|
+
| Category 1 | Scenario name with VP prefix stripped |
|
|
63
|
+
| Category 2 | VP group: `VP-SEC`→Accessing, `VP-UI`→GUI, `VP-VAL`/`VP-LOGIC`→Function |
|
|
64
|
+
| Category 3 | Feature name (first line of `.feature`) |
|
|
65
|
+
| Category 4 | Screen name |
|
|
66
|
+
| Pre-condition | Auth tag → "Logged in as X" / "Not authenticated" + Given steps (natural language) |
|
|
67
|
+
| Test Data | `{{vars}}` from scenario resolved via test-data.yaml → `key: value; key2: value2` |
|
|
68
|
+
| Steps | `.spec.ts` code comments for interactions (numbered) |
|
|
69
|
+
| Expected results | `.spec.ts` `expect(...)` comments (numbered) |
|
|
70
|
+
| Priority | Tag: `@critical`/`@high`/`@normal`/`@low` (default: Normal) |
|
|
71
|
+
| Testcase type | `@manual` → Manual, else Auto. Not compiled → "Not compiled" |
|
|
72
|
+
| Test Result | results.json status: passed→Passed, failed/timedOut→Failed, skipped→N/A, else Pending |
|
|
73
|
+
| Executed Date | results.json startTime formatted as `dd/mm/yyyy` |
|
|
74
|
+
| Test Executor | `git config user.name` |
|
|
75
|
+
| Test Environment | `playwright.config.ts` baseURL + project name |
|
|
76
|
+
| Note | Error message + trace path (for failed tests) |
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
## Excluded from CSV
|
|
81
|
+
|
|
82
|
+
- `@steps:<name>` **base** scenarios — these are setup-only, inlined into `@extend:...` scenarios at compile time
|
|
83
|
+
- Default scaffold `Sample scenario for <screen>` — not a real test
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
## CLI command reference
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
# Export all screens
|
|
91
|
+
sungen delivery
|
|
92
|
+
|
|
93
|
+
# Export specific screens
|
|
94
|
+
sungen delivery kudos awards
|
|
95
|
+
|
|
96
|
+
# Skip pre-flight (CI only)
|
|
97
|
+
sungen delivery --skip-preflight
|
|
98
|
+
|
|
99
|
+
# Skip screens with blocking misses
|
|
100
|
+
sungen delivery --continue-on-missing
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
Output: `qa/deliverables/<screen>-testcases.csv` (UTF-8 with BOM)
|
|
@@ -109,6 +109,8 @@ Row scope: `see [Ref] row in [Table] table with {{v}}` enters scope. Subsequent
|
|
|
109
109
|
|
|
110
110
|
Most elements auto-infer from `[Label] type` → `getByRole(type, { name: 'Label' })`. Only add YAML when the accessible name differs, needs `nth`, or needs `testid`. Full auto-infer table → see `sungen-selector-keys` skill.
|
|
111
111
|
|
|
112
|
+
**Types requiring YAML entry:** `date-picker`, `uploader`, `overlay`, `frame`, `step` - these have no standard ARIA role and need explicit selectors.
|
|
113
|
+
|
|
112
114
|
## YAML Keys
|
|
113
115
|
|
|
114
116
|
`[Reference]` → **lowercase, keep Unicode**: `[Search Content]` → `search content:`, `[Thời gian]` → `thời gian:`
|
|
@@ -102,5 +102,27 @@ If no YAML key exists, the resolver infers from the Gherkin element type:
|
|
|
102
102
|
| `[X] list` | `getByRole('list', { name: 'X' })` |
|
|
103
103
|
| `[X] column` | `getByRole('columnheader', { name: 'X' })` |
|
|
104
104
|
| `[X] dialog` / `modal` / `drawer` | `getByRole('dialog', { name: 'X' })` |
|
|
105
|
+
| `[X] dropdown` / `select` | `getByRole('combobox', { name: 'X' })` |
|
|
106
|
+
| `[X] menuitem` | `getByRole('menuitem', { name: 'X' })` |
|
|
107
|
+
| `[X] progressbar` | `getByRole('progressbar', { name: 'X' })` |
|
|
108
|
+
| `[X] section` | `getByRole('region', { name: 'X' })` |
|
|
109
|
+
| `[X] card` | `getByRole('article', { name: 'X' })` |
|
|
110
|
+
| `[X] item` | `getByRole('listitem', { name: 'X' })` |
|
|
111
|
+
| `[X] cell` | `getByRole('cell', { name: 'X' })` |
|
|
112
|
+
| `[X] spinner` | `getByRole('status', { name: 'X' })` |
|
|
113
|
+
| `[X] breadcrumb` | `getByRole('navigation', { name: 'X' })` |
|
|
114
|
+
| `[X] badge` / `tooltip` / `tag` | `getByText('X')` |
|
|
105
115
|
|
|
106
116
|
**Only add a YAML entry when** the auto-inferred locator won't work (wrong name, need testid, need nth, etc.).
|
|
117
|
+
|
|
118
|
+
### Types requiring YAML entry (no auto-infer)
|
|
119
|
+
|
|
120
|
+
These types need explicit `selectors.yaml` entries:
|
|
121
|
+
|
|
122
|
+
| Type | Reason |
|
|
123
|
+
|------|--------|
|
|
124
|
+
| `date-picker` | Custom component, needs testid or CSS |
|
|
125
|
+
| `uploader` | File input, needs upload type selector |
|
|
126
|
+
| `overlay` | No standard ARIA role, needs CSS/testid |
|
|
127
|
+
| `frame` | Needs iframe selector |
|
|
128
|
+
| `step` | Custom stepper component, needs testid |
|
|
@@ -24,7 +24,12 @@ export default defineConfig({
|
|
|
24
24
|
/* Global timeout per test */
|
|
25
25
|
timeout: 10_000,
|
|
26
26
|
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
|
|
27
|
-
reporter
|
|
27
|
+
/* JSON reporter is required by `sungen delivery` to populate test result columns in the exported CSV. */
|
|
28
|
+
/* Output file path is controlled by PLAYWRIGHT_JSON_OUTPUT_NAME env var for per-screen isolation. */
|
|
29
|
+
reporter: [
|
|
30
|
+
['html'],
|
|
31
|
+
['json', { outputFile: process.env.PLAYWRIGHT_JSON_OUTPUT_NAME || 'test-results/results.json' }],
|
|
32
|
+
],
|
|
28
33
|
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
|
|
29
34
|
use: {
|
|
30
35
|
/* Base URL to use in actions like `await page.goto('')`. */
|