speccore 8.3.147 → 8.3.148
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/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +9 -1
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/update.d.ts.map +1 -1
- package/dist/commands/update.js +4 -1
- package/dist/commands/update.js.map +1 -1
- package/package.json +3 -2
- package/templates/api-design-example.md +338 -0
- package/templates/ci/github-actions.yml +44 -0
- package/templates/dashboard.html +425 -0
- package/templates/database-example.md +223 -0
- package/templates/deploy-docker/README.md +284 -0
- package/templates/deploy-docker/deploy-remote.sh +79 -0
- package/templates/deploy-docker/docker-compose.yml +113 -0
- package/templates/deploy-docker/frontend.Dockerfile +43 -0
- package/templates/deploy-docker/nginx.conf +30 -0
- package/templates/deploy-examples.yaml +436 -0
- package/templates/deploy-java/Dockerfile +50 -0
- package/templates/deploy-java/README.md +212 -0
- package/templates/deploy-java/deploy.sh +120 -0
- package/templates/deploy-java/spring-boot.service +35 -0
- package/templates/html/speccore-ask-explain.html +10 -0
- package/templates/html/speccore-ask-guide.html +10 -0
- package/templates/html/speccore-ask-match.html +10 -0
- package/templates/html/speccore-ask-pipeline.html +1 -0
- package/templates/html/speccore-ask-result.html +10 -0
- package/templates/html/speccore-demo.html +449 -0
- package/templates/html/speccore-dev.html +202 -0
- package/templates/html/speccore-help.html +1 -0
- package/templates/html/speccore-knowledge-graph.html +656 -0
- package/templates/html/speccore-retro-T-001.html +1 -0
- package/templates/html/speccore-setup-guide.html +289 -0
- package/templates/html/speccore-welcome.html +1 -0
- package/templates/security-example.md +226 -0
- package/templates/verify-spec-example.yaml +138 -0
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
# VERIFY_SPEC.yaml — UI 冒烟测试规格
|
|
2
|
+
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
3
|
+
# 格式类型: VERIFY_SPEC 格式(scenarios + actions + assertions 结构)
|
|
4
|
+
# 适用场景: 精细 UI 交互测试(填写表单、点击按钮、断言元素状态)
|
|
5
|
+
# 对应命令:
|
|
6
|
+
# • speccore verify --ui --spec ./tests/smoke.yaml ← 推荐,原生支持完整交互逻辑
|
|
7
|
+
# • speccore verify --ui --config ./tests/smoke.yaml ← 兼容,自动转换为批量页面测试
|
|
8
|
+
# 按模块过滤: speccore verify --ui --spec ./tests/smoke.yaml --module=login
|
|
9
|
+
#
|
|
10
|
+
# ⚠️ 格式说明:
|
|
11
|
+
# VERIFY_SPEC 格式 = scenarios + actions + assertions(本文件,支持完整交互)
|
|
12
|
+
# TestConfig 格式 = tests + routes + type(用于批量页面/API测试,见 pr.yaml/release.yaml)
|
|
13
|
+
# 两种格式 speccore verify --config 均可自动识别。
|
|
14
|
+
#
|
|
15
|
+
# v8.3.95+ 支持: cookie / localStorage / script / scroll / upload / iframe / waitForRequest / waitForResponse
|
|
16
|
+
|
|
17
|
+
name: 示例项目冒烟测试
|
|
18
|
+
platform: h5-mobile
|
|
19
|
+
url: /
|
|
20
|
+
|
|
21
|
+
scenarios:
|
|
22
|
+
# ── 场景1: 登录流程 ──
|
|
23
|
+
- name: 登录-账号密码登录
|
|
24
|
+
description: 模块:auth 页面:/login
|
|
25
|
+
actions:
|
|
26
|
+
- type: navigate
|
|
27
|
+
value: /login
|
|
28
|
+
- type: fill
|
|
29
|
+
selector: 'input[name="username"]'
|
|
30
|
+
value: test_user
|
|
31
|
+
- type: fill
|
|
32
|
+
selector: 'input[name="password"]'
|
|
33
|
+
value: test_password
|
|
34
|
+
- type: click
|
|
35
|
+
selector: 'button[type="submit"]'
|
|
36
|
+
waitFor: '.dashboard-container'
|
|
37
|
+
assertions:
|
|
38
|
+
- type: url
|
|
39
|
+
contains: /dashboard
|
|
40
|
+
- type: visible
|
|
41
|
+
selector: '.dashboard-container'
|
|
42
|
+
|
|
43
|
+
# ── 场景2: Cookie 注入免登录 ──
|
|
44
|
+
# 适用于: 已有登录态 Cookie,跳过登录页直接测试业务模块
|
|
45
|
+
- name: 预订列表-免登录(cookie注入)
|
|
46
|
+
description: 模块:booking 页面:/booking/list
|
|
47
|
+
actions:
|
|
48
|
+
# 注入登录 Cookie(跳过登录页)
|
|
49
|
+
- type: cookie
|
|
50
|
+
selector: session_token
|
|
51
|
+
value: eyJhbGciOiJIUzI1NiIs...
|
|
52
|
+
domain: example.com
|
|
53
|
+
path: /
|
|
54
|
+
secure: true
|
|
55
|
+
httpOnly: true
|
|
56
|
+
- type: navigate
|
|
57
|
+
value: /booking/list
|
|
58
|
+
- type: wait
|
|
59
|
+
delay: 1000
|
|
60
|
+
assertions:
|
|
61
|
+
- type: visible
|
|
62
|
+
selector: '.booking-list'
|
|
63
|
+
- type: count
|
|
64
|
+
selector: '.booking-item'
|
|
65
|
+
count: 5
|
|
66
|
+
|
|
67
|
+
# ── 场景3: localStorage 注入 Token ──
|
|
68
|
+
# 适用于: JWT Token 存储在 localStorage 的前端项目
|
|
69
|
+
- name: 个人中心-Token注入
|
|
70
|
+
description: 模块:user 页面:/profile
|
|
71
|
+
actions:
|
|
72
|
+
- type: localStorage
|
|
73
|
+
selector: accessToken
|
|
74
|
+
value: Bearer eyJhbGciOiJIUzI1NiIs...
|
|
75
|
+
- type: navigate
|
|
76
|
+
value: /profile
|
|
77
|
+
- type: wait
|
|
78
|
+
delay: 500
|
|
79
|
+
assertions:
|
|
80
|
+
- type: visible
|
|
81
|
+
selector: '.profile-header'
|
|
82
|
+
- type: text
|
|
83
|
+
selector: '.username'
|
|
84
|
+
contains: test_user
|
|
85
|
+
|
|
86
|
+
# ── 场景4: 按模块测试示例 (booking 模块) ──
|
|
87
|
+
# 运行: speccore verify --ui --config ./tests/smoke.yaml --module=booking
|
|
88
|
+
- name: 预订表单-提交预订
|
|
89
|
+
description: 模块:booking 页面:/booking/create
|
|
90
|
+
actions:
|
|
91
|
+
- type: navigate
|
|
92
|
+
value: /booking/create
|
|
93
|
+
- type: fill
|
|
94
|
+
selector: 'input[name="checkIn"]'
|
|
95
|
+
value: '2026-10-01'
|
|
96
|
+
- type: fill
|
|
97
|
+
selector: 'input[name="checkOut"]'
|
|
98
|
+
value: '2026-10-05'
|
|
99
|
+
- type: click
|
|
100
|
+
selector: '.search-btn'
|
|
101
|
+
waitFor: '.room-list'
|
|
102
|
+
- type: click
|
|
103
|
+
selector: '.room-item:first-child .select-btn'
|
|
104
|
+
- type: click
|
|
105
|
+
selector: '.submit-booking-btn'
|
|
106
|
+
waitFor: '.booking-success'
|
|
107
|
+
assertions:
|
|
108
|
+
- type: visible
|
|
109
|
+
selector: '.booking-success'
|
|
110
|
+
- type: text
|
|
111
|
+
selector: '.booking-success'
|
|
112
|
+
contains: 预订成功
|
|
113
|
+
|
|
114
|
+
# ── 场景5: 滚动 + 元素存在性检查 ──
|
|
115
|
+
- name: 首页-滚动加载
|
|
116
|
+
description: 模块:home 页面:/
|
|
117
|
+
actions:
|
|
118
|
+
- type: navigate
|
|
119
|
+
value: /
|
|
120
|
+
- type: scroll
|
|
121
|
+
selector: bottom
|
|
122
|
+
- type: wait
|
|
123
|
+
delay: 1000
|
|
124
|
+
assertions:
|
|
125
|
+
- type: visible
|
|
126
|
+
selector: '.footer'
|
|
127
|
+
|
|
128
|
+
# ── 场景6: 样式断言 ──
|
|
129
|
+
- name: 按钮-样式检查
|
|
130
|
+
description: 模块:ui 页面:/
|
|
131
|
+
actions:
|
|
132
|
+
- type: navigate
|
|
133
|
+
value: /
|
|
134
|
+
assertions:
|
|
135
|
+
- type: style
|
|
136
|
+
selector: '.primary-btn'
|
|
137
|
+
style: background-color
|
|
138
|
+
value: rgb(24, 144, 255)
|