Verify shoots the flow canvas and media tile from the Demo, not the media example
The canvas shot opens the Demo's music flow; the media shot reads the Demo's Media screen, so neither needs the `camera` dashboard.
This commit is contained in:
@@ -223,10 +223,11 @@ async function capturePanels(page, dir) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A media tile drawing what a camera published, where there is one.
|
* A media tile drawing what a camera published: the Demo's Media screen,
|
||||||
|
* whose house is drawn by a node as heat.
|
||||||
*
|
*
|
||||||
* Skipped unless the media example is seeded (root `make seed-example-media`),
|
* Skipped unless the Demo is seeded (root `make seed-hosted-demo`), since it
|
||||||
* since it is the one shot that needs a source of frames. The bytes arrive as
|
* is the one shot that needs a source of frames. The bytes arrive as
|
||||||
* a blob — pushed down the socket, or fetched with the session's credential,
|
* a blob — pushed down the socket, or fetched with the session's credential,
|
||||||
* which no `img` could carry on its own — so a `blob:` source is the proof the
|
* which no `img` could carry on its own — so a `blob:` source is the proof the
|
||||||
* whole path ran rather than that a picture is merely present.
|
* whole path ran rather than that a picture is merely present.
|
||||||
@@ -237,25 +238,23 @@ async function capturePanels(page, dir) {
|
|||||||
* where idleness only ever said the page stopped asking.
|
* where idleness only ever said the page stopped asking.
|
||||||
*/
|
*/
|
||||||
async function captureMedia(page, dir) {
|
async function captureMedia(page, dir) {
|
||||||
const answer = await page.goto(`${APP_URL}/view/camera`, {
|
const answer = await page.goto(`${APP_URL}/view/media`, {
|
||||||
waitUntil: "domcontentloaded",
|
waitUntil: "domcontentloaded",
|
||||||
})
|
})
|
||||||
if (!answer?.ok()) return
|
if (!answer?.ok()) return
|
||||||
|
|
||||||
const picture = page.locator("img[alt='Test camera']")
|
const picture = page.locator("img[alt='The house, as heat']")
|
||||||
try {
|
try {
|
||||||
await picture.waitFor({ timeout: 15000 })
|
await picture.waitFor({ timeout: 15000 })
|
||||||
await page.waitForFunction(
|
await page.waitForFunction(
|
||||||
() =>
|
() =>
|
||||||
document
|
document
|
||||||
.querySelector("img[alt='Test camera']")
|
.querySelector("img[alt='The house, as heat']")
|
||||||
?.src?.startsWith("blob:") ?? false,
|
?.src?.startsWith("blob:") ?? false,
|
||||||
{ timeout: 15000 },
|
{ timeout: 15000 },
|
||||||
)
|
)
|
||||||
} catch {
|
} catch {
|
||||||
console.warn(
|
console.warn(" media tile drew nothing — is the Demo seeded?")
|
||||||
" media tile drew nothing — is `make seed-example-media` run?",
|
|
||||||
)
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
await page.waitForTimeout(500)
|
await page.waitForTimeout(500)
|
||||||
@@ -296,7 +295,13 @@ async function captureWorkers(page, dir) {
|
|||||||
async function captureFlows(page, dir) {
|
async function captureFlows(page, dir) {
|
||||||
await page.goto(`${APP_URL}/flows`, { waitUntil: "networkidle" })
|
await page.goto(`${APP_URL}/flows`, { waitUntil: "networkidle" })
|
||||||
|
|
||||||
if (await page.getByTestId("flow-card").count()) {
|
// The Demo's music flow, where it is seeded: two nodes, live values on the
|
||||||
|
// edges and the tiles at both ends, all still legible once fitted. The house
|
||||||
|
// has fifteen nodes, which fitted to the screen read as dots.
|
||||||
|
const demo = page.locator("[data-testid=flow-card][href$='/flows/music']")
|
||||||
|
if (await demo.count()) {
|
||||||
|
await demo.click()
|
||||||
|
} else if (await page.getByTestId("flow-card").count()) {
|
||||||
await page.getByTestId("flow-card").first().click()
|
await page.getByTestId("flow-card").first().click()
|
||||||
} else {
|
} else {
|
||||||
await page.getByTestId("new-flow").click()
|
await page.getByTestId("new-flow").click()
|
||||||
|
|||||||
Reference in New Issue
Block a user