Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion scripts/screenshots/capture.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ import { STEADY_RASTER } from './raster.mjs'
const GALLERY = 'https://app.visualci.com/g/docspring/visualci'
const GALLERY_PATH = new URL(GALLERY).pathname

const NO_MOTION = `*, *::before, *::after {
// `html:root` outranks a single-class rule such as the app's reduced-motion `.spinner { animation: … !important }`
const NO_MOTION = `html:root *, html:root *::before, html:root *::after {
animation: none !important; transition: none !important; caret-color: transparent !important;
scroll-behavior: auto !important;
}`
Expand Down
11 changes: 8 additions & 3 deletions scripts/screenshots/journeys.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ const GITHUB = 'http://github.test:5198'
const SITE = 'https://visualci.test'
const APP = 'https://app.visualci.test'
const MCP = 'https://mcp.visualci.test'
const NO_MOTION = '*, *::before, *::after { animation: none !important; transition: none !important; caret-color: transparent !important; }'
// `html:root` outranks a single-class rule: the app's reduced-motion `.spinner { animation: … !important }` kept
// spinners turning under `*` alone (4 Dec 2026, a spinner caught mid-turn on 03-picker-refreshing)
const NO_MOTION = 'html:root *, html:root *::before, html:root *::after { animation: none !important; transition: none !important; caret-color: transparent !important; }'

await mkdir(out, { recursive: true })
const browser = await chromium.launch({ args: STEADY_RASTER })
Expand All @@ -41,8 +43,11 @@ async function journey(name, steps) {
await context.route(/^https:\/\/([a-z0-9-]+\.)*visualci\.com\//, (route) => route.fulfill({ status: 404, body: '' }))
const page = await context.newPage()
let n = 0
const shot = async (step) => {
// `syncing`: the shot is of the GitHub listing still loading. Every other shot waits for it to finish first: it runs in
// a queued job after each sign-in, and a shot that catches it loading depends on timing (4 Dec 2026, build 517)
const shot = async (step, { syncing = false } = {}) => {
await page.waitForLoadState('networkidle').catch(() => {})
if (!syncing) await page.locator('.github-sync[aria-live]').first().waitFor({ state: 'detached', timeout: 30000 })
await page.addStyleTag({ content: NO_MOTION }).catch(() => {})
await page.evaluate(() => document.fonts.ready).catch(() => {})
// Two frames, so a re-render the last request caused (a refetch after a finished import) has painted
Expand Down Expand Up @@ -527,7 +532,7 @@ await journey('sign-in-redirects-at-once-and-lists-after', async ({ page, shot }
await page.goto(`${APP}/${org}/repositories`)
await page.getByText('1–50 of 120').waitFor()
await page.getByText('Loading your repositories from GitHub…').waitFor()
await shot('picker-refreshing')
await shot('picker-refreshing', { syncing: true })
await page.getByText('Loading your repositories from GitHub…').waitFor({ state: 'detached', timeout: 25000 })

// A listing GitHub fails: said so, the last one kept, and "Try again" lists them
Expand Down
Loading