Repository navigation
Description
Version
1.62.1
Steps to reproduce
page.screencast.start()'s type definition still lists an annotate option, but that option was removed from the implementation in #39852 (shipped in v1.59.0). The type change was missed, so annotate is accepted by TypeScript while being silently ignored at runtime.
Minimal reproduction:
// annotate.spec.ts
import { test } from '@playwright/test';
test('screencast.start accepts annotate but ignores it', async ({ page }) => {
// `annotate` is declared on Screencast.start() in types.d.ts, so this COMPILES with no type error:
await page.screencast.start({
path: 'video.webm',
size: { width: 760, height: 420 },
annotate: { position: 'top-left', fontSize: 30 }, // ← removed from the runtime in #39852
});
// Add the supported API for comparison — this one DOES draw labels:
await page.screencast.showActions({ position: 'top-right' });
await page.setContent('<button style="margin:150px">Click me</button>');
await page.getByRole('button').click(); // would be labelled if `annotate` worked
await page.screencast.stop();
});Run it, then open video.webm:
showActionslabels appear in the top-right.annotate: { position: 'top-left' }produces nothing in the top-left, andstart()throws no error.
Expected behavior
The public types should match the implementation. Since annotate was intentionally removed from Screencast.start() (#39852), it should also be removed from packages/playwright-core/types/types.d.ts so TypeScript no longer offers/accepts a non-functional option. (Alternatively, if annotate on start() was meant to stay, restore the runtime support.)
Actual behavior
Screencast.start() still declares annotate in types.d.ts, so it type-checks and autocompletes, but it is never read by the client, never sent over the protocol, and has no effect on the recording. No error is raised, the option is silently dropped.
The removal PR #39852 cleaned annotate out of every layer except the generated types.
packages/playwright-core/types/types.d.ts was not part of that commit, so the option lingers there. On current main, start() in types.d.ts still has annotate, while client/screencast.ts start() does not read it.
Additional context
- Added: feat(api): add annotate option for video and screencast #39783
- Removed: chore(screencast): remove annotate option from Screencast.start API #39852
Environment
System:
OS: macOS 26.5
CPU: (10) arm64 Apple M4
Memory: 157.97 MB / 16.00 GB
Binaries:
Node: 24.13.0 - /Users/manas/.local/share/mise/installs/node/24.13.0/bin/node
Yarn: 1.22.22 - /Users/manas/.local/share/mise/installs/node/24.13.0/bin/yarn
npm: 11.6.2 - /Users/manas/.local/share/mise/installs/node/24.13.0/bin/npm
npmPackages:
@playwright/test: ^1.62.1 => 1.62.1
Activity
manask-pradhan commentedon Aug 13, 2026
I'd like to work on this.
Root cause: the stale
annotateisn't coming from the API docs (those were cleaned in #39852) it's still declared in theScreencast.start()override inutils/generate_types/overrides.d.ts, which the removal missed. Sincetypes.d.tsis generated, that override re-emitsannotateon every regen.Fix: drop the
annotateblock from that override and regenerate the types (node utils/generate_types/).Could this be assigned to me?