|
1 | 1 | { |
2 | 2 | "app_name": "TodoApp", |
3 | | - "description": "PyQt5待办事项应用完整测试。验证添加、标记完成、删除、清空已完成、空输入提示等核心功能。初始数据3条:Buy milk、Read book、Exercise", |
| 3 | + "description": "PyQt5增强版待办事项应用测试。验证优先级、搜索过滤、排序、删除确认、全选、重复检测、空输入提示等功能。初始数据5条:Buy milk(High)、Read book(Medium)、Exercise(Low)、Write report(High)、Call dentist(Medium)", |
4 | 4 | "platform": "desktop", |
5 | 5 | "base_url": "", |
6 | 6 | "window_title": "TodoApp", |
|
13 | 13 | "scenarios": [ |
14 | 14 | { |
15 | 15 | "name": "初始状态验证", |
16 | | - "description": "验证应用启动后的初始数据和统计", |
| 16 | + "description": "验证应用启动后的初始数据(5条)、优先级标签和统计栏(含Urgent计数)", |
17 | 17 | "steps": [ |
18 | 18 | { |
19 | 19 | "action": "screenshot", |
20 | | - "description": "应用启动后的初始状态" |
| 20 | + "description": "应用启动后的初始状态,应显示5条待办,每条带优先级标签[H]/[M]/[L]" |
21 | 21 | }, |
22 | 22 | { |
23 | 23 | "action": "assert_text", |
24 | | - "expected": "Total: 3", |
25 | | - "description": "验证底部统计栏显示初始有3条待办" |
| 24 | + "expected": "Total: 5", |
| 25 | + "description": "验证底部统计栏显示初始有5条待办" |
| 26 | + }, |
| 27 | + { |
| 28 | + "action": "assert_text", |
| 29 | + "expected": "Urgent: 2", |
| 30 | + "description": "验证底部统计栏显示2条高优先级未完成(Buy milk和Write report)" |
26 | 31 | }, |
27 | 32 | { |
28 | 33 | "action": "assert_text", |
29 | 34 | "expected": "Buy milk", |
30 | | - "description": "验证列表区域包含初始数据Buy milk" |
| 35 | + "description": "验证列表包含初始数据Buy milk" |
31 | 36 | }, |
32 | 37 | { |
33 | 38 | "action": "assert_text", |
34 | | - "expected": "Pending: 3", |
35 | | - "description": "验证底部统计栏显示3条都是未完成状态" |
| 39 | + "expected": "Write report", |
| 40 | + "description": "验证列表包含初始数据Write report" |
36 | 41 | } |
37 | 42 | ] |
38 | 43 | }, |
39 | 44 | { |
40 | | - "name": "添加待办事项", |
41 | | - "description": "在输入框输入新待办并点Add添加,验证列表和统计更新", |
| 45 | + "name": "添加High优先级待办", |
| 46 | + "description": "选择High优先级后添加新待办,验证列表更新和Urgent计数+1", |
42 | 47 | "steps": [ |
| 48 | + { |
| 49 | + "action": "click", |
| 50 | + "target": "name:High", |
| 51 | + "description": "点击输入框右侧的优先级下拉框,当前显示Medium,点击后选择High选项。下拉框位于输入框和Add按钮之间" |
| 52 | + }, |
| 53 | + { |
| 54 | + "action": "wait", |
| 55 | + "value": "300", |
| 56 | + "description": "等待下拉选择完成" |
| 57 | + }, |
43 | 58 | { |
44 | 59 | "action": "fill", |
45 | 60 | "target": "name:输入待办事项...", |
46 | | - "value": "Learn Python", |
47 | | - "description": "在页面顶部标题下方、包含'输入待办事项...'占位符文字的输入框中输入" |
| 61 | + "value": "Fix critical bug", |
| 62 | + "description": "在页面中部包含'输入待办事项...'占位符的输入框中输入。输入后文字会替换占位符" |
48 | 63 | }, |
49 | 64 | { |
50 | 65 | "action": "click", |
51 | 66 | "target": "name:Add", |
52 | | - "description": "点击输入框右侧的蓝色Add按钮" |
| 67 | + "description": "点击输入框行最右侧的蓝色Add按钮,点击后列表新增一行'○ [H] Fix critical bug',底部Total变为6,Urgent变为3" |
53 | 68 | }, |
54 | 69 | { |
55 | 70 | "action": "wait", |
56 | 71 | "value": "500", |
57 | 72 | "description": "等待列表刷新" |
58 | 73 | }, |
| 74 | + { |
| 75 | + "action": "assert_text", |
| 76 | + "expected": "Total: 6", |
| 77 | + "description": "验证底部统计栏总数从5变为6" |
| 78 | + }, |
| 79 | + { |
| 80 | + "action": "assert_text", |
| 81 | + "expected": "Fix critical bug", |
| 82 | + "description": "验证列表中出现新添加的Fix critical bug" |
| 83 | + }, |
| 84 | + { |
| 85 | + "action": "assert_text", |
| 86 | + "expected": "Urgent: 3", |
| 87 | + "description": "验证Urgent计数从2变为3(新增了一条High优先级)" |
| 88 | + } |
| 89 | + ] |
| 90 | + }, |
| 91 | + { |
| 92 | + "name": "搜索过滤功能", |
| 93 | + "description": "在搜索框输入关键词,验证列表实时过滤只显示匹配项,并显示过滤状态提示", |
| 94 | + "steps": [ |
| 95 | + { |
| 96 | + "action": "fill", |
| 97 | + "target": "name:Search...", |
| 98 | + "value": "book", |
| 99 | + "description": "在页面顶部标题下方、黄色背景的搜索框(含Search...占位符)中输入book,输入后列表实时过滤只显示包含book的项(Read book),搜索框下方出现'Showing 1 of 6 items'" |
| 100 | + }, |
| 101 | + { |
| 102 | + "action": "wait", |
| 103 | + "value": "500", |
| 104 | + "description": "等待过滤结果显示" |
| 105 | + }, |
59 | 106 | { |
60 | 107 | "action": "screenshot", |
61 | | - "description": "添加Learn Python后的列表" |
| 108 | + "description": "搜索book后的过滤结果,应只显示Read book一项" |
62 | 109 | }, |
63 | 110 | { |
64 | 111 | "action": "assert_text", |
65 | | - "expected": "Total: 4", |
66 | | - "description": "验证底部统计栏总数从3变为4" |
| 112 | + "expected": "Showing 1 of 6", |
| 113 | + "description": "验证过滤状态提示显示'Showing 1 of 6 items'" |
67 | 114 | }, |
68 | 115 | { |
69 | 116 | "action": "assert_text", |
70 | | - "expected": "Learn Python", |
71 | | - "description": "验证列表中出现新添加的Learn Python" |
| 117 | + "expected": "Read book", |
| 118 | + "description": "验证过滤后列表只显示Read book" |
| 119 | + }, |
| 120 | + { |
| 121 | + "action": "fill", |
| 122 | + "target": "name:Search...", |
| 123 | + "value": "", |
| 124 | + "description": "清空搜索框,清空后列表恢复显示全部6条,过滤状态提示消失" |
| 125 | + }, |
| 126 | + { |
| 127 | + "action": "wait", |
| 128 | + "value": "500", |
| 129 | + "description": "等待列表恢复" |
| 130 | + }, |
| 131 | + { |
| 132 | + "action": "assert_text", |
| 133 | + "expected": "Total: 6", |
| 134 | + "description": "验证清空搜索后统计栏仍显示6条(数据未丢失)" |
72 | 135 | } |
73 | 136 | ] |
74 | 137 | }, |
75 | 138 | { |
76 | | - "name": "标记完成", |
77 | | - "description": "先点击选中Buy milk列表项,再点Toggle Done标记完成,验证Done计数变为1", |
| 139 | + "name": "标记完成与Urgent更新", |
| 140 | + "description": "选中Buy milk并标记完成,验证Done计数+1且Urgent计数-1(Buy milk是High优先级)", |
78 | 141 | "steps": [ |
79 | 142 | { |
80 | 143 | "action": "click", |
81 | 144 | "target": "name:Buy milk", |
82 | | - "description": "点击列表区域中包含Buy milk文字的那一行,使其高亮选中" |
| 145 | + "description": "点击列表区域中包含Buy milk文字的那一行(显示为红色[H]标签),使其高亮选中" |
83 | 146 | }, |
84 | 147 | { |
85 | 148 | "action": "click", |
86 | 149 | "target": "name:Toggle Done", |
87 | | - "description": "点击列表下方左侧的绿色Toggle Done按钮" |
| 150 | + "description": "点击列表下方第一行左侧的绿色Toggle Done按钮,点击后Buy milk行文字变灰并显示✓标记,Done变为1,Urgent从3变为2" |
88 | 151 | }, |
89 | 152 | { |
90 | 153 | "action": "wait", |
91 | 154 | "value": "500", |
92 | 155 | "description": "等待状态刷新" |
93 | 156 | }, |
94 | | - { |
95 | | - "action": "screenshot", |
96 | | - "description": "Buy milk标记完成后的状态" |
97 | | - }, |
98 | 157 | { |
99 | 158 | "action": "assert_text", |
100 | 159 | "expected": "Done: 1", |
101 | 160 | "description": "验证底部统计栏已完成数变为1" |
| 161 | + }, |
| 162 | + { |
| 163 | + "action": "assert_text", |
| 164 | + "expected": "Urgent: 2", |
| 165 | + "description": "验证Urgent从3降为2(Buy milk是High优先级,完成后不计入Urgent)" |
| 166 | + }, |
| 167 | + { |
| 168 | + "action": "screenshot", |
| 169 | + "description": "Buy milk标记完成后,该行变灰带✓,Urgent降为2" |
102 | 170 | } |
103 | 171 | ] |
104 | 172 | }, |
105 | 173 | { |
106 | | - "name": "删除待办", |
107 | | - "description": "选中Read book后点Delete删除,验证总数减少", |
| 174 | + "name": "排序功能", |
| 175 | + "description": "使用排序下拉框按Priority排序,验证列表重新排序", |
108 | 176 | "steps": [ |
109 | 177 | { |
110 | 178 | "action": "click", |
111 | | - "target": "name:Read book", |
112 | | - "description": "点击列表区域中包含Read book文字的那一行,使其高亮选中" |
| 179 | + "target": "name:Sort: Default", |
| 180 | + "description": "点击搜索框右侧的排序下拉框(当前显示Sort: Default),点击后展开排序选项" |
| 181 | + }, |
| 182 | + { |
| 183 | + "action": "click", |
| 184 | + "target": "name:Sort: Priority", |
| 185 | + "description": "在展开的下拉列表中点击Sort: Priority选项,点击后列表重新排序:High在前,Medium居中,Low在后" |
| 186 | + }, |
| 187 | + { |
| 188 | + "action": "wait", |
| 189 | + "value": "500", |
| 190 | + "description": "等待排序完成" |
| 191 | + }, |
| 192 | + { |
| 193 | + "action": "screenshot", |
| 194 | + "description": "按优先级排序后的列表" |
| 195 | + } |
| 196 | + ] |
| 197 | + }, |
| 198 | + { |
| 199 | + "name": "删除待办(含确认弹窗)", |
| 200 | + "description": "选中Exercise后点Delete,弹出确认对话框,点Yes确认删除", |
| 201 | + "steps": [ |
| 202 | + { |
| 203 | + "action": "click", |
| 204 | + "target": "name:Exercise", |
| 205 | + "description": "点击列表区域中包含Exercise文字的那一行(绿色[L]标签),使其高亮选中" |
113 | 206 | }, |
114 | 207 | { |
115 | 208 | "action": "click", |
116 | 209 | "target": "name:Delete", |
117 | | - "description": "点击列表下方中间的红色Delete按钮" |
| 210 | + "description": "点击列表下方第一行右侧的红色Delete按钮,点击后弹出确认对话框询问是否删除" |
118 | 211 | }, |
119 | 212 | { |
120 | 213 | "action": "wait", |
121 | 214 | "value": "500", |
122 | | - "description": "等待列表刷新" |
| 215 | + "description": "等待确认弹窗出现" |
123 | 216 | }, |
124 | 217 | { |
125 | 218 | "action": "screenshot", |
126 | | - "description": "删除Read book后的列表" |
| 219 | + "description": "删除确认弹窗" |
| 220 | + }, |
| 221 | + { |
| 222 | + "action": "click", |
| 223 | + "target": "name:Yes", |
| 224 | + "description": "点击确认弹窗中的Yes按钮确认删除,弹窗关闭,Exercise从列表消失,Total从6变为5" |
| 225 | + }, |
| 226 | + { |
| 227 | + "action": "wait", |
| 228 | + "value": "500", |
| 229 | + "description": "等待列表刷新" |
127 | 230 | }, |
128 | 231 | { |
129 | 232 | "action": "assert_text", |
130 | | - "expected": "Total: 3", |
131 | | - "description": "验证底部统计栏总数从4变为3" |
| 233 | + "expected": "Total: 5", |
| 234 | + "description": "验证总数从6变为5(删除了Exercise)" |
132 | 235 | } |
133 | 236 | ] |
134 | 237 | }, |
135 | 238 | { |
136 | | - "name": "清空已完成", |
137 | | - "description": "点Clear Done清除所有已完成项(Buy milk),验证总数和Done计数", |
| 239 | + "name": "重复添加检测", |
| 240 | + "description": "尝试添加已存在的待办项,验证弹出重复警告", |
138 | 241 | "steps": [ |
| 242 | + { |
| 243 | + "action": "fill", |
| 244 | + "target": "name:输入待办事项...", |
| 245 | + "value": "Read book", |
| 246 | + "description": "在输入框中输入已存在的'Read book',准备测试重复检测" |
| 247 | + }, |
139 | 248 | { |
140 | 249 | "action": "click", |
141 | | - "target": "name:Clear Done", |
142 | | - "description": "点击列表下方右侧的灰色Clear Done按钮" |
| 250 | + "target": "name:Add", |
| 251 | + "description": "点击蓝色Add按钮,因为Read book已存在,会弹出警告'Duplicate item: Read book'" |
143 | 252 | }, |
144 | 253 | { |
145 | 254 | "action": "wait", |
146 | 255 | "value": "500", |
147 | | - "description": "等待列表刷新" |
| 256 | + "description": "等待重复警告弹窗出现" |
148 | 257 | }, |
149 | 258 | { |
150 | 259 | "action": "screenshot", |
151 | | - "description": "清空已完成项后的列表" |
| 260 | + "description": "重复添加时的警告弹窗" |
| 261 | + } |
| 262 | + ] |
| 263 | + }, |
| 264 | + { |
| 265 | + "name": "全选标记完成", |
| 266 | + "description": "点击Select All将所有待办标记为已完成,验证Done等于Total,Urgent变为0", |
| 267 | + "steps": [ |
| 268 | + { |
| 269 | + "action": "click", |
| 270 | + "target": "name:Select All", |
| 271 | + "description": "点击列表下方第二行右侧的蓝色Select All按钮,点击后所有项变为已完成(显示✓和灰色),Done等于Total,Urgent变为0" |
| 272 | + }, |
| 273 | + { |
| 274 | + "action": "wait", |
| 275 | + "value": "500", |
| 276 | + "description": "等待状态刷新" |
| 277 | + }, |
| 278 | + { |
| 279 | + "action": "assert_text", |
| 280 | + "expected": "Done: 5", |
| 281 | + "description": "验证Done数等于总数5(全部已完成)" |
152 | 282 | }, |
153 | 283 | { |
154 | 284 | "action": "assert_text", |
155 | | - "expected": "Total: 2", |
156 | | - "description": "验证底部统计栏总数从3变为2(清除了已完成的Buy milk)" |
| 285 | + "expected": "Urgent: 0", |
| 286 | + "description": "验证Urgent变为0(所有High优先级都已完成)" |
| 287 | + }, |
| 288 | + { |
| 289 | + "action": "screenshot", |
| 290 | + "description": "全选完成后,所有项显示✓,Done=5,Urgent=0" |
| 291 | + } |
| 292 | + ] |
| 293 | + }, |
| 294 | + { |
| 295 | + "name": "清空已完成项", |
| 296 | + "description": "点Clear Done清除全部已完成项,列表变空", |
| 297 | + "steps": [ |
| 298 | + { |
| 299 | + "action": "click", |
| 300 | + "target": "name:Clear Done", |
| 301 | + "description": "点击列表下方第二行左侧的灰色Clear Done按钮,点击后所有已完成项被移除,列表变空,Total变为0" |
| 302 | + }, |
| 303 | + { |
| 304 | + "action": "wait", |
| 305 | + "value": "500", |
| 306 | + "description": "等待列表刷新" |
157 | 307 | }, |
158 | 308 | { |
159 | 309 | "action": "assert_text", |
160 | | - "expected": "Done: 0", |
161 | | - "description": "验证底部统计栏已完成数回到0" |
| 310 | + "expected": "Total: 0", |
| 311 | + "description": "验证清空后总数为0" |
| 312 | + }, |
| 313 | + { |
| 314 | + "action": "screenshot", |
| 315 | + "description": "清空后的空列表状态" |
162 | 316 | } |
163 | 317 | ] |
164 | 318 | }, |
165 | 319 | { |
166 | 320 | "name": "空输入验证", |
167 | | - "description": "不输入任何内容直接点Add,验证弹出警告提示", |
| 321 | + "description": "列表为空时,不输入内容直接点Add,验证弹出警告", |
168 | 322 | "steps": [ |
169 | 323 | { |
170 | 324 | "action": "click", |
171 | 325 | "target": "name:Add", |
172 | | - "description": "不输入任何内容,直接点击输入框右侧的蓝色Add按钮" |
| 326 | + "description": "不输入任何内容,直接点击蓝色Add按钮,弹出警告'Please enter a todo item'" |
173 | 327 | }, |
174 | 328 | { |
175 | 329 | "action": "wait", |
|
0 commit comments