Files
faunosteo/apps/app/e2e/shell/editor-measure-commit.spec.ts
T
bchanot e6f47280ad test(tests): measure commit latency on a seeded draft
Opt-in spec (MEASURE_COMMIT=1, MEASURE_BUILD=preview for the production build): vertex drag, « + » and « − » on a run-seeded equine draft, three runs each, from the pointerup to the painted frame showing the new geometry with the undo entry. Never editor-equine nor the historical copy.
2026-11-18 12:20:45 +01:00

61 lines
1.8 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { test } from '../support/browser'
import { measureCommits } from '../support/measure-commit'
import {
PREVIEW_ORIGIN,
previewMeasure,
startPreview,
} from '../support/measure-preview'
import {
dropLateReplays,
FAKE_SUPABASE_ORIGIN,
routeToSandbox,
} from '../support/sandbox'
// U2 Task 10: the hand-run commit-latency measure (support/measure-commit.ts). Skipped unless
// MEASURE_COMMIT=1: a timing figure, never a suite assertion. With MEASURE_BUILD=preview it
// runs on a production build (support/measure-preview.ts) instead of the dev server.
const preview = previewMeasure()
test.describe('commit latency measure (hand-run)', () => {
test.use({
locale: 'fr-FR',
actionTimeout: 15_000,
...(preview
? {
baseURL: PREVIEW_ORIGIN,
allowedOrigins: [PREVIEW_ORIGIN, FAKE_SUPABASE_ORIGIN],
}
: {}),
})
let stopPreview: (() => void) | null = null
test.beforeEach(async ({ context }, info) => {
test.skip(
process.env.MEASURE_COMMIT !== '1',
'run by hand: MEASURE_COMMIT=1',
)
test.skip(info.project.name !== 'chromium-desktop', 'one run, at 1 280 px')
test.setTimeout(600_000)
if (preview) stopPreview = await startPreview()
await routeToSandbox(context)
})
test.afterEach(async ({ context }) => {
await dropLateReplays(context)
stopPreview?.()
stopPreview = null
})
test('vertex drag, « + » and « − » on the equine zone, three runs each', async ({
page,
context,
}, info) => {
test.setTimeout(600_000)
const build = preview ? 'production build (vite preview)' : 'dev server'
for (const figures of await measureCommits(page, context)) {
const line = JSON.stringify({ build, ...figures })
console.log(`MEASURE ${line}`)
info.annotations.push({ type: 'measure', description: line })
}
})
})