Read the run-context shot against the flow its dashboard belongs to
The two runs were taken off the top of the unfiltered table, so the shot only showed anything while the newest runs happened to be the ones the `_results` dashboard reads. Another flow finishing a run since photographed an empty grid — every tile "No curve was recorded", every stat blank. The table is filtered to that dashboard's flow first. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CL9zvnnvcp1mvA8o7impxk
This commit is contained in:
@@ -122,16 +122,6 @@ async function captureRuns(page, dir) {
|
|||||||
await page.waitForTimeout(1500)
|
await page.waitForTimeout(1500)
|
||||||
await page.screenshot({ path: `${dir}/app-runs-compare.png`, fullPage: true })
|
await page.screenshot({ path: `${dir}/app-runs-compare.png`, fullPage: true })
|
||||||
|
|
||||||
// A dashboard read against those two runs: the same page a live run is
|
|
||||||
// watched on, showing finished ones. This is the seam the feature exists for.
|
|
||||||
const picked = await page
|
|
||||||
.getByTestId("run-link")
|
|
||||||
.evaluateAll((links) =>
|
|
||||||
links.slice(0, 2).map((a) => a.getAttribute("href")),
|
|
||||||
)
|
|
||||||
const ids = picked
|
|
||||||
.map((href) => (href || "").split("/").pop())
|
|
||||||
.filter(Boolean)
|
|
||||||
// The API is its own host here; the SPA's origin does not proxy /api.
|
// The API is its own host here; the SPA's origin does not proxy /api.
|
||||||
const apiUrl = APP_URL.replace("//app.", "//api.")
|
const apiUrl = APP_URL.replace("//app.", "//api.")
|
||||||
const results = await page.evaluate(async (base) => {
|
const results = await page.evaluate(async (base) => {
|
||||||
@@ -146,12 +136,30 @@ async function captureRuns(page, dir) {
|
|||||||
.map((one) => one.name)
|
.map((one) => one.name)
|
||||||
.find((n) => n.endsWith("_results"))
|
.find((n) => n.endsWith("_results"))
|
||||||
}, apiUrl)
|
}, apiUrl)
|
||||||
if (results && ids.length) {
|
|
||||||
await page.goto(`${APP_URL}/view/${results}?runs=${ids.join(",")}`, {
|
// A dashboard read against two runs: the same page a live run is watched
|
||||||
|
// on, showing finished ones. This is the seam the feature exists for — and
|
||||||
|
// it draws nothing unless the runs are the ones that dashboard reads, so
|
||||||
|
// the table is filtered to its flow rather than read from the top. Another
|
||||||
|
// flow's run finishing later would otherwise photograph an empty grid.
|
||||||
|
if (results) {
|
||||||
|
const flow = results.replace(/_results$/, "")
|
||||||
|
await page.goto(`${APP_URL}/runs?flow=${flow}`, {
|
||||||
waitUntil: "networkidle",
|
waitUntil: "networkidle",
|
||||||
})
|
})
|
||||||
await page.waitForTimeout(2000)
|
const ids = await page.getByTestId("run-link").evaluateAll((links) =>
|
||||||
await page.screenshot({ path: `${dir}/app-run-context.png` })
|
links
|
||||||
|
.slice(0, 2)
|
||||||
|
.map((a) => (a.getAttribute("href") || "").split("/").pop())
|
||||||
|
.filter(Boolean),
|
||||||
|
)
|
||||||
|
if (ids.length) {
|
||||||
|
await page.goto(`${APP_URL}/view/${results}?runs=${ids.join(",")}`, {
|
||||||
|
waitUntil: "networkidle",
|
||||||
|
})
|
||||||
|
await page.waitForTimeout(2000)
|
||||||
|
await page.screenshot({ path: `${dir}/app-run-context.png` })
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// The dashboard that pins the last few runs, drawn live rather than in a
|
// The dashboard that pins the last few runs, drawn live rather than in a
|
||||||
|
|||||||
Reference in New Issue
Block a user