Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

devops: fix bidi tests (#37392)

Max Schmitt19afb365d506
diff --git a/.github/workflows/tests_bidi.yml b/.github/workflows/tests_bidi.yml
index dffc8a1d10..c4bd96a998 100644
--- a/.github/workflows/tests_bidi.yml
+++ b/.github/workflows/tests_bidi.yml
@@ -45,6 +45,8 @@ jobs:
node-version: 20
- run: npm ci
- run: npm run build
+ # Needed for video tests
+ - run: npx playwright install ffmpeg
- run: npx playwright install --with-deps chromium
if: matrix.channel == 'bidi-chromium'
- if: matrix.channel == 'moz-firefox-nightly'
diff --git a/tests/library/video.spec.ts b/tests/library/video.spec.ts
index ac39ede6e6..91ce942a67 100644
--- a/tests/library/video.spec.ts
+++ b/tests/library/video.spec.ts
@@ -23,8 +23,6 @@ import { registry } from '../../packages/playwright-core/lib/server';
import { expect, browserTest as it } from '../config/browserTest';
import { parseTraceRaw } from '../config/utils';
-const ffmpeg = registry.findExecutable('ffmpeg')!.executablePathOrDie('javascript');
-
export class VideoPlayer {
fileName: string;
output: string;
@@ -36,6 +34,7 @@ export class VideoPlayer {
constructor(fileName: string) {
this.fileName = fileName;
+ const ffmpeg = registry.findExecutable('ffmpeg')!.executablePathOrDie('javascript');
// Force output frame rate to 25 fps as otherwise it would produce one image per timebase unit
// which is 1 / (25 * 1000).
this.output = spawnSync(ffmpeg, ['-i', this.fileName, '-r', '25', `${this.fileName}-%03d.png`]).stderr.toString();