@sun-asterisk/sungen 2.6.10 → 2.6.12
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/index.js +1 -1
- package/dist/dashboard/templates/index.html +112 -101
- package/dist/exporters/xlsx-exporter.d.ts +6 -0
- package/dist/exporters/xlsx-exporter.d.ts.map +1 -1
- package/dist/exporters/xlsx-exporter.js +53 -19
- package/dist/exporters/xlsx-exporter.js.map +1 -1
- package/dist/generators/test-generator/utils/selector-resolver.d.ts +9 -0
- package/dist/generators/test-generator/utils/selector-resolver.d.ts.map +1 -1
- package/dist/generators/test-generator/utils/selector-resolver.js +18 -2
- package/dist/generators/test-generator/utils/selector-resolver.js.map +1 -1
- package/dist/orchestrator/project-initializer.d.ts.map +1 -1
- package/dist/orchestrator/project-initializer.js +5 -5
- package/dist/orchestrator/project-initializer.js.map +1 -1
- package/dist/orchestrator/templates/ai-instructions/claude-config.md +2 -0
- package/dist/orchestrator/templates/ai-instructions/claude-skill-selector-fix.md +1 -0
- package/dist/orchestrator/templates/ai-instructions/claude-skill-selector-keys.md +38 -0
- package/dist/orchestrator/templates/ai-instructions/claude-skill-tc-generation.md +2 -0
- package/dist/orchestrator/templates/ai-instructions/copilot-config.md +2 -0
- package/dist/orchestrator/templates/ai-instructions/github-skill-sungen-selector-fix.md +1 -0
- package/dist/orchestrator/templates/ai-instructions/github-skill-sungen-selector-keys.md +38 -0
- package/dist/orchestrator/templates/ai-instructions/github-skill-sungen-tc-generation.md +2 -0
- package/package.json +1 -1
- package/src/cli/index.ts +1 -1
- package/src/dashboard/templates/index.html +112 -101
- package/src/exporters/xlsx-exporter.ts +58 -19
- package/src/generators/test-generator/utils/selector-resolver.ts +19 -2
- package/src/orchestrator/project-initializer.ts +5 -5
- package/src/orchestrator/templates/ai-instructions/claude-config.md +2 -0
- package/src/orchestrator/templates/ai-instructions/claude-skill-selector-fix.md +1 -0
- package/src/orchestrator/templates/ai-instructions/claude-skill-selector-keys.md +38 -0
- package/src/orchestrator/templates/ai-instructions/claude-skill-tc-generation.md +2 -0
- package/src/orchestrator/templates/ai-instructions/copilot-config.md +2 -0
- package/src/orchestrator/templates/ai-instructions/github-skill-sungen-selector-fix.md +1 -0
- package/src/orchestrator/templates/ai-instructions/github-skill-sungen-selector-keys.md +38 -0
- package/src/orchestrator/templates/ai-instructions/github-skill-sungen-tc-generation.md +2 -0
|
@@ -115,6 +115,44 @@ gửi lời cảm ơn--3:
|
|
|
115
115
|
name: 'Gửi lời cảm ơn'
|
|
116
116
|
```
|
|
117
117
|
|
|
118
|
+
## i18n: Template Variables in Selectors
|
|
119
|
+
|
|
120
|
+
For multilingual sites without `data-testid`, use `{{variable}}` in `name` or `value` fields to reference locale-dependent text from `test-data.yaml`.
|
|
121
|
+
|
|
122
|
+
```yaml
|
|
123
|
+
# selectors — one file for all locales
|
|
124
|
+
submit:
|
|
125
|
+
type: role
|
|
126
|
+
value: button
|
|
127
|
+
name: "{{lbl_submit}}"
|
|
128
|
+
|
|
129
|
+
search:
|
|
130
|
+
type: placeholder
|
|
131
|
+
value: "{{lbl_search}}"
|
|
132
|
+
|
|
133
|
+
logo:
|
|
134
|
+
type: testid
|
|
135
|
+
value: app-logo # testid is locale-independent — no variable needed
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
```yaml
|
|
139
|
+
# test-data/login.yaml (base — English)
|
|
140
|
+
lbl_submit: "Sign in"
|
|
141
|
+
lbl_search: "Search..."
|
|
142
|
+
|
|
143
|
+
# test-data/login.vi.yaml (Vietnamese)
|
|
144
|
+
lbl_submit: "Đăng nhập"
|
|
145
|
+
lbl_search: "Tìm kiếm..."
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
Run: `SUNGEN_ENV=vi npx playwright test`
|
|
149
|
+
|
|
150
|
+
**Rules:**
|
|
151
|
+
1. Prefix i18n keys with `lbl_`, `msg_`, `txt_` to separate from test data
|
|
152
|
+
2. Prefer `data-testid` — only use `{{variable}}` when no stable selector exists
|
|
153
|
+
3. Feature file stays identical across locales
|
|
154
|
+
4. Requires runtime data mode (default, not `--inline-data`)
|
|
155
|
+
|
|
118
156
|
## Lookup Priority
|
|
119
157
|
|
|
120
158
|
Resolver searches in this order:
|
|
@@ -352,6 +352,8 @@ Feature: <Screen> Screen
|
|
|
352
352
|
|
|
353
353
|
**Environment-specific data**: create `<screen>.<env>.yaml` alongside the base file with only the keys that change. Users run `SUNGEN_ENV=staging npx playwright test` to merge overrides.
|
|
354
354
|
|
|
355
|
+
**i18n / multilingual**: use the same `SUNGEN_ENV` overlay for locale variants — e.g., `login.vi.yaml`, `login.staging-ja.yaml`. Include `lbl_*` / `msg_*` keys for selector `{{variable}}` references (see `sungen-selector-keys` § i18n). One feature file + one selector file works across all locales.
|
|
356
|
+
|
|
355
357
|
## Flow Test Generation
|
|
356
358
|
|
|
357
359
|
When generating tests for a **flow** (`qa/flows/<name>/`), adapt the strategy:
|
package/package.json
CHANGED