@testspectra/cli 1.1.8-rc.25 → 1.1.8-rc.29
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/__tests__/doctor-filter.test.js +37 -0
- package/dist/commands/__tests__/doctor-scope.test.js +24 -0
- package/dist/commands/__tests__/test-error-streaming.test.d.ts +1 -0
- package/dist/commands/__tests__/test-error-streaming.test.js +52 -0
- package/dist/commands/__tests__/test-scaffolding.test.d.ts +1 -0
- package/dist/commands/__tests__/test-scaffolding.test.js +32 -0
- package/dist/commands/__tests__/upgrade.test.d.ts +1 -0
- package/dist/commands/__tests__/upgrade.test.js +95 -0
- package/dist/commands/add.js +3 -3
- package/dist/commands/doctor.d.ts +9 -1
- package/dist/commands/doctor.js +16 -3
- package/dist/commands/install.js +3 -0
- package/dist/commands/test.d.ts +13 -0
- package/dist/commands/test.js +114 -22
- package/dist/commands/upgrade.d.ts +8 -1
- package/dist/commands/upgrade.js +55 -7
- package/dist/index.js +29 -14
- package/dist/linter/discovery.js +2 -2
- package/dist/linter/schemas/spec.schema.d.ts +6 -6
- package/dist/runner/bridge.d.ts +1 -1
- package/dist/runner/bridge.js +42 -14
- package/dist/runner/reporter.js +11 -3
- package/dist/utils/background-update-check.js +0 -7
- package/dist/utils/dependency-updates.d.ts +15 -0
- package/dist/utils/dependency-updates.js +107 -0
- package/package.json +7 -7
- package/templates/default/package.json +2 -2
- package/templates/nx/.nx/workspace-data/70094CFD-E89B-57A1-9619-2FC5F4963C54.db +0 -0
- package/templates/nx/.nx/workspace-data/d/daemon.log +1012 -1162
- package/templates/nx/.nx/workspace-data/file-map.json +107 -121
- package/templates/nx/.nx/workspace-data/lockfile.hash +1 -1
- package/templates/nx/.nx/workspace-data/nx_files.nxt +0 -0
- package/templates/nx/.nx/workspace-data/parsed-lock-file.json +6497 -1
- package/templates/nx/.nx/workspace-data/project-graph.json +7247 -2
- package/templates/nx/.nx/workspace-data/source-maps.json +336 -0
- package/templates/nx/package.json +2 -2
- package/templates/react-component/package.json +3 -3
- package/templates/react-component/page-objects/BadgeComponent/web.ts +4 -4
- package/templates/react-component/page-objects/ButtonComponent/web.ts +3 -3
- package/templates/react-component/page-objects/InputComponent/web.ts +1 -1
- package/templates/react-component/specs/ButtonComponent/TC-0001-button-rendering-and-click/web.test.tsx +0 -3
- package/templates/react-component/specs/ButtonComponent/TC-0004-disabled-button-not-clickable/web.test.tsx +0 -9
- package/templates/react-component/specs/ButtonComponent/TC-0005-button-renders-icon/web.test.tsx +1 -1
- package/templates/react-component/specs/InputComponent/TC-0003-input-typing-and-clear/web.test.tsx +4 -8
- package/templates/react-component/spectra.config.ts +0 -10
- package/templates/react-component/src/components/Badge/Badge.tsx +3 -3
- package/templates/react-component/src/components/Button/Button.tsx +5 -3
- package/templates/react-component/src/components/Input/Input.tsx +2 -3
- package/dist/.tsbuildinfo +0 -1
- package/dist/commands/__tests__/cloud-run.test.js +0 -93
- package/dist/commands/cloud-run.d.ts +0 -13
- package/dist/commands/cloud-run.js +0 -120
- package/dist/commands/update.d.ts +0 -3
- package/dist/commands/update.js +0 -109
- package/dist/lifecycle/__tests__/lifecycle-engine.test.js +0 -290
- package/dist/lifecycle/hook-discovery.d.ts +0 -24
- package/dist/lifecycle/hook-discovery.js +0 -60
- package/dist/lifecycle/hook-dispatcher.d.ts +0 -34
- package/dist/lifecycle/hook-dispatcher.js +0 -190
- package/dist/lifecycle/index.d.ts +0 -3
- package/dist/lifecycle/index.js +0 -3
- package/dist/lifecycle/parallel-grouping.d.ts +0 -27
- package/dist/lifecycle/parallel-grouping.js +0 -151
- package/templates/nx/.nx/workspace-data/70094CFD-E89B-57A1-9619-2FC5F4963C54.db-shm +0 -0
- package/templates/nx/.nx/workspace-data/70094CFD-E89B-57A1-9619-2FC5F4963C54.db-wal +0 -0
- package/templates/nx/.nx/workspace-data/d/server-process.json +0 -3
- /package/dist/commands/__tests__/{cloud-run.test.d.ts → doctor-filter.test.d.ts} +0 -0
- /package/dist/{lifecycle/__tests__/lifecycle-engine.test.d.ts → commands/__tests__/doctor-scope.test.d.ts} +0 -0
|
@@ -0,0 +1,336 @@
|
|
|
1
|
+
{
|
|
2
|
+
"packages/matchers/e2e": {
|
|
3
|
+
"root": [
|
|
4
|
+
"packages/matchers/e2e/project.json",
|
|
5
|
+
"nx/core/project-json"
|
|
6
|
+
],
|
|
7
|
+
"name": [
|
|
8
|
+
"packages/matchers/e2e/project.json",
|
|
9
|
+
"nx/core/project-json"
|
|
10
|
+
],
|
|
11
|
+
"$schema": [
|
|
12
|
+
"packages/matchers/e2e/project.json",
|
|
13
|
+
"nx/core/project-json"
|
|
14
|
+
],
|
|
15
|
+
"projectType": [
|
|
16
|
+
"packages/matchers/e2e/project.json",
|
|
17
|
+
"nx/core/project-json"
|
|
18
|
+
],
|
|
19
|
+
"sourceRoot": [
|
|
20
|
+
"packages/matchers/e2e/project.json",
|
|
21
|
+
"nx/core/project-json"
|
|
22
|
+
],
|
|
23
|
+
"tags": [
|
|
24
|
+
"packages/matchers/e2e/project.json",
|
|
25
|
+
"nx/core/project-json"
|
|
26
|
+
],
|
|
27
|
+
"tags.testspectra:e2e": [
|
|
28
|
+
"packages/matchers/e2e/project.json",
|
|
29
|
+
"nx/core/project-json"
|
|
30
|
+
],
|
|
31
|
+
"tags.testspectra:scope:matchers": [
|
|
32
|
+
"packages/matchers/e2e/project.json",
|
|
33
|
+
"nx/core/project-json"
|
|
34
|
+
],
|
|
35
|
+
"targets": [
|
|
36
|
+
"packages/matchers/e2e/project.json",
|
|
37
|
+
"nx/core/project-json"
|
|
38
|
+
],
|
|
39
|
+
"targets.e2e": [
|
|
40
|
+
"packages/matchers/e2e/project.json",
|
|
41
|
+
"nx/core/project-json"
|
|
42
|
+
],
|
|
43
|
+
"targets.e2e.executor": [
|
|
44
|
+
"packages/matchers/e2e/project.json",
|
|
45
|
+
"nx/core/project-json"
|
|
46
|
+
],
|
|
47
|
+
"targets.e2e.options": [
|
|
48
|
+
"packages/matchers/e2e/project.json",
|
|
49
|
+
"nx/core/project-json"
|
|
50
|
+
],
|
|
51
|
+
"targets.e2e.configurations": [
|
|
52
|
+
"packages/matchers/e2e/project.json",
|
|
53
|
+
"nx/core/project-json"
|
|
54
|
+
],
|
|
55
|
+
"targets.e2e.options.command": [
|
|
56
|
+
"packages/matchers/e2e/project.json",
|
|
57
|
+
"nx/core/project-json"
|
|
58
|
+
],
|
|
59
|
+
"targets.e2e.options.cwd": [
|
|
60
|
+
"packages/matchers/e2e/project.json",
|
|
61
|
+
"nx/core/project-json"
|
|
62
|
+
],
|
|
63
|
+
"targets.e2e.configurations.android": [
|
|
64
|
+
"packages/matchers/e2e/project.json",
|
|
65
|
+
"nx/core/project-json"
|
|
66
|
+
],
|
|
67
|
+
"targets.e2e.configurations.android.command": [
|
|
68
|
+
"packages/matchers/e2e/project.json",
|
|
69
|
+
"nx/core/project-json"
|
|
70
|
+
],
|
|
71
|
+
"targets.e2e.configurations.ios": [
|
|
72
|
+
"packages/matchers/e2e/project.json",
|
|
73
|
+
"nx/core/project-json"
|
|
74
|
+
],
|
|
75
|
+
"targets.e2e.configurations.ios.command": [
|
|
76
|
+
"packages/matchers/e2e/project.json",
|
|
77
|
+
"nx/core/project-json"
|
|
78
|
+
],
|
|
79
|
+
"targets.e2e.configurations.headless": [
|
|
80
|
+
"packages/matchers/e2e/project.json",
|
|
81
|
+
"nx/core/project-json"
|
|
82
|
+
],
|
|
83
|
+
"targets.e2e.configurations.headless.command": [
|
|
84
|
+
"packages/matchers/e2e/project.json",
|
|
85
|
+
"nx/core/project-json"
|
|
86
|
+
],
|
|
87
|
+
"targets.type-check": [
|
|
88
|
+
"packages/matchers/e2e/project.json",
|
|
89
|
+
"nx/core/project-json"
|
|
90
|
+
],
|
|
91
|
+
"targets.type-check.executor": [
|
|
92
|
+
"packages/matchers/e2e/project.json",
|
|
93
|
+
"nx/core/project-json"
|
|
94
|
+
],
|
|
95
|
+
"targets.type-check.options": [
|
|
96
|
+
"packages/matchers/e2e/project.json",
|
|
97
|
+
"nx/core/project-json"
|
|
98
|
+
],
|
|
99
|
+
"targets.type-check.options.command": [
|
|
100
|
+
"packages/matchers/e2e/project.json",
|
|
101
|
+
"nx/core/project-json"
|
|
102
|
+
],
|
|
103
|
+
"targets.type-check.options.cwd": [
|
|
104
|
+
"packages/matchers/e2e/project.json",
|
|
105
|
+
"nx/core/project-json"
|
|
106
|
+
],
|
|
107
|
+
"targets.e2e.cache": [
|
|
108
|
+
"nx.json",
|
|
109
|
+
"nx/target-defaults"
|
|
110
|
+
],
|
|
111
|
+
"targets.e2e.inputs": [
|
|
112
|
+
"nx.json",
|
|
113
|
+
"nx/target-defaults"
|
|
114
|
+
],
|
|
115
|
+
"targets.e2e.dependsOn": [
|
|
116
|
+
"nx.json",
|
|
117
|
+
"nx/target-defaults"
|
|
118
|
+
],
|
|
119
|
+
"targets.e2e.parallelism": [
|
|
120
|
+
"nx.json",
|
|
121
|
+
"nx/target-defaults"
|
|
122
|
+
],
|
|
123
|
+
"targets.type-check.cache": [
|
|
124
|
+
"nx.json",
|
|
125
|
+
"nx/target-defaults"
|
|
126
|
+
],
|
|
127
|
+
"targets.type-check.inputs": [
|
|
128
|
+
"nx.json",
|
|
129
|
+
"nx/target-defaults"
|
|
130
|
+
],
|
|
131
|
+
"targets.type-check.parallelism": [
|
|
132
|
+
"nx.json",
|
|
133
|
+
"nx/target-defaults"
|
|
134
|
+
]
|
|
135
|
+
},
|
|
136
|
+
"packages/playground/e2e": {
|
|
137
|
+
"root": [
|
|
138
|
+
"packages/playground/e2e/project.json",
|
|
139
|
+
"nx/core/project-json"
|
|
140
|
+
],
|
|
141
|
+
"name": [
|
|
142
|
+
"packages/playground/e2e/project.json",
|
|
143
|
+
"nx/core/project-json"
|
|
144
|
+
],
|
|
145
|
+
"$schema": [
|
|
146
|
+
"packages/playground/e2e/project.json",
|
|
147
|
+
"nx/core/project-json"
|
|
148
|
+
],
|
|
149
|
+
"projectType": [
|
|
150
|
+
"packages/playground/e2e/project.json",
|
|
151
|
+
"nx/core/project-json"
|
|
152
|
+
],
|
|
153
|
+
"sourceRoot": [
|
|
154
|
+
"packages/playground/e2e/project.json",
|
|
155
|
+
"nx/core/project-json"
|
|
156
|
+
],
|
|
157
|
+
"tags": [
|
|
158
|
+
"packages/playground/e2e/project.json",
|
|
159
|
+
"nx/core/project-json"
|
|
160
|
+
],
|
|
161
|
+
"tags.testspectra:e2e": [
|
|
162
|
+
"packages/playground/e2e/project.json",
|
|
163
|
+
"nx/core/project-json"
|
|
164
|
+
],
|
|
165
|
+
"tags.testspectra:scope:playground": [
|
|
166
|
+
"packages/playground/e2e/project.json",
|
|
167
|
+
"nx/core/project-json"
|
|
168
|
+
],
|
|
169
|
+
"targets": [
|
|
170
|
+
"packages/playground/e2e/project.json",
|
|
171
|
+
"nx/core/project-json"
|
|
172
|
+
],
|
|
173
|
+
"targets.e2e": [
|
|
174
|
+
"packages/playground/e2e/project.json",
|
|
175
|
+
"nx/core/project-json"
|
|
176
|
+
],
|
|
177
|
+
"targets.e2e.executor": [
|
|
178
|
+
"packages/playground/e2e/project.json",
|
|
179
|
+
"nx/core/project-json"
|
|
180
|
+
],
|
|
181
|
+
"targets.e2e.options": [
|
|
182
|
+
"packages/playground/e2e/project.json",
|
|
183
|
+
"nx/core/project-json"
|
|
184
|
+
],
|
|
185
|
+
"targets.e2e.configurations": [
|
|
186
|
+
"packages/playground/e2e/project.json",
|
|
187
|
+
"nx/core/project-json"
|
|
188
|
+
],
|
|
189
|
+
"targets.e2e.options.command": [
|
|
190
|
+
"packages/playground/e2e/project.json",
|
|
191
|
+
"nx/core/project-json"
|
|
192
|
+
],
|
|
193
|
+
"targets.e2e.options.cwd": [
|
|
194
|
+
"packages/playground/e2e/project.json",
|
|
195
|
+
"nx/core/project-json"
|
|
196
|
+
],
|
|
197
|
+
"targets.e2e.configurations.android": [
|
|
198
|
+
"packages/playground/e2e/project.json",
|
|
199
|
+
"nx/core/project-json"
|
|
200
|
+
],
|
|
201
|
+
"targets.e2e.configurations.android.command": [
|
|
202
|
+
"packages/playground/e2e/project.json",
|
|
203
|
+
"nx/core/project-json"
|
|
204
|
+
],
|
|
205
|
+
"targets.e2e.configurations.ios": [
|
|
206
|
+
"packages/playground/e2e/project.json",
|
|
207
|
+
"nx/core/project-json"
|
|
208
|
+
],
|
|
209
|
+
"targets.e2e.configurations.ios.command": [
|
|
210
|
+
"packages/playground/e2e/project.json",
|
|
211
|
+
"nx/core/project-json"
|
|
212
|
+
],
|
|
213
|
+
"targets.e2e.configurations.headless": [
|
|
214
|
+
"packages/playground/e2e/project.json",
|
|
215
|
+
"nx/core/project-json"
|
|
216
|
+
],
|
|
217
|
+
"targets.e2e.configurations.headless.command": [
|
|
218
|
+
"packages/playground/e2e/project.json",
|
|
219
|
+
"nx/core/project-json"
|
|
220
|
+
],
|
|
221
|
+
"targets.type-check": [
|
|
222
|
+
"packages/playground/e2e/project.json",
|
|
223
|
+
"nx/core/project-json"
|
|
224
|
+
],
|
|
225
|
+
"targets.type-check.executor": [
|
|
226
|
+
"packages/playground/e2e/project.json",
|
|
227
|
+
"nx/core/project-json"
|
|
228
|
+
],
|
|
229
|
+
"targets.type-check.options": [
|
|
230
|
+
"packages/playground/e2e/project.json",
|
|
231
|
+
"nx/core/project-json"
|
|
232
|
+
],
|
|
233
|
+
"targets.type-check.options.command": [
|
|
234
|
+
"packages/playground/e2e/project.json",
|
|
235
|
+
"nx/core/project-json"
|
|
236
|
+
],
|
|
237
|
+
"targets.type-check.options.cwd": [
|
|
238
|
+
"packages/playground/e2e/project.json",
|
|
239
|
+
"nx/core/project-json"
|
|
240
|
+
],
|
|
241
|
+
"targets.e2e.cache": [
|
|
242
|
+
"nx.json",
|
|
243
|
+
"nx/target-defaults"
|
|
244
|
+
],
|
|
245
|
+
"targets.e2e.inputs": [
|
|
246
|
+
"nx.json",
|
|
247
|
+
"nx/target-defaults"
|
|
248
|
+
],
|
|
249
|
+
"targets.e2e.dependsOn": [
|
|
250
|
+
"nx.json",
|
|
251
|
+
"nx/target-defaults"
|
|
252
|
+
],
|
|
253
|
+
"targets.e2e.parallelism": [
|
|
254
|
+
"nx.json",
|
|
255
|
+
"nx/target-defaults"
|
|
256
|
+
],
|
|
257
|
+
"targets.type-check.cache": [
|
|
258
|
+
"nx.json",
|
|
259
|
+
"nx/target-defaults"
|
|
260
|
+
],
|
|
261
|
+
"targets.type-check.inputs": [
|
|
262
|
+
"nx.json",
|
|
263
|
+
"nx/target-defaults"
|
|
264
|
+
],
|
|
265
|
+
"targets.type-check.parallelism": [
|
|
266
|
+
"nx.json",
|
|
267
|
+
"nx/target-defaults"
|
|
268
|
+
]
|
|
269
|
+
},
|
|
270
|
+
"shared/testing": {
|
|
271
|
+
"root": [
|
|
272
|
+
"shared/testing/project.json",
|
|
273
|
+
"nx/core/project-json"
|
|
274
|
+
],
|
|
275
|
+
"name": [
|
|
276
|
+
"shared/testing/project.json",
|
|
277
|
+
"nx/core/project-json"
|
|
278
|
+
],
|
|
279
|
+
"$schema": [
|
|
280
|
+
"shared/testing/project.json",
|
|
281
|
+
"nx/core/project-json"
|
|
282
|
+
],
|
|
283
|
+
"projectType": [
|
|
284
|
+
"shared/testing/project.json",
|
|
285
|
+
"nx/core/project-json"
|
|
286
|
+
],
|
|
287
|
+
"sourceRoot": [
|
|
288
|
+
"shared/testing/project.json",
|
|
289
|
+
"nx/core/project-json"
|
|
290
|
+
],
|
|
291
|
+
"tags": [
|
|
292
|
+
"shared/testing/project.json",
|
|
293
|
+
"nx/core/project-json"
|
|
294
|
+
],
|
|
295
|
+
"tags.testspectra:shared": [
|
|
296
|
+
"shared/testing/project.json",
|
|
297
|
+
"nx/core/project-json"
|
|
298
|
+
],
|
|
299
|
+
"targets": [
|
|
300
|
+
"shared/testing/project.json",
|
|
301
|
+
"nx/core/project-json"
|
|
302
|
+
],
|
|
303
|
+
"targets.type-check": [
|
|
304
|
+
"shared/testing/project.json",
|
|
305
|
+
"nx/core/project-json"
|
|
306
|
+
],
|
|
307
|
+
"targets.type-check.executor": [
|
|
308
|
+
"shared/testing/project.json",
|
|
309
|
+
"nx/core/project-json"
|
|
310
|
+
],
|
|
311
|
+
"targets.type-check.options": [
|
|
312
|
+
"shared/testing/project.json",
|
|
313
|
+
"nx/core/project-json"
|
|
314
|
+
],
|
|
315
|
+
"targets.type-check.options.command": [
|
|
316
|
+
"shared/testing/project.json",
|
|
317
|
+
"nx/core/project-json"
|
|
318
|
+
],
|
|
319
|
+
"targets.type-check.options.cwd": [
|
|
320
|
+
"shared/testing/project.json",
|
|
321
|
+
"nx/core/project-json"
|
|
322
|
+
],
|
|
323
|
+
"targets.type-check.cache": [
|
|
324
|
+
"nx.json",
|
|
325
|
+
"nx/target-defaults"
|
|
326
|
+
],
|
|
327
|
+
"targets.type-check.inputs": [
|
|
328
|
+
"nx.json",
|
|
329
|
+
"nx/target-defaults"
|
|
330
|
+
],
|
|
331
|
+
"targets.type-check.parallelism": [
|
|
332
|
+
"nx.json",
|
|
333
|
+
"nx/target-defaults"
|
|
334
|
+
]
|
|
335
|
+
}
|
|
336
|
+
}
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
"postinstall": "spectra sync-types"
|
|
13
13
|
},
|
|
14
14
|
"devDependencies": {
|
|
15
|
-
"@testspectra/cli": "^1.1.8-rc.
|
|
16
|
-
"@testspectra/matchers": "^1.1.8-rc.
|
|
15
|
+
"@testspectra/cli": "^1.1.8-rc.29",
|
|
16
|
+
"@testspectra/matchers": "^1.1.8-rc.29",
|
|
17
17
|
"@types/node": "^20.14.0",
|
|
18
18
|
"@wdio/cli": "^9.2.8",
|
|
19
19
|
"@wdio/local-runner": "^9.2.8",
|
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
"postinstall": "spectra sync-types"
|
|
15
15
|
},
|
|
16
16
|
"devDependencies": {
|
|
17
|
-
"@testspectra/cli": "^1.1.8-rc.
|
|
18
|
-
"@testspectra/matchers": "^1.1.8-rc.
|
|
19
|
-
"@testspectra/react": "^1.1.8-rc.
|
|
17
|
+
"@testspectra/cli": "^1.1.8-rc.29",
|
|
18
|
+
"@testspectra/matchers": "^1.1.8-rc.29",
|
|
19
|
+
"@testspectra/react": "^1.1.8-rc.29",
|
|
20
20
|
"@types/node": "^20.14.0",
|
|
21
21
|
"@types/react": "^18.3.3",
|
|
22
22
|
"@types/react-dom": "^18.3.0",
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
class BadgeComponent {
|
|
2
2
|
/** Root badge element */
|
|
3
3
|
get root() {
|
|
4
|
-
return Spectra.get(
|
|
4
|
+
return Spectra.get('~badge');
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
/** Dot indicator element */
|
|
8
8
|
get dot() {
|
|
9
|
-
return Spectra.get(
|
|
9
|
+
return Spectra.get('~badge-dot');
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
/** Badge label text element */
|
|
13
13
|
get label() {
|
|
14
|
-
return Spectra.get(
|
|
14
|
+
return Spectra.get('~badge-label');
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
/** Lookup badge by severity attribute */
|
|
18
18
|
bySeverity(severity: 'info' | 'success' | 'warning' | 'danger') {
|
|
19
|
-
return Spectra.get(
|
|
19
|
+
return Spectra.get(`~badge[data-severity='${severity}']`);
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
class ButtonComponent {
|
|
2
2
|
/** Root button element */
|
|
3
3
|
get root() {
|
|
4
|
-
return Spectra.get(
|
|
4
|
+
return Spectra.get('~button');
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
/** Label element inside button */
|
|
8
8
|
get label() {
|
|
9
|
-
return Spectra.get(
|
|
9
|
+
return Spectra.get('~button-label');
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
/** Optional icon element */
|
|
13
13
|
get icon() {
|
|
14
|
-
return Spectra.get(
|
|
14
|
+
return Spectra.get('~button-icon');
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
/** Lookup button element by visible text */
|
|
@@ -22,7 +22,4 @@ it('Verify button render, text, and click with Spectra DSL', async () => {
|
|
|
22
22
|
await ButtonComponent.root.shouldHaveText('Save Changes');
|
|
23
23
|
await ButtonComponent.root.shouldHaveAttribute('data-variant', 'primary');
|
|
24
24
|
await ButtonComponent.root.click();
|
|
25
|
-
|
|
26
|
-
// Verify callback state
|
|
27
|
-
expect(isClicked).toBe(true);
|
|
28
25
|
});
|
|
@@ -1,22 +1,13 @@
|
|
|
1
1
|
import { Button } from '../../../src/components/Button/Button.js';
|
|
2
2
|
|
|
3
3
|
it('Verify disabled button cannot be clicked', async () => {
|
|
4
|
-
let isClicked = false;
|
|
5
|
-
|
|
6
4
|
await Spectra.mount(
|
|
7
5
|
<Button
|
|
8
6
|
label="Disabled Action"
|
|
9
7
|
disabled
|
|
10
|
-
onClick={() => {
|
|
11
|
-
isClicked = true;
|
|
12
|
-
}}
|
|
13
8
|
/>,
|
|
14
9
|
);
|
|
15
10
|
|
|
16
11
|
await ButtonComponent.root.shouldBeVisible();
|
|
17
12
|
await ButtonComponent.root.shouldBeDisabled();
|
|
18
|
-
|
|
19
|
-
// Attempt click - should not fire callback
|
|
20
|
-
await ButtonComponent.root.click().catch(() => {});
|
|
21
|
-
expect(isClicked).toBe(false);
|
|
22
13
|
});
|
package/templates/react-component/specs/ButtonComponent/TC-0005-button-renders-icon/web.test.tsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Button } from '../../../src/components/Button/Button.js';
|
|
2
2
|
|
|
3
3
|
it('Verify button renders optional icon', async () => {
|
|
4
|
-
await Spectra.mount(<Button label="Download Report" icon={<span
|
|
4
|
+
await Spectra.mount(<Button label="Download Report" icon={<span aria-label="button-icon">📥</span>} />);
|
|
5
5
|
|
|
6
6
|
await ButtonComponent.icon.shouldBeVisible();
|
|
7
7
|
await ButtonComponent.icon.shouldHaveText('📥');
|
package/templates/react-component/specs/InputComponent/TC-0003-input-typing-and-clear/web.test.tsx
CHANGED
|
@@ -2,15 +2,10 @@ import { Input } from '../../../src/components/Input/Input.js';
|
|
|
2
2
|
import { withProviders } from '../../../src/test-utils.js';
|
|
3
3
|
|
|
4
4
|
it('Verify input placeholder and typing interaction', async () => {
|
|
5
|
-
let currentVal = '';
|
|
6
|
-
|
|
7
5
|
await Spectra.mount(
|
|
8
6
|
withProviders(
|
|
9
7
|
<Input
|
|
10
8
|
placeholder="Enter email address"
|
|
11
|
-
onChange={(e) => {
|
|
12
|
-
currentVal = e.target.value;
|
|
13
|
-
}}
|
|
14
9
|
/>,
|
|
15
10
|
),
|
|
16
11
|
);
|
|
@@ -19,10 +14,11 @@ it('Verify input placeholder and typing interaction', async () => {
|
|
|
19
14
|
await InputComponent.root.shouldBeVisible();
|
|
20
15
|
await InputComponent.byPlaceholder('email address').shouldBeVisible();
|
|
21
16
|
|
|
22
|
-
// 2. Type text using Spectra DSL
|
|
17
|
+
// 2. Type text using Spectra DSL and verify value
|
|
23
18
|
await InputComponent.root.type('test@example.com');
|
|
24
19
|
await InputComponent.root.shouldHaveValue('test@example.com');
|
|
25
20
|
|
|
26
|
-
// 3.
|
|
27
|
-
|
|
21
|
+
// 3. Clear text using Spectra DSL and verify cleared state
|
|
22
|
+
await InputComponent.root.clear();
|
|
23
|
+
await InputComponent.root.shouldHaveValue('');
|
|
28
24
|
});
|
|
@@ -6,22 +6,12 @@ export default defineConfig({
|
|
|
6
6
|
maxConcurrentSessions: "4",
|
|
7
7
|
headless: true,
|
|
8
8
|
implicitWait: "5000",
|
|
9
|
-
pageLoadTimeout: "30000",
|
|
10
|
-
scriptTimeout: "30000",
|
|
11
9
|
parallelizationMode: "testcase",
|
|
12
10
|
},
|
|
13
|
-
browsers: [
|
|
14
|
-
{
|
|
15
|
-
id: "chrome-desktop",
|
|
16
|
-
type: "chrome",
|
|
17
|
-
mobileEmulation: false,
|
|
18
|
-
},
|
|
19
|
-
],
|
|
20
11
|
executionConfig: {
|
|
21
12
|
networkMonitoringEnabled: true,
|
|
22
13
|
fastResponseTime: "200",
|
|
23
14
|
normalResponseTime: "1000",
|
|
24
15
|
monitoredDomains: [],
|
|
25
|
-
environmentVariables: [],
|
|
26
16
|
},
|
|
27
17
|
});
|
|
@@ -29,7 +29,7 @@ export const Badge: React.FC<BadgeProps> = ({
|
|
|
29
29
|
|
|
30
30
|
return (
|
|
31
31
|
<span
|
|
32
|
-
|
|
32
|
+
aria-label="badge"
|
|
33
33
|
data-severity={severity}
|
|
34
34
|
style={{
|
|
35
35
|
display: 'inline-flex',
|
|
@@ -45,7 +45,7 @@ export const Badge: React.FC<BadgeProps> = ({
|
|
|
45
45
|
>
|
|
46
46
|
{dot && (
|
|
47
47
|
<span
|
|
48
|
-
|
|
48
|
+
aria-label="badge-dot"
|
|
49
49
|
style={{
|
|
50
50
|
width: '6px',
|
|
51
51
|
height: '6px',
|
|
@@ -54,7 +54,7 @@ export const Badge: React.FC<BadgeProps> = ({
|
|
|
54
54
|
}}
|
|
55
55
|
/>
|
|
56
56
|
)}
|
|
57
|
-
<span
|
|
57
|
+
<span aria-label="badge-label">{label}</span>
|
|
58
58
|
</span>
|
|
59
59
|
);
|
|
60
60
|
};
|
|
@@ -6,6 +6,7 @@ export interface ButtonProps {
|
|
|
6
6
|
disabled?: boolean;
|
|
7
7
|
onClick?: () => void;
|
|
8
8
|
icon?: React.ReactNode;
|
|
9
|
+
ariaLabel?: string;
|
|
9
10
|
}
|
|
10
11
|
|
|
11
12
|
export const Button: React.FC<ButtonProps> = ({
|
|
@@ -14,6 +15,7 @@ export const Button: React.FC<ButtonProps> = ({
|
|
|
14
15
|
disabled = false,
|
|
15
16
|
onClick,
|
|
16
17
|
icon,
|
|
18
|
+
ariaLabel,
|
|
17
19
|
}) => {
|
|
18
20
|
const getBackgroundColor = () => {
|
|
19
21
|
if (disabled) return '#9ca3af';
|
|
@@ -31,7 +33,7 @@ export const Button: React.FC<ButtonProps> = ({
|
|
|
31
33
|
return (
|
|
32
34
|
<button
|
|
33
35
|
type="button"
|
|
34
|
-
|
|
36
|
+
aria-label={ariaLabel || 'button'}
|
|
35
37
|
data-variant={variant}
|
|
36
38
|
disabled={disabled}
|
|
37
39
|
onClick={onClick}
|
|
@@ -50,8 +52,8 @@ export const Button: React.FC<ButtonProps> = ({
|
|
|
50
52
|
transition: 'background-color 0.2s ease',
|
|
51
53
|
}}
|
|
52
54
|
>
|
|
53
|
-
{icon && <span
|
|
54
|
-
<span>{label}</span>
|
|
55
|
+
{icon && <span aria-label="button-icon">{icon}</span>}
|
|
56
|
+
<span aria-label="button-label">{label}</span>
|
|
55
57
|
</button>
|
|
56
58
|
);
|
|
57
59
|
};
|
|
@@ -15,18 +15,17 @@ export const Input: React.FC<InputProps> = ({
|
|
|
15
15
|
defaultValue,
|
|
16
16
|
disabled = false,
|
|
17
17
|
onChange,
|
|
18
|
-
ariaLabel,
|
|
18
|
+
ariaLabel = 'input',
|
|
19
19
|
}) => {
|
|
20
20
|
return (
|
|
21
21
|
<input
|
|
22
22
|
type="text"
|
|
23
|
-
|
|
23
|
+
aria-label={ariaLabel}
|
|
24
24
|
placeholder={placeholder}
|
|
25
25
|
value={value}
|
|
26
26
|
defaultValue={defaultValue}
|
|
27
27
|
disabled={disabled}
|
|
28
28
|
onChange={onChange}
|
|
29
|
-
aria-label={ariaLabel}
|
|
30
29
|
style={{
|
|
31
30
|
padding: '8px 12px',
|
|
32
31
|
borderRadius: '6px',
|