@simpright/portal 0.0.0-stage → 0.1.0
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/LICENSE +21 -0
- package/README.md +48 -2
- package/dist/bugs.d.ts +3 -0
- package/dist/bugs.js +112 -0
- package/dist/build-pages.d.ts +3 -0
- package/dist/build-pages.js +28 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +145 -0
- package/dist/preview.d.ts +13 -0
- package/dist/preview.js +85 -0
- package/dist/publish-run.d.ts +19 -0
- package/dist/publish-run.js +78 -0
- package/dist/run-summaries.d.ts +8 -0
- package/dist/run-summaries.js +91 -0
- package/dist/site.d.ts +34 -0
- package/dist/site.js +63 -0
- package/dist/test-cases.d.ts +3 -0
- package/dist/test-cases.js +155 -0
- package/package.json +44 -4
- package/pages/bugs.html +1240 -0
- package/pages/dashboard.html +1230 -0
- package/pages/test-cases.html +1287 -0
- package/sample/.nojekyll +0 -0
- package/sample/api-regression/run-1/index.html +10 -0
- package/sample/api-regression/run-1/run-summary.json +1 -0
- package/sample/api-regression/run-10/index.html +10 -0
- package/sample/api-regression/run-10/run-summary.json +1 -0
- package/sample/api-regression/run-2/index.html +10 -0
- package/sample/api-regression/run-2/run-summary.json +1 -0
- package/sample/api-regression/run-3/index.html +10 -0
- package/sample/api-regression/run-3/run-summary.json +1 -0
- package/sample/api-regression/run-4/index.html +10 -0
- package/sample/api-regression/run-4/run-summary.json +1 -0
- package/sample/api-regression/run-5/index.html +10 -0
- package/sample/api-regression/run-5/run-summary.json +1 -0
- package/sample/api-regression/run-6/index.html +10 -0
- package/sample/api-regression/run-6/run-summary.json +1 -0
- package/sample/api-regression/run-7/index.html +10 -0
- package/sample/api-regression/run-7/run-summary.json +1 -0
- package/sample/api-regression/run-8/index.html +10 -0
- package/sample/api-regression/run-8/run-summary.json +1 -0
- package/sample/api-regression/run-9/index.html +10 -0
- package/sample/api-regression/run-9/run-summary.json +1 -0
- package/sample/api-regression-history.json +1 -0
- package/sample/api-regression-manifest.json +12 -0
- package/sample/bugs/bugs-data.js +130 -0
- package/sample/custom-ui/run-1/index.html +10 -0
- package/sample/custom-ui/run-1/run-summary.json +1 -0
- package/sample/custom-ui/run-2/index.html +10 -0
- package/sample/custom-ui/run-2/run-summary.json +1 -0
- package/sample/custom-ui-history.json +1 -0
- package/sample/custom-ui-manifest.json +4 -0
- package/sample/latest/api-regression/index.html +10 -0
- package/sample/latest/api-regression/run-summary.json +1 -0
- package/sample/latest/custom-ui/index.html +10 -0
- package/sample/latest/custom-ui/run-summary.json +1 -0
- package/sample/latest/smoke/index.html +10 -0
- package/sample/latest/smoke/run-summary.json +1 -0
- package/sample/latest/ui-regression/index.html +10 -0
- package/sample/latest/ui-regression/run-summary.json +1 -0
- package/sample/portal.json +37 -0
- package/sample/site.json +3 -0
- package/sample/smoke/run-1/index.html +10 -0
- package/sample/smoke/run-1/run-summary.json +1 -0
- package/sample/smoke/run-2/index.html +10 -0
- package/sample/smoke/run-2/run-summary.json +1 -0
- package/sample/smoke/run-3/index.html +10 -0
- package/sample/smoke/run-3/run-summary.json +1 -0
- package/sample/smoke/run-4/index.html +10 -0
- package/sample/smoke/run-4/run-summary.json +1 -0
- package/sample/smoke-history.json +1 -0
- package/sample/smoke-manifest.json +6 -0
- package/sample/test-cases/api/scenarios-data.js +169 -0
- package/sample/test-cases/ui/scenarios-data.js +191 -0
- package/sample/ui-regression/run-1/index.html +10 -0
- package/sample/ui-regression/run-1/run-summary.json +1 -0
- package/sample/ui-regression/run-10/index.html +10 -0
- package/sample/ui-regression/run-10/run-summary.json +1 -0
- package/sample/ui-regression/run-2/index.html +10 -0
- package/sample/ui-regression/run-2/run-summary.json +1 -0
- package/sample/ui-regression/run-3/index.html +10 -0
- package/sample/ui-regression/run-3/run-summary.json +1 -0
- package/sample/ui-regression/run-4/index.html +10 -0
- package/sample/ui-regression/run-4/run-summary.json +1 -0
- package/sample/ui-regression/run-5/index.html +10 -0
- package/sample/ui-regression/run-5/run-summary.json +1 -0
- package/sample/ui-regression/run-6/index.html +10 -0
- package/sample/ui-regression/run-6/run-summary.json +1 -0
- package/sample/ui-regression/run-7/index.html +10 -0
- package/sample/ui-regression/run-7/run-summary.json +1 -0
- package/sample/ui-regression/run-8/index.html +10 -0
- package/sample/ui-regression/run-8/run-summary.json +1 -0
- package/sample/ui-regression/run-9/index.html +10 -0
- package/sample/ui-regression/run-9/run-summary.json +1 -0
- package/sample/ui-regression-history.json +1 -0
- package/sample/ui-regression-manifest.json +12 -0
|
@@ -0,0 +1,1287 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
+
<!-- One page for every scenario layer: simpright-portal build-test-cases copies it to test-cases/<layer>/
|
|
7
|
+
next to that layer's scenarios-data.js (window.SCENARIO_CATALOG). -->
|
|
8
|
+
<title>Test Cases</title>
|
|
9
|
+
<!-- The portal's icon (the README banner's logo), inline like on the dashboard. -->
|
|
10
|
+
<link rel="icon" href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 44 44'%3E%3Crect width='44' height='44' rx='10' fill='%233fb950'/%3E%3Cpath d='M11 23l8 8l15-17' fill='none' stroke='%23fff' stroke-width='6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E">
|
|
11
|
+
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
12
|
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
13
|
+
<link href="https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap" rel="stylesheet">
|
|
14
|
+
<style>
|
|
15
|
+
/* The portal's palette (index.html), from the README banner: GitHub's dark greys and greens. */
|
|
16
|
+
:root {
|
|
17
|
+
--bg: #0d1117;
|
|
18
|
+
--bg-end: #0e1813;
|
|
19
|
+
--inset: #010409;
|
|
20
|
+
--surface: #161b22;
|
|
21
|
+
--surface-2: #21262d;
|
|
22
|
+
--line: #30363d;
|
|
23
|
+
--line-soft: #21262d;
|
|
24
|
+
--line-bright: #8b949e;
|
|
25
|
+
--text: #e6edf3;
|
|
26
|
+
--text-strong: #f0f6fc;
|
|
27
|
+
--muted: #9198a1;
|
|
28
|
+
--green: #3fb950;
|
|
29
|
+
--green-hover: #56d364;
|
|
30
|
+
--green-bg: rgba(63, 185, 80, 0.12);
|
|
31
|
+
--green-line: rgba(63, 185, 80, 0.4);
|
|
32
|
+
--red: #f85149;
|
|
33
|
+
--red-text: #ffa198;
|
|
34
|
+
--red-bg: rgba(248, 81, 73, 0.1);
|
|
35
|
+
--red-line: rgba(248, 81, 73, 0.4);
|
|
36
|
+
--amber: #d29922;
|
|
37
|
+
--amber-text: #e3b341;
|
|
38
|
+
--amber-bg: rgba(210, 153, 34, 0.12);
|
|
39
|
+
--amber-line: rgba(210, 153, 34, 0.4);
|
|
40
|
+
--blue: #58a6ff;
|
|
41
|
+
--blue-text: #79c0ff;
|
|
42
|
+
--blue-bg: rgba(88, 166, 255, 0.1);
|
|
43
|
+
--blue-line: rgba(88, 166, 255, 0.35);
|
|
44
|
+
--mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Consolas, monospace;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
* { box-sizing: border-box; }
|
|
48
|
+
|
|
49
|
+
[hidden] { display: none !important; }
|
|
50
|
+
|
|
51
|
+
body {
|
|
52
|
+
margin: 0;
|
|
53
|
+
font-family: 'IBM Plex Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
|
|
54
|
+
background-color: var(--bg);
|
|
55
|
+
background-image: linear-gradient(180deg, var(--bg) 0%, var(--bg-end) 100%);
|
|
56
|
+
color: var(--text);
|
|
57
|
+
min-height: 100vh;
|
|
58
|
+
overflow-x: hidden;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
a { color: var(--green); text-decoration: none; }
|
|
62
|
+
a:hover { color: var(--green-hover); }
|
|
63
|
+
button { font-family: inherit; }
|
|
64
|
+
|
|
65
|
+
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
|
|
66
|
+
|
|
67
|
+
/* Layout */
|
|
68
|
+
.app-layout {
|
|
69
|
+
display: grid;
|
|
70
|
+
grid-template-columns: 420px minmax(0, 1fr);
|
|
71
|
+
height: 100vh;
|
|
72
|
+
overflow: hidden;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/* Sidebar: header, filters, tree */
|
|
76
|
+
.sidebar-pane {
|
|
77
|
+
display: flex;
|
|
78
|
+
flex-direction: column;
|
|
79
|
+
height: 100vh;
|
|
80
|
+
min-width: 0;
|
|
81
|
+
background: rgba(13, 17, 23, 0.85);
|
|
82
|
+
border-right: 1px solid var(--line-soft);
|
|
83
|
+
overflow: hidden;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.sidebar-header {
|
|
87
|
+
padding: 24px 20px 18px;
|
|
88
|
+
border-bottom: 1px solid var(--line-soft);
|
|
89
|
+
flex-shrink: 0;
|
|
90
|
+
display: flex;
|
|
91
|
+
flex-direction: column;
|
|
92
|
+
gap: 16px;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/* The portal's logo, linking back to it. */
|
|
96
|
+
.brand {
|
|
97
|
+
display: flex;
|
|
98
|
+
align-items: center;
|
|
99
|
+
gap: 12px;
|
|
100
|
+
align-self: flex-start;
|
|
101
|
+
}
|
|
102
|
+
.brand svg { flex: none; }
|
|
103
|
+
.brand-name {
|
|
104
|
+
display: block;
|
|
105
|
+
font-size: 20px;
|
|
106
|
+
font-weight: 700;
|
|
107
|
+
line-height: 1.1;
|
|
108
|
+
letter-spacing: -0.01em;
|
|
109
|
+
color: var(--text-strong);
|
|
110
|
+
}
|
|
111
|
+
.brand-name span { color: var(--green); }
|
|
112
|
+
.brand-sub {
|
|
113
|
+
display: block;
|
|
114
|
+
margin-top: 4px;
|
|
115
|
+
font-size: 12px;
|
|
116
|
+
line-height: 1.1;
|
|
117
|
+
color: var(--muted);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.page-head { display: flex; flex-direction: column; gap: 4px; }
|
|
121
|
+
|
|
122
|
+
.back-link {
|
|
123
|
+
display: inline-flex;
|
|
124
|
+
align-items: center;
|
|
125
|
+
gap: 6px;
|
|
126
|
+
align-self: flex-start;
|
|
127
|
+
font-size: 13px;
|
|
128
|
+
font-weight: 500;
|
|
129
|
+
color: var(--muted);
|
|
130
|
+
}
|
|
131
|
+
.back-link:hover { color: var(--text); }
|
|
132
|
+
|
|
133
|
+
.brand-title {
|
|
134
|
+
display: flex;
|
|
135
|
+
align-items: center;
|
|
136
|
+
justify-content: space-between;
|
|
137
|
+
gap: 8px;
|
|
138
|
+
}
|
|
139
|
+
.brand-title h1 {
|
|
140
|
+
font-size: 26px;
|
|
141
|
+
font-weight: 700;
|
|
142
|
+
letter-spacing: -0.02em;
|
|
143
|
+
line-height: 1.2;
|
|
144
|
+
color: var(--text-strong);
|
|
145
|
+
margin: 0;
|
|
146
|
+
}
|
|
147
|
+
.brand-tag {
|
|
148
|
+
font-size: 11px;
|
|
149
|
+
font-weight: 600;
|
|
150
|
+
letter-spacing: 0.06em;
|
|
151
|
+
text-transform: uppercase;
|
|
152
|
+
padding: 2px 8px;
|
|
153
|
+
border-radius: 999px;
|
|
154
|
+
border: 1px solid var(--line);
|
|
155
|
+
color: var(--muted);
|
|
156
|
+
white-space: nowrap;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.kpi-row {
|
|
160
|
+
display: grid;
|
|
161
|
+
grid-template-columns: repeat(4, minmax(0, 1fr));
|
|
162
|
+
gap: 8px;
|
|
163
|
+
}
|
|
164
|
+
.kpi-card {
|
|
165
|
+
background: var(--surface);
|
|
166
|
+
border: 1px solid var(--line);
|
|
167
|
+
border-radius: 10px;
|
|
168
|
+
padding: 10px 6px;
|
|
169
|
+
text-align: center;
|
|
170
|
+
cursor: pointer;
|
|
171
|
+
color: var(--text-strong);
|
|
172
|
+
transition: border-color 0.15s ease, background 0.15s ease;
|
|
173
|
+
}
|
|
174
|
+
.kpi-card:hover { border-color: var(--line-bright); }
|
|
175
|
+
.kpi-card.active { border-color: var(--green-line); background: var(--green-bg); }
|
|
176
|
+
.kpi-card .num { display: block; font-size: 20px; font-weight: 700; line-height: 1.1; }
|
|
177
|
+
.kpi-card .lbl {
|
|
178
|
+
display: block;
|
|
179
|
+
font-size: 11px;
|
|
180
|
+
text-transform: uppercase;
|
|
181
|
+
letter-spacing: 0.05em;
|
|
182
|
+
color: var(--muted);
|
|
183
|
+
margin-top: 2px;
|
|
184
|
+
}
|
|
185
|
+
.num-auto { color: var(--green); }
|
|
186
|
+
.num-manual { color: var(--blue); }
|
|
187
|
+
.num-known { color: var(--amber); }
|
|
188
|
+
|
|
189
|
+
.filter-box {
|
|
190
|
+
padding: 14px 20px;
|
|
191
|
+
border-bottom: 1px solid var(--line-soft);
|
|
192
|
+
flex-shrink: 0;
|
|
193
|
+
display: flex;
|
|
194
|
+
flex-direction: column;
|
|
195
|
+
gap: 10px;
|
|
196
|
+
}
|
|
197
|
+
.search-input-wrap { position: relative; }
|
|
198
|
+
.search-input {
|
|
199
|
+
width: 100%;
|
|
200
|
+
min-height: 40px;
|
|
201
|
+
background: var(--bg);
|
|
202
|
+
border: 1px solid var(--line);
|
|
203
|
+
border-radius: 8px;
|
|
204
|
+
color: var(--text);
|
|
205
|
+
font-family: inherit;
|
|
206
|
+
font-size: 14px;
|
|
207
|
+
padding: 0 36px 0 36px;
|
|
208
|
+
outline: none;
|
|
209
|
+
}
|
|
210
|
+
.search-input::placeholder { color: var(--muted); }
|
|
211
|
+
.search-input:focus { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-bg); }
|
|
212
|
+
.search-icon {
|
|
213
|
+
position: absolute;
|
|
214
|
+
left: 12px;
|
|
215
|
+
top: 50%;
|
|
216
|
+
transform: translateY(-50%);
|
|
217
|
+
color: var(--muted);
|
|
218
|
+
pointer-events: none;
|
|
219
|
+
}
|
|
220
|
+
.clear-search-btn {
|
|
221
|
+
position: absolute;
|
|
222
|
+
right: 6px;
|
|
223
|
+
top: 50%;
|
|
224
|
+
transform: translateY(-50%);
|
|
225
|
+
background: none;
|
|
226
|
+
border: none;
|
|
227
|
+
color: var(--muted);
|
|
228
|
+
font-size: 14px;
|
|
229
|
+
cursor: pointer;
|
|
230
|
+
padding: 4px 8px;
|
|
231
|
+
}
|
|
232
|
+
.clear-search-btn:hover { color: var(--text); }
|
|
233
|
+
|
|
234
|
+
.filter-pills-row {
|
|
235
|
+
display: flex;
|
|
236
|
+
gap: 6px;
|
|
237
|
+
align-items: center;
|
|
238
|
+
justify-content: space-between;
|
|
239
|
+
flex-wrap: wrap;
|
|
240
|
+
}
|
|
241
|
+
.filter-pills-container { display: flex; gap: 6px; flex-wrap: wrap; }
|
|
242
|
+
.filter-pill {
|
|
243
|
+
min-height: 30px;
|
|
244
|
+
font-size: 13px;
|
|
245
|
+
font-weight: 600;
|
|
246
|
+
padding: 0 12px;
|
|
247
|
+
border-radius: 999px;
|
|
248
|
+
border: 1px solid var(--line);
|
|
249
|
+
background: transparent;
|
|
250
|
+
color: var(--muted);
|
|
251
|
+
cursor: pointer;
|
|
252
|
+
display: inline-flex;
|
|
253
|
+
align-items: center;
|
|
254
|
+
gap: 6px;
|
|
255
|
+
transition: color 0.15s ease, border-color 0.15s ease;
|
|
256
|
+
}
|
|
257
|
+
.filter-pill:hover { color: var(--text); border-color: var(--line-bright); }
|
|
258
|
+
.filter-pill.active { background: var(--green-bg); border-color: var(--green-line); color: var(--green); }
|
|
259
|
+
.filter-pill.active[data-status="manual"] { background: var(--blue-bg); border-color: var(--blue-line); color: var(--blue-text); }
|
|
260
|
+
.filter-pill.active[data-status="known"] { background: var(--amber-bg); border-color: var(--amber-line); color: var(--amber-text); }
|
|
261
|
+
|
|
262
|
+
.status-dot {
|
|
263
|
+
width: 7px;
|
|
264
|
+
height: 7px;
|
|
265
|
+
border-radius: 50%;
|
|
266
|
+
background: currentColor;
|
|
267
|
+
flex-shrink: 0;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
/* Tree */
|
|
271
|
+
.scenarios-list {
|
|
272
|
+
flex: 1;
|
|
273
|
+
overflow-y: auto;
|
|
274
|
+
padding: 8px 12px 12px;
|
|
275
|
+
}
|
|
276
|
+
.scenarios-list::-webkit-scrollbar { width: 6px; }
|
|
277
|
+
.scenarios-list::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }
|
|
278
|
+
|
|
279
|
+
.tree-root-label {
|
|
280
|
+
display: flex;
|
|
281
|
+
align-items: center;
|
|
282
|
+
gap: 6px;
|
|
283
|
+
font-size: 12px;
|
|
284
|
+
font-weight: 700;
|
|
285
|
+
color: var(--muted);
|
|
286
|
+
padding: 6px 8px;
|
|
287
|
+
text-transform: uppercase;
|
|
288
|
+
letter-spacing: 0.06em;
|
|
289
|
+
}
|
|
290
|
+
.tree-root-label .label-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
291
|
+
.tree-action {
|
|
292
|
+
min-height: 26px;
|
|
293
|
+
padding: 0 8px;
|
|
294
|
+
border: 1px solid var(--line);
|
|
295
|
+
border-radius: 6px;
|
|
296
|
+
background: none;
|
|
297
|
+
color: var(--muted);
|
|
298
|
+
font: inherit;
|
|
299
|
+
font-size: 12px;
|
|
300
|
+
font-weight: 600;
|
|
301
|
+
text-transform: none;
|
|
302
|
+
letter-spacing: 0;
|
|
303
|
+
cursor: pointer;
|
|
304
|
+
white-space: nowrap;
|
|
305
|
+
transition: color 0.15s ease, border-color 0.15s ease;
|
|
306
|
+
}
|
|
307
|
+
.tree-action:hover { color: var(--text); border-color: var(--line-bright); }
|
|
308
|
+
.tree-group.collapsed > .tree-children { display: none; }
|
|
309
|
+
.tree-label {
|
|
310
|
+
display: flex;
|
|
311
|
+
align-items: center;
|
|
312
|
+
gap: 6px;
|
|
313
|
+
width: 100%;
|
|
314
|
+
min-height: 36px;
|
|
315
|
+
padding: 0 8px;
|
|
316
|
+
border: none;
|
|
317
|
+
border-radius: 6px;
|
|
318
|
+
background: none;
|
|
319
|
+
cursor: pointer;
|
|
320
|
+
text-align: left;
|
|
321
|
+
color: var(--text-strong);
|
|
322
|
+
transition: background 0.15s ease;
|
|
323
|
+
}
|
|
324
|
+
.tree-label:hover { background: rgba(240, 246, 252, 0.04); }
|
|
325
|
+
.tree-label.area { font-size: 14px; font-weight: 700; }
|
|
326
|
+
.tree-label.file { font-size: 13px; font-weight: 500; color: var(--text); padding-left: 28px; }
|
|
327
|
+
.tree-label .label-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
328
|
+
.tree-label.file .label-text.endpoint { font-family: var(--mono); font-size: 12px; }
|
|
329
|
+
.tree-count {
|
|
330
|
+
font-size: 11px;
|
|
331
|
+
font-weight: 600;
|
|
332
|
+
color: var(--muted);
|
|
333
|
+
padding: 0 8px;
|
|
334
|
+
border-radius: 999px;
|
|
335
|
+
border: 1px solid var(--line);
|
|
336
|
+
}
|
|
337
|
+
.tree-toggle {
|
|
338
|
+
display: inline-flex;
|
|
339
|
+
width: 16px;
|
|
340
|
+
height: 16px;
|
|
341
|
+
color: var(--muted);
|
|
342
|
+
transition: transform 0.2s ease;
|
|
343
|
+
flex-shrink: 0;
|
|
344
|
+
}
|
|
345
|
+
.tree-group.collapsed > .tree-label .tree-toggle { transform: rotate(-90deg); }
|
|
346
|
+
|
|
347
|
+
.tree-leaf {
|
|
348
|
+
display: flex;
|
|
349
|
+
align-items: baseline;
|
|
350
|
+
gap: 8px;
|
|
351
|
+
width: 100%;
|
|
352
|
+
min-height: 40px;
|
|
353
|
+
padding: 9px 8px 9px 52px;
|
|
354
|
+
border: 1px solid transparent;
|
|
355
|
+
border-radius: 8px;
|
|
356
|
+
background: none;
|
|
357
|
+
cursor: pointer;
|
|
358
|
+
text-align: left;
|
|
359
|
+
font-size: 13px;
|
|
360
|
+
color: var(--text);
|
|
361
|
+
}
|
|
362
|
+
.tree-leaf:hover { background: rgba(240, 246, 252, 0.04); }
|
|
363
|
+
.tree-leaf.active { background: var(--green-bg); border-color: var(--green-line); color: var(--text-strong); }
|
|
364
|
+
/* Level with the first line of a wrapped name. */
|
|
365
|
+
.tree-leaf .status-dot { align-self: flex-start; margin-top: 6px; }
|
|
366
|
+
.tree-leaf .status-dot.automated { color: var(--green); }
|
|
367
|
+
.tree-leaf .status-dot.manual { color: var(--blue); }
|
|
368
|
+
.tree-leaf .leaf-id { font-family: var(--mono); font-size: 12px; color: var(--muted); flex-shrink: 0; }
|
|
369
|
+
.tree-leaf.active .leaf-id { color: var(--green); }
|
|
370
|
+
.tree-leaf .leaf-name { flex: 1; min-width: 0; line-height: 1.4; }
|
|
371
|
+
.tree-leaf .leaf-known { color: var(--amber); font-size: 12px; flex-shrink: 0; }
|
|
372
|
+
|
|
373
|
+
.list-empty { padding: 40px 16px; text-align: center; color: var(--muted); font-size: 14px; }
|
|
374
|
+
|
|
375
|
+
.list-footer {
|
|
376
|
+
padding: 10px 20px;
|
|
377
|
+
border-top: 1px solid var(--line-soft);
|
|
378
|
+
font-size: 12px;
|
|
379
|
+
color: var(--muted);
|
|
380
|
+
display: flex;
|
|
381
|
+
align-items: center;
|
|
382
|
+
justify-content: space-between;
|
|
383
|
+
gap: 8px;
|
|
384
|
+
flex-shrink: 0;
|
|
385
|
+
flex-wrap: wrap;
|
|
386
|
+
}
|
|
387
|
+
.list-footer code { font-family: var(--mono); }
|
|
388
|
+
|
|
389
|
+
/* Detail pane */
|
|
390
|
+
.detail-pane {
|
|
391
|
+
height: 100vh;
|
|
392
|
+
overflow-y: auto;
|
|
393
|
+
min-width: 0;
|
|
394
|
+
}
|
|
395
|
+
.detail-pane::-webkit-scrollbar { width: 8px; }
|
|
396
|
+
.detail-pane::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }
|
|
397
|
+
|
|
398
|
+
.detail-header {
|
|
399
|
+
padding: 28px 40px 0;
|
|
400
|
+
max-width: 1080px;
|
|
401
|
+
}
|
|
402
|
+
.detail-breadcrumbs {
|
|
403
|
+
display: flex;
|
|
404
|
+
align-items: center;
|
|
405
|
+
gap: 8px;
|
|
406
|
+
font-size: 13px;
|
|
407
|
+
color: var(--muted);
|
|
408
|
+
margin-bottom: 10px;
|
|
409
|
+
flex-wrap: wrap;
|
|
410
|
+
}
|
|
411
|
+
.detail-breadcrumbs .sep { color: var(--line-bright); }
|
|
412
|
+
.detail-breadcrumbs strong { color: var(--text-strong); font-weight: 600; }
|
|
413
|
+
.detail-title-row {
|
|
414
|
+
display: flex;
|
|
415
|
+
align-items: flex-start;
|
|
416
|
+
justify-content: space-between;
|
|
417
|
+
gap: 16px;
|
|
418
|
+
margin-bottom: 12px;
|
|
419
|
+
}
|
|
420
|
+
.detail-title {
|
|
421
|
+
font-size: 28px;
|
|
422
|
+
font-weight: 700;
|
|
423
|
+
letter-spacing: -0.02em;
|
|
424
|
+
line-height: 1.2;
|
|
425
|
+
color: var(--text-strong);
|
|
426
|
+
margin: 0;
|
|
427
|
+
}
|
|
428
|
+
.header-actions { display: flex; gap: 8px; flex-shrink: 0; flex-wrap: wrap; }
|
|
429
|
+
|
|
430
|
+
.btn-action {
|
|
431
|
+
background: var(--surface-2);
|
|
432
|
+
border: 1px solid var(--line);
|
|
433
|
+
color: var(--text-strong);
|
|
434
|
+
font-size: 13px;
|
|
435
|
+
font-weight: 600;
|
|
436
|
+
min-height: 36px;
|
|
437
|
+
padding: 0 14px;
|
|
438
|
+
border-radius: 8px;
|
|
439
|
+
cursor: pointer;
|
|
440
|
+
display: inline-flex;
|
|
441
|
+
align-items: center;
|
|
442
|
+
gap: 6px;
|
|
443
|
+
white-space: nowrap;
|
|
444
|
+
transition: background 0.15s ease, border-color 0.15s ease;
|
|
445
|
+
}
|
|
446
|
+
.btn-action:hover { background: #292e36; border-color: var(--line-bright); }
|
|
447
|
+
.btn-action.copied { background: var(--green-bg); border-color: var(--green-line); color: var(--green); }
|
|
448
|
+
.btn-action.active { background: var(--green-bg); border-color: var(--green-line); color: var(--green); }
|
|
449
|
+
|
|
450
|
+
.meta-tags-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
|
|
451
|
+
.chip {
|
|
452
|
+
font-size: 12px;
|
|
453
|
+
font-weight: 600;
|
|
454
|
+
padding: 2px 10px;
|
|
455
|
+
border-radius: 999px;
|
|
456
|
+
border: 1px solid var(--line);
|
|
457
|
+
color: var(--muted);
|
|
458
|
+
background: transparent;
|
|
459
|
+
display: inline-flex;
|
|
460
|
+
align-items: center;
|
|
461
|
+
gap: 6px;
|
|
462
|
+
}
|
|
463
|
+
.chip.id { font-family: var(--mono); font-weight: 500; color: var(--text-strong); background: var(--surface-2); border-radius: 6px; padding: 2px 8px; }
|
|
464
|
+
.chip.automated { color: var(--green); background: var(--green-bg); border-color: var(--green-line); }
|
|
465
|
+
.chip.manual { color: var(--blue-text); background: var(--blue-bg); border-color: var(--blue-line); }
|
|
466
|
+
.chip.known { color: var(--amber-text); background: var(--amber-bg); border-color: var(--amber-line); }
|
|
467
|
+
.chip.role { color: var(--muted); }
|
|
468
|
+
.chip.tag { font-family: var(--mono); font-weight: 500; color: var(--blue-text); background: rgba(88, 166, 255, 0.08); border-color: rgba(88, 166, 255, 0.25); border-radius: 6px; padding: 2px 8px; }
|
|
469
|
+
|
|
470
|
+
/* The banners sit side by side and wrap; a known issue or a re-check takes the whole row. */
|
|
471
|
+
#detail-banners {
|
|
472
|
+
display: flex;
|
|
473
|
+
flex-wrap: wrap;
|
|
474
|
+
gap: 14px;
|
|
475
|
+
margin: 20px 40px 0;
|
|
476
|
+
max-width: 1000px;
|
|
477
|
+
}
|
|
478
|
+
#detail-banners:empty { display: none; }
|
|
479
|
+
.banner {
|
|
480
|
+
flex: 1 1 360px;
|
|
481
|
+
min-width: 0;
|
|
482
|
+
padding: 16px 18px;
|
|
483
|
+
border-radius: 12px;
|
|
484
|
+
background: var(--surface);
|
|
485
|
+
border: 1px solid var(--line);
|
|
486
|
+
display: flex;
|
|
487
|
+
flex-direction: column;
|
|
488
|
+
gap: 12px;
|
|
489
|
+
}
|
|
490
|
+
.banner.known { flex-basis: 100%; border-color: var(--amber-line); }
|
|
491
|
+
.banner.auto { border-color: var(--green-line); }
|
|
492
|
+
.banner.manual { border-color: var(--blue-line); }
|
|
493
|
+
.banner-left { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
|
|
494
|
+
.banner-title { font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 8px; color: var(--text-strong); }
|
|
495
|
+
.banner.auto .banner-title { color: var(--green); }
|
|
496
|
+
.banner.manual .banner-title { color: var(--blue-text); }
|
|
497
|
+
.banner.known .banner-title { color: var(--amber-text); }
|
|
498
|
+
.banner-desc { font-size: 13px; color: var(--muted); line-height: 1.6; overflow-wrap: anywhere; }
|
|
499
|
+
.banner-desc a:hover { text-decoration: underline; }
|
|
500
|
+
.banner-desc strong { color: var(--text); }
|
|
501
|
+
.banner-actions { display: flex; gap: 8px; flex-wrap: wrap; }
|
|
502
|
+
.code {
|
|
503
|
+
font-family: var(--mono);
|
|
504
|
+
font-size: 12px;
|
|
505
|
+
color: var(--text);
|
|
506
|
+
background: var(--bg);
|
|
507
|
+
padding: 1px 6px;
|
|
508
|
+
border-radius: 6px;
|
|
509
|
+
border: 1px solid var(--line);
|
|
510
|
+
}
|
|
511
|
+
a .code { color: var(--green); }
|
|
512
|
+
|
|
513
|
+
.detail-tabs-bar {
|
|
514
|
+
margin: 20px 40px 0;
|
|
515
|
+
max-width: 1000px;
|
|
516
|
+
display: flex;
|
|
517
|
+
align-items: center;
|
|
518
|
+
gap: 4px;
|
|
519
|
+
border-bottom: 1px solid var(--line-soft);
|
|
520
|
+
padding-bottom: 8px;
|
|
521
|
+
}
|
|
522
|
+
.detail-tab {
|
|
523
|
+
background: none;
|
|
524
|
+
border: none;
|
|
525
|
+
color: var(--muted);
|
|
526
|
+
font-size: 14px;
|
|
527
|
+
font-weight: 600;
|
|
528
|
+
min-height: 36px;
|
|
529
|
+
padding: 0 14px;
|
|
530
|
+
border-radius: 7px;
|
|
531
|
+
cursor: pointer;
|
|
532
|
+
}
|
|
533
|
+
.detail-tab:hover { color: var(--text); background: rgba(240, 246, 252, 0.04); }
|
|
534
|
+
.detail-tab.active { color: var(--green); background: var(--green-bg); }
|
|
535
|
+
.detail-tabs-bar .btn-action { margin-left: auto; }
|
|
536
|
+
|
|
537
|
+
.detail-content-area { padding: 20px 40px 48px; max-width: 1080px; }
|
|
538
|
+
|
|
539
|
+
.steps-container { display: flex; flex-direction: column; gap: 8px; }
|
|
540
|
+
.step-card {
|
|
541
|
+
display: flex;
|
|
542
|
+
align-items: flex-start;
|
|
543
|
+
gap: 14px;
|
|
544
|
+
padding: 12px 16px;
|
|
545
|
+
border-radius: 10px;
|
|
546
|
+
background: var(--surface);
|
|
547
|
+
border: 1px solid var(--line);
|
|
548
|
+
}
|
|
549
|
+
.step-card:hover { border-color: var(--line-bright); }
|
|
550
|
+
.step-number {
|
|
551
|
+
font-family: var(--mono);
|
|
552
|
+
font-size: 12px;
|
|
553
|
+
font-weight: 600;
|
|
554
|
+
width: 28px;
|
|
555
|
+
height: 28px;
|
|
556
|
+
border-radius: 8px;
|
|
557
|
+
background: var(--green-bg);
|
|
558
|
+
border: 1px solid rgba(63, 185, 80, 0.3);
|
|
559
|
+
color: var(--green);
|
|
560
|
+
display: flex;
|
|
561
|
+
align-items: center;
|
|
562
|
+
justify-content: center;
|
|
563
|
+
flex-shrink: 0;
|
|
564
|
+
}
|
|
565
|
+
.step-text { font-size: 15px; line-height: 1.55; flex: 1; min-width: 0; overflow-wrap: anywhere; padding-top: 2px; }
|
|
566
|
+
.step-kw-action { color: var(--blue-text); font-weight: 600; }
|
|
567
|
+
.step-kw-verify { color: var(--green); font-weight: 600; }
|
|
568
|
+
.step-token-quote {
|
|
569
|
+
color: var(--amber-text);
|
|
570
|
+
background: rgba(210, 153, 34, 0.1);
|
|
571
|
+
padding: 1px 5px;
|
|
572
|
+
border-radius: 4px;
|
|
573
|
+
font-family: var(--mono);
|
|
574
|
+
font-size: 0.87em;
|
|
575
|
+
}
|
|
576
|
+
.step-token-endpoint { color: var(--blue-text); font-family: var(--mono); font-size: 0.87em; }
|
|
577
|
+
|
|
578
|
+
.yaml-container {
|
|
579
|
+
background: var(--inset);
|
|
580
|
+
border: 1px solid var(--line);
|
|
581
|
+
border-radius: 10px;
|
|
582
|
+
padding: 16px 18px;
|
|
583
|
+
overflow-x: auto;
|
|
584
|
+
}
|
|
585
|
+
.yaml-pre { margin: 0; font-family: var(--mono); font-size: 13px; line-height: 1.6; color: var(--text); white-space: pre; }
|
|
586
|
+
.yaml-key { color: var(--blue-text); }
|
|
587
|
+
|
|
588
|
+
.empty-state {
|
|
589
|
+
display: flex;
|
|
590
|
+
flex-direction: column;
|
|
591
|
+
align-items: center;
|
|
592
|
+
justify-content: center;
|
|
593
|
+
min-height: 100%;
|
|
594
|
+
padding: 48px 24px;
|
|
595
|
+
text-align: center;
|
|
596
|
+
color: var(--muted);
|
|
597
|
+
}
|
|
598
|
+
.empty-state svg { width: 64px; height: 64px; stroke: var(--line-bright); margin-bottom: 20px; }
|
|
599
|
+
.empty-state h3 { font-size: 18px; color: var(--text-strong); margin: 0 0 8px; }
|
|
600
|
+
.empty-state p { font-size: 14px; max-width: 440px; line-height: 1.5; margin: 0; }
|
|
601
|
+
|
|
602
|
+
/* The list moves above the detail. */
|
|
603
|
+
@media (max-width: 1100px) {
|
|
604
|
+
.app-layout { display: flex; flex-direction: column; height: auto; overflow: visible; }
|
|
605
|
+
.sidebar-pane { height: auto; border-right: none; border-bottom: 1px solid var(--line-soft); }
|
|
606
|
+
.scenarios-list { max-height: 420px; }
|
|
607
|
+
.detail-pane { height: auto; overflow: visible; }
|
|
608
|
+
.empty-state { min-height: 260px; }
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
@media (max-width: 640px) {
|
|
612
|
+
.sidebar-header, .filter-box, .list-footer { padding-left: 16px; padding-right: 16px; }
|
|
613
|
+
.scenarios-list { padding-left: 8px; padding-right: 8px; }
|
|
614
|
+
.tree-leaf { padding-left: 36px; }
|
|
615
|
+
.detail-header { padding: 20px 16px 0; }
|
|
616
|
+
#detail-banners, .detail-tabs-bar { margin-left: 16px; margin-right: 16px; }
|
|
617
|
+
.banner { flex-basis: 100%; }
|
|
618
|
+
.detail-content-area { padding: 16px 16px 32px; }
|
|
619
|
+
.detail-title-row { flex-direction: column; gap: 12px; }
|
|
620
|
+
.detail-title { font-size: 22px; }
|
|
621
|
+
.kpi-card .lbl { font-size: 10px; }
|
|
622
|
+
.step-card { gap: 10px; padding: 10px 12px; }
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
/* Test Cases pages */
|
|
626
|
+
.header-row {
|
|
627
|
+
display: flex;
|
|
628
|
+
align-items: center;
|
|
629
|
+
justify-content: space-between;
|
|
630
|
+
gap: 10px;
|
|
631
|
+
flex-wrap: wrap;
|
|
632
|
+
}
|
|
633
|
+
.layer-switch {
|
|
634
|
+
display: flex;
|
|
635
|
+
gap: 4px;
|
|
636
|
+
padding: 4px;
|
|
637
|
+
border-radius: 10px;
|
|
638
|
+
background: var(--surface);
|
|
639
|
+
border: 1px solid var(--line);
|
|
640
|
+
}
|
|
641
|
+
.layer-switch a {
|
|
642
|
+
min-width: 56px;
|
|
643
|
+
padding: 6px 14px;
|
|
644
|
+
border-radius: 7px;
|
|
645
|
+
text-align: center;
|
|
646
|
+
font-size: 14px;
|
|
647
|
+
font-weight: 600;
|
|
648
|
+
color: var(--muted);
|
|
649
|
+
}
|
|
650
|
+
.layer-switch a:hover { color: var(--text); background: rgba(240, 246, 252, 0.04); }
|
|
651
|
+
.layer-switch a.current { color: var(--bg); background: var(--green); }
|
|
652
|
+
.run-link {
|
|
653
|
+
font-size: 13px;
|
|
654
|
+
font-weight: 600;
|
|
655
|
+
white-space: nowrap;
|
|
656
|
+
}
|
|
657
|
+
.run-link:hover { text-decoration: underline; }
|
|
658
|
+
|
|
659
|
+
.preconditions {
|
|
660
|
+
padding: 14px 16px;
|
|
661
|
+
border-radius: 10px;
|
|
662
|
+
background: var(--surface);
|
|
663
|
+
border: 1px solid var(--line);
|
|
664
|
+
}
|
|
665
|
+
.preconditions-title { font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
|
|
666
|
+
.preconditions ul { margin: 0; padding-left: 20px; }
|
|
667
|
+
.preconditions li { font-size: 14px; line-height: 1.55; overflow-wrap: anywhere; }
|
|
668
|
+
|
|
669
|
+
.step-check {
|
|
670
|
+
appearance: none;
|
|
671
|
+
-webkit-appearance: none;
|
|
672
|
+
width: 18px;
|
|
673
|
+
height: 18px;
|
|
674
|
+
margin: 5px 0 0;
|
|
675
|
+
border: 1.5px solid var(--muted);
|
|
676
|
+
border-radius: 4px;
|
|
677
|
+
background: var(--bg);
|
|
678
|
+
cursor: pointer;
|
|
679
|
+
position: relative;
|
|
680
|
+
flex-shrink: 0;
|
|
681
|
+
}
|
|
682
|
+
.step-check:hover { border-color: var(--green); }
|
|
683
|
+
.step-check:checked { background: var(--green); border-color: var(--green); }
|
|
684
|
+
.step-check:checked::after {
|
|
685
|
+
content: '';
|
|
686
|
+
position: absolute;
|
|
687
|
+
left: 5px;
|
|
688
|
+
top: 1px;
|
|
689
|
+
width: 5px;
|
|
690
|
+
height: 10px;
|
|
691
|
+
border: solid var(--bg);
|
|
692
|
+
border-width: 0 2px 2px 0;
|
|
693
|
+
transform: rotate(45deg);
|
|
694
|
+
}
|
|
695
|
+
.step-card.done .step-text { text-decoration: line-through; opacity: 0.6; }
|
|
696
|
+
</style>
|
|
697
|
+
</head>
|
|
698
|
+
<body>
|
|
699
|
+
<div class="app-layout">
|
|
700
|
+
<aside class="sidebar-pane">
|
|
701
|
+
<div class="sidebar-header">
|
|
702
|
+
<!-- The portal's logo; it and the back link lead to the portal. -->
|
|
703
|
+
<a href="../../index.html" class="brand">
|
|
704
|
+
<svg width="36" height="36" viewBox="0 0 44 44" aria-hidden="true"><rect width="44" height="44" rx="10" fill="#3fb950"/><path d="M11 23l8 8l15-17" fill="none" stroke="#fff" stroke-width="5" stroke-linecap="round" stroke-linejoin="round"/></svg>
|
|
705
|
+
<span><span class="brand-name" id="brand-name"></span><span class="brand-sub" id="brand-tagline"></span></span>
|
|
706
|
+
</a>
|
|
707
|
+
<div class="page-head">
|
|
708
|
+
<a href="../../index.html" class="back-link">
|
|
709
|
+
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true"><path d="M19 12H5M12 19l-7-7 7-7"/></svg>
|
|
710
|
+
Automation Portal
|
|
711
|
+
</a>
|
|
712
|
+
<div class="brand-title">
|
|
713
|
+
<h1 id="page-title">Test Cases</h1>
|
|
714
|
+
<span class="brand-tag">Scenario catalog</span>
|
|
715
|
+
</div>
|
|
716
|
+
</div>
|
|
717
|
+
<div class="header-row">
|
|
718
|
+
<nav class="layer-switch" aria-label="Test case pages">
|
|
719
|
+
<a href="../ui/" data-layer="ui">UI</a>
|
|
720
|
+
<a href="../api/" data-layer="api">API</a>
|
|
721
|
+
</nav>
|
|
722
|
+
<a class="run-link" id="run-link" target="_blank" rel="noreferrer" title="Open the custom test run workflow in GitHub Actions" hidden>Run on GitHub ↗</a>
|
|
723
|
+
</div>
|
|
724
|
+
<div class="kpi-row">
|
|
725
|
+
<button type="button" class="kpi-card" data-status="all" title="Show all scenarios">
|
|
726
|
+
<span class="num" id="kpi-total">-</span><span class="lbl">Total</span>
|
|
727
|
+
</button>
|
|
728
|
+
<button type="button" class="kpi-card" data-status="automated" title="Show automated scenarios">
|
|
729
|
+
<span class="num num-auto" id="kpi-auto">-</span><span class="lbl" id="kpi-auto-lbl">Automated</span>
|
|
730
|
+
</button>
|
|
731
|
+
<button type="button" class="kpi-card" data-status="manual" title="Show manual scenarios">
|
|
732
|
+
<span class="num num-manual" id="kpi-manual">-</span><span class="lbl">Manual</span>
|
|
733
|
+
</button>
|
|
734
|
+
<button type="button" class="kpi-card" data-status="known" title="Show scenarios with a known issue">
|
|
735
|
+
<span class="num num-known" id="kpi-known">-</span><span class="lbl">Known issues</span>
|
|
736
|
+
</button>
|
|
737
|
+
</div>
|
|
738
|
+
</div>
|
|
739
|
+
|
|
740
|
+
<div class="filter-box">
|
|
741
|
+
<div class="search-input-wrap">
|
|
742
|
+
<svg class="search-icon" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true"><circle cx="11" cy="11" r="8"/><path d="m21 21-4.3-4.3"/></svg>
|
|
743
|
+
<input type="search" id="scenario-search" class="search-input" placeholder="Search ID, name, steps, role..." autocomplete="off" aria-label="Search scenarios">
|
|
744
|
+
<button type="button" id="clear-search" class="clear-search-btn" title="Clear search" hidden>✕</button>
|
|
745
|
+
</div>
|
|
746
|
+
<div class="filter-pills-row">
|
|
747
|
+
<div class="filter-pills-container" role="group" aria-label="Filter by status">
|
|
748
|
+
<button type="button" class="filter-pill active" data-status="all">All</button>
|
|
749
|
+
<button type="button" class="filter-pill" data-status="automated"><span class="status-dot" style="color: var(--green)"></span>Automated</button>
|
|
750
|
+
<button type="button" class="filter-pill" data-status="manual"><span class="status-dot" style="color: var(--blue)"></span>Manual</button>
|
|
751
|
+
<button type="button" class="filter-pill" data-status="known"><span class="status-dot" style="color: var(--amber)"></span>Known issue</button>
|
|
752
|
+
</div>
|
|
753
|
+
</div>
|
|
754
|
+
</div>
|
|
755
|
+
|
|
756
|
+
<div class="scenarios-list" id="scenarios-list"></div>
|
|
757
|
+
|
|
758
|
+
<div class="list-footer">
|
|
759
|
+
<span id="showing-count">Loading scenarios...</span>
|
|
760
|
+
<span id="generated-info"></span>
|
|
761
|
+
</div>
|
|
762
|
+
</aside>
|
|
763
|
+
|
|
764
|
+
<main class="detail-pane" id="detail-pane">
|
|
765
|
+
<div id="empty-state" class="empty-state">
|
|
766
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" aria-hidden="true">
|
|
767
|
+
<path d="M9 12h6m-6 4h6m2 5H7a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5.5L19 7.5V19a2 2 0 0 1-2 2z"/>
|
|
768
|
+
</svg>
|
|
769
|
+
<h3 id="empty-title">No scenario selected</h3>
|
|
770
|
+
<p id="empty-text">Pick a scenario in the tree to see its steps, automation status and YAML.</p>
|
|
771
|
+
</div>
|
|
772
|
+
|
|
773
|
+
<div id="scenario-detail" hidden>
|
|
774
|
+
<header class="detail-header">
|
|
775
|
+
<div class="detail-breadcrumbs" id="detail-breadcrumbs"></div>
|
|
776
|
+
<div class="detail-title-row">
|
|
777
|
+
<h2 class="detail-title" id="detail-title"></h2>
|
|
778
|
+
<div class="header-actions">
|
|
779
|
+
<button type="button" class="btn-action" id="btn-copy-link" data-label="Copy link">Copy link</button>
|
|
780
|
+
<button type="button" class="btn-action" id="btn-copy-yaml" data-label="Copy YAML">Copy YAML</button>
|
|
781
|
+
</div>
|
|
782
|
+
</div>
|
|
783
|
+
<div class="meta-tags-row" id="detail-chips"></div>
|
|
784
|
+
</header>
|
|
785
|
+
|
|
786
|
+
<div id="detail-banners"></div>
|
|
787
|
+
|
|
788
|
+
<div class="detail-tabs-bar">
|
|
789
|
+
<button type="button" class="detail-tab active" data-tab="steps">Steps (<span id="steps-count">0</span>)</button>
|
|
790
|
+
<button type="button" class="detail-tab" data-tab="yaml">YAML</button>
|
|
791
|
+
<button type="button" class="btn-action" id="btn-execute" title="Tick off the steps while running the scenario by hand">
|
|
792
|
+
<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true"><polygon points="5 3 19 12 5 21 5 3"/></svg>
|
|
793
|
+
Execute
|
|
794
|
+
</button>
|
|
795
|
+
</div>
|
|
796
|
+
|
|
797
|
+
<div class="detail-content-area">
|
|
798
|
+
<div id="tab-steps" class="steps-container"></div>
|
|
799
|
+
<div id="tab-yaml" class="yaml-container" hidden><pre class="yaml-pre" id="yaml-content"></pre></div>
|
|
800
|
+
</div>
|
|
801
|
+
</div>
|
|
802
|
+
</main>
|
|
803
|
+
</div>
|
|
804
|
+
|
|
805
|
+
<script src="scenarios-data.js"></script>
|
|
806
|
+
<script>
|
|
807
|
+
(function () {
|
|
808
|
+
const catalog = window.SCENARIO_CATALOG;
|
|
809
|
+
const $ = (id) => document.getElementById(id);
|
|
810
|
+
const CHEVRON = '<span class="tree-toggle" aria-hidden="true"><svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2"><polyline points="6 9 12 15 18 9"></polyline></svg></span>';
|
|
811
|
+
|
|
812
|
+
const state = {
|
|
813
|
+
selectedId: null,
|
|
814
|
+
tab: 'steps',
|
|
815
|
+
search: '',
|
|
816
|
+
status: 'all',
|
|
817
|
+
// Open tree groups ("area:<name>" or "file:<path>"). Everything starts collapsed; selecting a
|
|
818
|
+
// scenario (or a #scenario= link) opens its branch, and filtering opens every matching group.
|
|
819
|
+
open: new Set(),
|
|
820
|
+
executing: new Set(),
|
|
821
|
+
done: new Map(),
|
|
822
|
+
};
|
|
823
|
+
|
|
824
|
+
function escapeHtml(value) {
|
|
825
|
+
return String(value ?? '')
|
|
826
|
+
.replace(/&/g, '&')
|
|
827
|
+
.replace(/</g, '<')
|
|
828
|
+
.replace(/>/g, '>')
|
|
829
|
+
.replace(/"/g, '"')
|
|
830
|
+
.replace(/'/g, ''');
|
|
831
|
+
}
|
|
832
|
+
|
|
833
|
+
// A project file's page on GitHub; projectPath is the project's folder in the repository ('' at its root).
|
|
834
|
+
function blobUrl(file, line) {
|
|
835
|
+
const [filePath, anchor] = file.split('#');
|
|
836
|
+
return `${catalog.repoUrl}/blob/${catalog.branch}/${catalog.projectPath ?? ''}${filePath}${line ? `#L${line}` : anchor ? `#${anchor.toLowerCase()}` : ''}`;
|
|
837
|
+
}
|
|
838
|
+
|
|
839
|
+
// The portal's brand from the data file (simpright.yml portal): the title, its accent (the end of it) in green, the tagline.
|
|
840
|
+
function renderBrand(portal) {
|
|
841
|
+
if (!portal) return;
|
|
842
|
+
const accent = portal.titleAccent && portal.title.endsWith(portal.titleAccent) ? portal.titleAccent : '';
|
|
843
|
+
const name = $('brand-name');
|
|
844
|
+
name.textContent = portal.title.slice(0, portal.title.length - accent.length);
|
|
845
|
+
if (accent) {
|
|
846
|
+
const span = document.createElement('span');
|
|
847
|
+
span.textContent = accent;
|
|
848
|
+
name.appendChild(span);
|
|
849
|
+
}
|
|
850
|
+
$('brand-tagline').textContent = portal.tagline || '';
|
|
851
|
+
}
|
|
852
|
+
|
|
853
|
+
function init() {
|
|
854
|
+
if (!catalog) {
|
|
855
|
+
$('showing-count').textContent = 'No scenario data found.';
|
|
856
|
+
$('empty-title').textContent = 'No scenario data';
|
|
857
|
+
$('empty-text').textContent = 'scenarios-data.js is missing. Build it with npm run test-cases:build.';
|
|
858
|
+
return;
|
|
859
|
+
}
|
|
860
|
+
document.title = catalog.portal ? `${catalog.portal.title} - ${catalog.title}` : catalog.title;
|
|
861
|
+
renderBrand(catalog.portal);
|
|
862
|
+
$('page-title').textContent = catalog.title;
|
|
863
|
+
document.querySelectorAll('.layer-switch a').forEach((a) => {
|
|
864
|
+
const current = a.dataset.layer === catalog.layer;
|
|
865
|
+
a.classList.toggle('current', current);
|
|
866
|
+
if (current) a.setAttribute('aria-current', 'page');
|
|
867
|
+
});
|
|
868
|
+
|
|
869
|
+
const { stats } = catalog;
|
|
870
|
+
$('kpi-total').textContent = stats.total;
|
|
871
|
+
$('kpi-auto').textContent = stats.automated;
|
|
872
|
+
$('kpi-auto-lbl').textContent = `Automated ${stats.automatedPct}%`;
|
|
873
|
+
$('kpi-manual').textContent = stats.manual;
|
|
874
|
+
$('kpi-known').textContent = stats.knownIssues;
|
|
875
|
+
|
|
876
|
+
if (catalog.workflowUrl) {
|
|
877
|
+
$('run-link').href = catalog.workflowUrl;
|
|
878
|
+
$('run-link').hidden = false;
|
|
879
|
+
}
|
|
880
|
+
const updated = new Date(catalog.generatedAt);
|
|
881
|
+
const commit = catalog.commit ? catalog.commit.slice(0, 7) : '';
|
|
882
|
+
$('generated-info').innerHTML = `Updated ${escapeHtml(updated.toLocaleDateString(undefined, { day: 'numeric', month: 'short', year: 'numeric' }))}` +
|
|
883
|
+
(commit ? ` · <a href="${escapeHtml(`${catalog.repoUrl}/commit/${catalog.commit}`)}" target="_blank" rel="noreferrer"><code>${escapeHtml(commit)}</code></a>` : '');
|
|
884
|
+
|
|
885
|
+
bindEvents();
|
|
886
|
+
readHash();
|
|
887
|
+
render();
|
|
888
|
+
}
|
|
889
|
+
|
|
890
|
+
function bindEvents() {
|
|
891
|
+
$('scenario-search').addEventListener('input', (e) => {
|
|
892
|
+
state.search = e.target.value.trim().toLowerCase();
|
|
893
|
+
$('clear-search').hidden = !state.search;
|
|
894
|
+
if (isFiltering()) expandAll();
|
|
895
|
+
render();
|
|
896
|
+
});
|
|
897
|
+
$('clear-search').addEventListener('click', () => {
|
|
898
|
+
$('scenario-search').value = '';
|
|
899
|
+
state.search = '';
|
|
900
|
+
$('clear-search').hidden = true;
|
|
901
|
+
$('scenario-search').focus();
|
|
902
|
+
render();
|
|
903
|
+
});
|
|
904
|
+
document.querySelectorAll('[data-status]').forEach((button) => {
|
|
905
|
+
button.addEventListener('click', () => setStatus(button.dataset.status));
|
|
906
|
+
});
|
|
907
|
+
document.querySelectorAll('.detail-tab').forEach((tab) => {
|
|
908
|
+
tab.addEventListener('click', () => switchTab(tab.dataset.tab));
|
|
909
|
+
});
|
|
910
|
+
$('btn-copy-yaml').addEventListener('click', (e) => copy(e.currentTarget, selected()?.yaml ?? ''));
|
|
911
|
+
$('btn-copy-link').addEventListener('click', (e) => copy(e.currentTarget, location.href));
|
|
912
|
+
$('btn-execute').addEventListener('click', () => {
|
|
913
|
+
const id = state.selectedId;
|
|
914
|
+
if (!id) return;
|
|
915
|
+
if (state.executing.has(id)) {
|
|
916
|
+
state.executing.delete(id);
|
|
917
|
+
state.done.delete(id);
|
|
918
|
+
} else {
|
|
919
|
+
state.executing.add(id);
|
|
920
|
+
}
|
|
921
|
+
renderSteps(selected());
|
|
922
|
+
});
|
|
923
|
+
window.addEventListener('hashchange', () => {
|
|
924
|
+
readHash();
|
|
925
|
+
render();
|
|
926
|
+
});
|
|
927
|
+
document.addEventListener('keydown', (e) => {
|
|
928
|
+
if (['INPUT', 'TEXTAREA', 'SELECT'].includes(e.target.tagName)) return;
|
|
929
|
+
if (e.key === 'ArrowDown' || e.key === 'ArrowUp') {
|
|
930
|
+
e.preventDefault();
|
|
931
|
+
move(e.key === 'ArrowDown' ? 1 : -1);
|
|
932
|
+
}
|
|
933
|
+
});
|
|
934
|
+
}
|
|
935
|
+
|
|
936
|
+
function setStatus(status) {
|
|
937
|
+
state.status = status;
|
|
938
|
+
document.querySelectorAll('[data-status]').forEach((b) => b.classList.toggle('active', b.dataset.status === status && (b.classList.contains('filter-pill') || status !== 'all')));
|
|
939
|
+
if (isFiltering()) expandAll();
|
|
940
|
+
render();
|
|
941
|
+
}
|
|
942
|
+
|
|
943
|
+
function isFiltering() {
|
|
944
|
+
return Boolean(state.search) || state.status !== 'all';
|
|
945
|
+
}
|
|
946
|
+
|
|
947
|
+
function branchKeys(sc) {
|
|
948
|
+
return [`area:${sc.area}`, `file:${sc.file}`];
|
|
949
|
+
}
|
|
950
|
+
|
|
951
|
+
// Opens every group; the tree renders only the groups with shown scenarios.
|
|
952
|
+
function expandAll() {
|
|
953
|
+
for (const area of catalog.tree) {
|
|
954
|
+
state.open.add(`area:${area.area}`);
|
|
955
|
+
for (const file of area.files) state.open.add(`file:${file.file}`);
|
|
956
|
+
}
|
|
957
|
+
}
|
|
958
|
+
|
|
959
|
+
function collapseAll() {
|
|
960
|
+
state.open.clear();
|
|
961
|
+
}
|
|
962
|
+
|
|
963
|
+
function matches(sc) {
|
|
964
|
+
if (state.status === 'known' && !sc.knownIssue) return false;
|
|
965
|
+
if ((state.status === 'automated' || state.status === 'manual') && sc.status !== state.status) return false;
|
|
966
|
+
if (!state.search) return true;
|
|
967
|
+
const text = [sc.id, sc.name, sc.suite, sc.areaLabel, sc.fileLabel, sc.file, sc.role ?? '', sc.knownIssue ?? '', sc.bug ?? '', sc.automatedIn ?? '', ...sc.ref, ...sc.tags, ...(sc.preconditions ?? []), ...sc.steps]
|
|
968
|
+
.join(' ')
|
|
969
|
+
.toLowerCase();
|
|
970
|
+
return text.includes(state.search);
|
|
971
|
+
}
|
|
972
|
+
|
|
973
|
+
function visible() {
|
|
974
|
+
return catalog.scenarios.filter(matches);
|
|
975
|
+
}
|
|
976
|
+
|
|
977
|
+
function selected() {
|
|
978
|
+
return catalog.scenarios.find((s) => s.id === state.selectedId);
|
|
979
|
+
}
|
|
980
|
+
|
|
981
|
+
function render() {
|
|
982
|
+
const shown = visible();
|
|
983
|
+
const shownIds = new Set(shown.map((s) => s.id));
|
|
984
|
+
if (!shownIds.has(state.selectedId)) state.selectedId = shown[0]?.id ?? null;
|
|
985
|
+
renderTree(shownIds);
|
|
986
|
+
$('showing-count').textContent = `Showing ${shown.length} of ${catalog.scenarios.length} scenarios`;
|
|
987
|
+
const sc = selected();
|
|
988
|
+
if (sc) renderDetail(sc);
|
|
989
|
+
else showEmpty(shown.length === 0 && catalog.scenarios.length > 0);
|
|
990
|
+
}
|
|
991
|
+
|
|
992
|
+
function renderTree(shownIds) {
|
|
993
|
+
const list = $('scenarios-list');
|
|
994
|
+
list.innerHTML = '';
|
|
995
|
+
const byId = new Map(catalog.scenarios.map((s) => [s.id, s]));
|
|
996
|
+
const fragment = document.createDocumentFragment();
|
|
997
|
+
|
|
998
|
+
const root = document.createElement('div');
|
|
999
|
+
root.className = 'tree-root-label';
|
|
1000
|
+
const title = document.createElement('span');
|
|
1001
|
+
title.className = 'label-text';
|
|
1002
|
+
title.textContent = catalog.title;
|
|
1003
|
+
root.append(title, treeAction('Expand all', expandAll), treeAction('Collapse all', collapseAll));
|
|
1004
|
+
fragment.appendChild(root);
|
|
1005
|
+
|
|
1006
|
+
let any = false;
|
|
1007
|
+
for (const area of catalog.tree) {
|
|
1008
|
+
const files = area.files
|
|
1009
|
+
.map((file) => ({ file, ids: file.ids.filter((id) => shownIds.has(id)) }))
|
|
1010
|
+
.filter((f) => f.ids.length > 0);
|
|
1011
|
+
if (files.length === 0) continue;
|
|
1012
|
+
any = true;
|
|
1013
|
+
|
|
1014
|
+
const areaKey = `area:${area.area}`;
|
|
1015
|
+
const areaGroup = group(areaKey, 'area', escapeHtml(area.label), files.reduce((n, f) => n + f.ids.length, 0));
|
|
1016
|
+
for (const { file, ids } of files) {
|
|
1017
|
+
const fileKey = `file:${file.file}`;
|
|
1018
|
+
const labelClass = catalog.layer === 'api' && file.label !== file.name ? 'label-text endpoint' : 'label-text';
|
|
1019
|
+
const fileGroup = group(fileKey, 'file', escapeHtml(file.label), ids.length, labelClass, file.file);
|
|
1020
|
+
for (const id of ids) fileGroup.children.appendChild(leaf(byId.get(id)));
|
|
1021
|
+
areaGroup.children.appendChild(fileGroup.el);
|
|
1022
|
+
}
|
|
1023
|
+
fragment.appendChild(areaGroup.el);
|
|
1024
|
+
}
|
|
1025
|
+
|
|
1026
|
+
if (!any) {
|
|
1027
|
+
const empty = document.createElement('div');
|
|
1028
|
+
empty.className = 'list-empty';
|
|
1029
|
+
empty.textContent = catalog.scenarios.length ? 'No scenarios match the filters.' : 'No scenarios yet.';
|
|
1030
|
+
fragment.appendChild(empty);
|
|
1031
|
+
}
|
|
1032
|
+
list.appendChild(fragment);
|
|
1033
|
+
}
|
|
1034
|
+
|
|
1035
|
+
function treeAction(text, action) {
|
|
1036
|
+
const button = document.createElement('button');
|
|
1037
|
+
button.type = 'button';
|
|
1038
|
+
button.className = 'tree-action';
|
|
1039
|
+
button.textContent = text;
|
|
1040
|
+
button.addEventListener('click', () => {
|
|
1041
|
+
action();
|
|
1042
|
+
renderTree(new Set(visible().map((s) => s.id)));
|
|
1043
|
+
});
|
|
1044
|
+
return button;
|
|
1045
|
+
}
|
|
1046
|
+
|
|
1047
|
+
function group(key, kind, labelHtml, count, labelClass = 'label-text', title = '') {
|
|
1048
|
+
const open = state.open.has(key);
|
|
1049
|
+
const el = document.createElement('div');
|
|
1050
|
+
el.className = `tree-group${open ? '' : ' collapsed'}`;
|
|
1051
|
+
const label = document.createElement('button');
|
|
1052
|
+
label.type = 'button';
|
|
1053
|
+
label.className = `tree-label ${kind}`;
|
|
1054
|
+
label.setAttribute('aria-expanded', String(open));
|
|
1055
|
+
if (title) label.title = title;
|
|
1056
|
+
label.innerHTML = `${CHEVRON}<span class="${labelClass}">${labelHtml}</span><span class="tree-count">${count}</span>`;
|
|
1057
|
+
label.addEventListener('click', () => {
|
|
1058
|
+
const nowOpen = el.classList.toggle('collapsed') === false;
|
|
1059
|
+
label.setAttribute('aria-expanded', String(nowOpen));
|
|
1060
|
+
nowOpen ? state.open.add(key) : state.open.delete(key);
|
|
1061
|
+
});
|
|
1062
|
+
const children = document.createElement('div');
|
|
1063
|
+
children.className = 'tree-children';
|
|
1064
|
+
el.append(label, children);
|
|
1065
|
+
return { el, children };
|
|
1066
|
+
}
|
|
1067
|
+
|
|
1068
|
+
function leaf(sc) {
|
|
1069
|
+
const item = document.createElement('button');
|
|
1070
|
+
item.type = 'button';
|
|
1071
|
+
item.className = `tree-leaf${sc.id === state.selectedId ? ' active' : ''}`;
|
|
1072
|
+
item.dataset.id = sc.id;
|
|
1073
|
+
item.title = `${sc.id}: ${sc.name}`;
|
|
1074
|
+
item.innerHTML =
|
|
1075
|
+
`<span class="status-dot ${sc.status}" title="${sc.status}"></span>` +
|
|
1076
|
+
`<span class="leaf-id">${escapeHtml(sc.id)}</span>` +
|
|
1077
|
+
`<span class="leaf-name">${escapeHtml(sc.name)}</span>` +
|
|
1078
|
+
(sc.knownIssue ? '<span class="leaf-known" title="Known issue">⚠</span>' : '');
|
|
1079
|
+
item.addEventListener('click', () => select(sc.id));
|
|
1080
|
+
return item;
|
|
1081
|
+
}
|
|
1082
|
+
|
|
1083
|
+
function select(id) {
|
|
1084
|
+
if (state.selectedId === id && location.hash === `#scenario=${encodeURIComponent(id)}`) return;
|
|
1085
|
+
state.selectedId = id;
|
|
1086
|
+
const sc = selected();
|
|
1087
|
+
// Arrow keys can move into a collapsed group: open the branch so the selection stays in view.
|
|
1088
|
+
const closed = sc ? branchKeys(sc).filter((key) => !state.open.has(key)) : [];
|
|
1089
|
+
closed.forEach((key) => state.open.add(key));
|
|
1090
|
+
history.replaceState(null, '', `#scenario=${encodeURIComponent(id)}`);
|
|
1091
|
+
document.querySelectorAll('.tree-leaf').forEach((item) => item.classList.toggle('active', item.dataset.id === id));
|
|
1092
|
+
if (sc) renderDetail(sc);
|
|
1093
|
+
if (closed.length || !document.querySelector('.tree-leaf.active')) render();
|
|
1094
|
+
document.querySelector('.tree-leaf.active')?.scrollIntoView({ block: 'nearest' });
|
|
1095
|
+
}
|
|
1096
|
+
|
|
1097
|
+
function move(direction) {
|
|
1098
|
+
const shown = visible();
|
|
1099
|
+
if (shown.length === 0) return;
|
|
1100
|
+
// Tree order: areas, then files, then scenarios, the same order as catalog.scenarios.
|
|
1101
|
+
const index = shown.findIndex((s) => s.id === state.selectedId);
|
|
1102
|
+
const next = shown[Math.min(Math.max(index + direction, 0), shown.length - 1)];
|
|
1103
|
+
select(next.id);
|
|
1104
|
+
}
|
|
1105
|
+
|
|
1106
|
+
function readHash() {
|
|
1107
|
+
const params = new URLSearchParams(location.hash.slice(1));
|
|
1108
|
+
const id = params.get('scenario');
|
|
1109
|
+
if (id && catalog.scenarios.some((s) => s.id === id)) {
|
|
1110
|
+
state.selectedId = id;
|
|
1111
|
+
branchKeys(selected()).forEach((key) => state.open.add(key));
|
|
1112
|
+
}
|
|
1113
|
+
}
|
|
1114
|
+
|
|
1115
|
+
function showEmpty(filteredOut) {
|
|
1116
|
+
$('empty-state').hidden = false;
|
|
1117
|
+
$('scenario-detail').hidden = true;
|
|
1118
|
+
$('empty-title').textContent = filteredOut ? 'Nothing matches' : 'No scenario selected';
|
|
1119
|
+
$('empty-text').textContent = filteredOut
|
|
1120
|
+
? 'No scenario matches the search and filters. Clear them to see the whole catalog.'
|
|
1121
|
+
: 'Pick a scenario in the tree to see its steps, automation status and YAML.';
|
|
1122
|
+
}
|
|
1123
|
+
|
|
1124
|
+
function renderDetail(sc) {
|
|
1125
|
+
$('empty-state').hidden = true;
|
|
1126
|
+
$('scenario-detail').hidden = false;
|
|
1127
|
+
|
|
1128
|
+
$('detail-breadcrumbs').innerHTML =
|
|
1129
|
+
`<span>${escapeHtml(catalog.title)}</span><span class="sep">/</span>` +
|
|
1130
|
+
`<span>${escapeHtml(sc.areaLabel)}</span><span class="sep">/</span>` +
|
|
1131
|
+
`<strong>${escapeHtml(sc.fileLabel)}</strong>`;
|
|
1132
|
+
$('detail-title').textContent = sc.name;
|
|
1133
|
+
|
|
1134
|
+
let chips = `<span class="chip id">${escapeHtml(sc.id)}</span>`;
|
|
1135
|
+
chips += sc.status === 'automated'
|
|
1136
|
+
? '<span class="chip automated"><span class="status-dot"></span>Automated</span>'
|
|
1137
|
+
: '<span class="chip manual"><span class="status-dot"></span>Manual</span>';
|
|
1138
|
+
if (sc.knownIssue) chips += `<span class="chip known">⚠ Known issue${sc.bug ? ` ${escapeHtml(sc.bug)}` : ''}</span>`;
|
|
1139
|
+
chips += `<span class="chip role" title="Who runs the scenario">Role: ${escapeHtml(sc.role ?? 'default')}</span>`;
|
|
1140
|
+
chips += sc.tags.map((t) => `<span class="chip tag">${escapeHtml(t)}</span>`).join('');
|
|
1141
|
+
$('detail-chips').innerHTML = chips;
|
|
1142
|
+
|
|
1143
|
+
renderBanners(sc);
|
|
1144
|
+
$('steps-count').textContent = sc.steps.length;
|
|
1145
|
+
renderSteps(sc);
|
|
1146
|
+
$('yaml-content').innerHTML = escapeHtml(sc.yaml).replace(/^(\s*-?\s*)([A-Za-z]+):/gm, '$1<span class="yaml-key">$2</span>:');
|
|
1147
|
+
switchTab(state.tab);
|
|
1148
|
+
}
|
|
1149
|
+
|
|
1150
|
+
function renderBanners(sc) {
|
|
1151
|
+
const banners = $('detail-banners');
|
|
1152
|
+
banners.innerHTML = '';
|
|
1153
|
+
const command = `npx playwright test -g "${sc.id}:"`;
|
|
1154
|
+
|
|
1155
|
+
if (sc.status === 'automated') {
|
|
1156
|
+
const specLink = `<a href="${escapeHtml(blobUrl(sc.automatedIn, sc.specLine))}" target="_blank" rel="noreferrer"><span class="code">${escapeHtml(sc.automatedIn)}${sc.specLine ? `:${sc.specLine}` : ''}</span></a>`;
|
|
1157
|
+
// GitHub can't pre-fill a manual workflow's inputs from a link, so Run on GitHub copies the title filter.
|
|
1158
|
+
const filter = `${sc.id}:`;
|
|
1159
|
+
const runHint = catalog.workflowUrl
|
|
1160
|
+
? `<br>Run on GitHub copies <span class="code">${escapeHtml(filter)}</span>: choose the area <strong>${escapeHtml(sc.area)}</strong> and paste it as the title filter (grep).`
|
|
1161
|
+
: '';
|
|
1162
|
+
const actions = [['Copy command', () => command]];
|
|
1163
|
+
if (catalog.workflowUrl) actions.push(['Run on GitHub ↗', () => filter, catalog.workflowUrl]);
|
|
1164
|
+
banners.appendChild(banner('auto', 'Automated',
|
|
1165
|
+
`Spec: ${specLink}<br>Run it locally: <span class="code">${escapeHtml(command)}</span>${runHint}`,
|
|
1166
|
+
actions));
|
|
1167
|
+
} else {
|
|
1168
|
+
const skill = catalog.layer === 'api' ? '/implement-api-scenarios' : '/implement-ui-scenarios';
|
|
1169
|
+
banners.appendChild(banner('manual', 'Manual',
|
|
1170
|
+
`Not automated yet. Run it by hand with <strong>Execute</strong> below, or automate it with <span class="code">${escapeHtml(`${skill} ${sc.id}`)}</span>.`,
|
|
1171
|
+
[]));
|
|
1172
|
+
}
|
|
1173
|
+
|
|
1174
|
+
if (sc.knownIssue) {
|
|
1175
|
+
const bugLink = sc.bug
|
|
1176
|
+
? `Bug: <a href="../../bugs/#bug=${encodeURIComponent(sc.bug)}" target="_blank" rel="noreferrer"><span class="code">${escapeHtml(sc.bug)}</span></a><br>`
|
|
1177
|
+
: '';
|
|
1178
|
+
banners.appendChild(banner('known', 'Known issue',
|
|
1179
|
+
`${bugLink}${escapeHtml(sc.knownIssue)}<br>The test is expected to fail until the app is fixed (<span class="code">test.fail</span>).`,
|
|
1180
|
+
[]));
|
|
1181
|
+
}
|
|
1182
|
+
|
|
1183
|
+
const fileLink = `<a href="${escapeHtml(blobUrl(sc.file))}" target="_blank" rel="noreferrer"><span class="code">${escapeHtml(sc.file)}</span></a>`;
|
|
1184
|
+
const refs = sc.ref.map((ref) =>
|
|
1185
|
+
ref.startsWith('docs/')
|
|
1186
|
+
? `<a href="${escapeHtml(blobUrl(ref))}" target="_blank" rel="noreferrer"><span class="code">${escapeHtml(ref)}</span></a>`
|
|
1187
|
+
: `<span class="code">${escapeHtml(ref)}</span>`);
|
|
1188
|
+
banners.appendChild(banner('refs', 'Source',
|
|
1189
|
+
`Scenario file: ${fileLink}` + (refs.length ? `<br>Comes from: ${refs.join(' ')}` : ''),
|
|
1190
|
+
[]));
|
|
1191
|
+
}
|
|
1192
|
+
|
|
1193
|
+
function banner(kind, title, descHtml, actions) {
|
|
1194
|
+
const el = document.createElement('div');
|
|
1195
|
+
el.className = `banner ${kind}`;
|
|
1196
|
+
el.innerHTML = `<div class="banner-left"><div class="banner-title">${escapeHtml(title)}</div><div class="banner-desc">${descHtml}</div></div>`;
|
|
1197
|
+
if (actions.length) {
|
|
1198
|
+
const box = document.createElement('div');
|
|
1199
|
+
box.className = 'banner-actions';
|
|
1200
|
+
// Each action copies text() to the clipboard and, when it has a URL, opens it in a new tab.
|
|
1201
|
+
for (const [label, text, url] of actions) {
|
|
1202
|
+
const button = document.createElement('button');
|
|
1203
|
+
button.type = 'button';
|
|
1204
|
+
button.className = 'btn-action';
|
|
1205
|
+
button.dataset.label = label;
|
|
1206
|
+
button.textContent = label;
|
|
1207
|
+
button.addEventListener('click', () => {
|
|
1208
|
+
copy(button, text());
|
|
1209
|
+
if (url) window.open(url, '_blank', 'noopener');
|
|
1210
|
+
});
|
|
1211
|
+
box.appendChild(button);
|
|
1212
|
+
}
|
|
1213
|
+
el.appendChild(box);
|
|
1214
|
+
}
|
|
1215
|
+
return el;
|
|
1216
|
+
}
|
|
1217
|
+
|
|
1218
|
+
function formatStep(raw) {
|
|
1219
|
+
let text = escapeHtml(raw);
|
|
1220
|
+
text = text.replace(/"(.*?)"/g, '<span class="step-token-quote">"$1"</span>');
|
|
1221
|
+
text = text.replace(/\b(GET|POST|PUT|PATCH|DELETE|QUERY) (\/[^\s,;:)]*[^\s,.;:)])/g, '<span class="step-token-endpoint">$1 $2</span>');
|
|
1222
|
+
text = text.replace(/^(Verify)\b/, '<span class="step-kw-verify">$1</span>');
|
|
1223
|
+
text = text.replace(/^(Open|Click|Select|Enter|Set|Search|Send|Create|Add|Remove|Log in|Register|Type|Check|Clear|Pick|Go to)\b/, '<span class="step-kw-action">$1</span>');
|
|
1224
|
+
return text;
|
|
1225
|
+
}
|
|
1226
|
+
|
|
1227
|
+
function renderSteps(sc) {
|
|
1228
|
+
const container = $('tab-steps');
|
|
1229
|
+
container.innerHTML = '';
|
|
1230
|
+
const executing = state.executing.has(sc.id);
|
|
1231
|
+
$('btn-execute').classList.toggle('active', executing);
|
|
1232
|
+
if (!state.done.has(sc.id)) state.done.set(sc.id, new Set());
|
|
1233
|
+
const done = state.done.get(sc.id);
|
|
1234
|
+
|
|
1235
|
+
if (sc.preconditions?.length) {
|
|
1236
|
+
const box = document.createElement('div');
|
|
1237
|
+
box.className = 'preconditions';
|
|
1238
|
+
box.innerHTML = '<div class="preconditions-title">Preconditions</div><ul>' +
|
|
1239
|
+
sc.preconditions.map((item) => `<li>${formatStep(item)}</li>`).join('') + '</ul>';
|
|
1240
|
+
container.appendChild(box);
|
|
1241
|
+
}
|
|
1242
|
+
|
|
1243
|
+
sc.steps.forEach((step, index) => {
|
|
1244
|
+
const card = document.createElement('div');
|
|
1245
|
+
card.className = `step-card${/^Verify\b/.test(step) ? ' verify' : ''}${executing && done.has(index) ? ' done' : ''}`;
|
|
1246
|
+
if (executing) {
|
|
1247
|
+
const check = document.createElement('input');
|
|
1248
|
+
check.type = 'checkbox';
|
|
1249
|
+
check.className = 'step-check';
|
|
1250
|
+
check.checked = done.has(index);
|
|
1251
|
+
check.setAttribute('aria-label', `Step ${index + 1} done`);
|
|
1252
|
+
check.addEventListener('change', () => {
|
|
1253
|
+
check.checked ? done.add(index) : done.delete(index);
|
|
1254
|
+
card.classList.toggle('done', check.checked);
|
|
1255
|
+
});
|
|
1256
|
+
card.appendChild(check);
|
|
1257
|
+
}
|
|
1258
|
+
card.insertAdjacentHTML('beforeend', `<div class="step-number">${index + 1}</div><div class="step-text">${formatStep(step)}</div>`);
|
|
1259
|
+
container.appendChild(card);
|
|
1260
|
+
});
|
|
1261
|
+
}
|
|
1262
|
+
|
|
1263
|
+
function switchTab(tab) {
|
|
1264
|
+
state.tab = tab;
|
|
1265
|
+
document.querySelectorAll('.detail-tab').forEach((t) => t.classList.toggle('active', t.dataset.tab === tab));
|
|
1266
|
+
$('tab-steps').hidden = tab !== 'steps';
|
|
1267
|
+
$('tab-yaml').hidden = tab !== 'yaml';
|
|
1268
|
+
$('btn-execute').hidden = tab !== 'steps';
|
|
1269
|
+
}
|
|
1270
|
+
|
|
1271
|
+
function copy(button, text) {
|
|
1272
|
+
const done = () => {
|
|
1273
|
+
button.classList.add('copied');
|
|
1274
|
+
button.textContent = 'Copied';
|
|
1275
|
+
setTimeout(() => {
|
|
1276
|
+
button.classList.remove('copied');
|
|
1277
|
+
button.textContent = button.dataset.label;
|
|
1278
|
+
}, 1500);
|
|
1279
|
+
};
|
|
1280
|
+
if (navigator.clipboard) navigator.clipboard.writeText(text).then(done, () => {});
|
|
1281
|
+
}
|
|
1282
|
+
|
|
1283
|
+
init();
|
|
1284
|
+
})();
|
|
1285
|
+
</script>
|
|
1286
|
+
</body>
|
|
1287
|
+
</html>
|