CI / skip-ci-check (pull_request) Successful in 30s
CI / python-lint (pull_request) Successful in 32s
CI / docker-ci (pull_request) Successful in 31s
CI / secret-scan (pull_request) Successful in 35s
CI / viewer-unit (pull_request) Successful in 2m51s
CI / admin-unit (pull_request) Successful in 3m7s
CI / e2e (pull_request) Failing after 3m6s
34 lines
1.1 KiB
TypeScript
34 lines
1.1 KiB
TypeScript
import { test } from '../fixtures';
|
|
import { BUDGET_MS, expectWithinBudget } from '../timing-budgets';
|
|
import {
|
|
CWV_BUDGET,
|
|
expectWithinCwvBudget,
|
|
installWebVitalsCollector,
|
|
readWebVitals,
|
|
} from '../web-vitals-budgets';
|
|
|
|
test.describe.skip('viewer web vitals @smoke', () => {
|
|
test.beforeEach(async ({ page }) => {
|
|
await installWebVitalsCollector(page);
|
|
});
|
|
|
|
test('home gallery LCP and CLS within budget', async ({ page, playkitConfig, timings }) => {
|
|
await timings.measure('open_gallery_cwv', async () => {
|
|
await page.goto(`${playkitConfig.baseUrl}/`);
|
|
await page
|
|
.getByLabel('Account menu')
|
|
.or(page.getByRole('button', { name: /Sign in/i }))
|
|
.first()
|
|
.waitFor({ state: 'visible', timeout: 20_000 });
|
|
});
|
|
expectWithinBudget(timings, 'open_gallery_cwv', BUDGET_MS.uiAction);
|
|
|
|
const vitals = await readWebVitals(page);
|
|
expectWithinCwvBudget(vitals);
|
|
test.info().annotations.push({
|
|
type: 'cwv',
|
|
description: `LCP=${Math.round(vitals.lcp)}ms CLS=${vitals.cls.toFixed(3)} budgets LCP<=${CWV_BUDGET.lcp} CLS<=${CWV_BUDGET.cls}`,
|
|
});
|
|
});
|
|
});
|