| 225 | |
| 226 | /** Alles, was der Assistent gerade zeigt, in einem Zug abgelesen. */ |
| 227 | const wizardSeam = (page) => |
| 228 | page.evaluate(() => { |
| 229 | const panel = document.querySelector('[data-testid="atlas-bugwizard"]'); |
| 230 | const text = (id) => |
| 231 | document.querySelector(`[data-testid="${id}"]`)?.textContent?.replace(/\s+/g, ' ').trim() ?? ''; |
| 232 | const list = (id) => [...document.querySelectorAll(`[data-testid="${id}"]`)]; |
| 233 | return { |
| 234 | status: panel?.getAttribute('data-status') ?? '', |
| 235 | target: panel?.getAttribute('data-target') ?? '', |
| 236 | events: Number(panel?.getAttribute('data-events') ?? '0'), |
| 237 | staticPaths: Number(panel?.getAttribute('data-static-paths') ?? '0'), |
| 238 | observedPaths: Number(panel?.getAttribute('data-observed-paths') ?? '0'), |
| 239 | staticOnly: Number(panel?.getAttribute('data-static-only') ?? '0'), |
| 240 | runtimeOnly: Number(panel?.getAttribute('data-runtime-only') ?? '0'), |
| 241 | staticChains: list('atlas-bugwizard-static-chain').map((node) => |
| 242 | [...node.querySelectorAll('[data-testid="atlas-bugwizard-hop"], [data-testid="atlas-bugwizard-observed-hop"]')] |
| 243 | .map((hop) => hop.getAttribute('data-name')), |
| 244 | ), |
| 245 | observedChains: list('atlas-bugwizard-observed-chain').map((node) => |
| 246 | [...node.querySelectorAll('[data-testid="atlas-bugwizard-hop"], [data-testid="atlas-bugwizard-observed-hop"]')] |
| 247 | .map((hop) => hop.getAttribute('data-name')), |
| 248 | ), |
| 249 | observedHops: list('atlas-bugwizard-observed-hop').map((node) => ({ |
| 250 | name: node.getAttribute('data-name'), |
| 251 | count: Number(node.getAttribute('data-count') ?? '0'), |
| 252 | label: node.getAttribute('data-label') ?? '', |
| 253 | lastSeen: node.getAttribute('data-last-seen') ?? '', |
| 254 | })), |
| 255 | edges: list('atlas-bugwizard-edge').map((node) => ({ |
| 256 | kind: node.getAttribute('data-kind'), |
| 257 | from: node.getAttribute('data-from'), |
| 258 | to: node.getAttribute('data-to'), |
| 259 | verdict: |
| 260 | node.querySelector('[data-testid="atlas-bugwizard-edge-verdict"]')?.textContent?.trim() ?? '', |
| 261 | })), |
| 262 | noTraces: { |
| 263 | present: document.querySelector('[data-testid="atlas-bugwizard-no-traces"]') !== null, |
| 264 | message: text('atlas-bugwizard-no-traces-message'), |
| 265 | how: text('atlas-bugwizard-no-traces-how'), |
| 266 | command: text('atlas-bugwizard-no-traces-command'), |
| 267 | format: text('atlas-bugwizard-no-traces-format'), |
| 268 | where: text('atlas-bugwizard-no-traces-where'), |
| 269 | }, |
| 270 | noDivergence: text('atlas-bugwizard-no-divergence'), |
| 271 | truncated: text('atlas-bugwizard-truncated'), |
| 272 | }; |
| 273 | }); |
| 274 | |
| 275 | /** Alles, was die Aenderungsansicht gerade zeigt. */ |
| 276 | const impactSeam = (page) => |