Skip to content

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

test: webm video player (#20421)

Yury Semikhatskyfaadbba63cd0
diff --git a/tests/assets/movie.webm b/tests/assets/movie.webm
new file mode 100644
index 0000000000..8f01952222
Binary files /dev/null and b/tests/assets/movie.webm differ
diff --git a/tests/assets/video_webm.html b/tests/assets/video_webm.html
new file mode 100644
index 0000000000..7d86354419
--- /dev/null
+++ b/tests/assets/video_webm.html
@@ -0,0 +1,15 @@
+<html>
+<body>
+
+<video width="400" controls>
+ <source src="movie.webm" type="video/webm">
+ Your browser does not support WebM HTML video.
+</video>
+
+<p>
+Video courtesy of
+<a href="https://www.bigbuckbunny.org/" target="_blank">Big Buck Bunny</a>.
+</p>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/tests/library/capabilities.spec.ts b/tests/library/capabilities.spec.ts
index 755d75520b..5cf09ab34b 100644
--- a/tests/library/capabilities.spec.ts
+++ b/tests/library/capabilities.spec.ts
@@ -84,6 +84,19 @@ it('should play video @smoke', async ({ page, asset, browserName, platform, mode
await page.$eval('video', v => v.pause());
});
+it('should play webm video @smoke', async ({ page, asset, browserName, platform, mode }) => {
+ it.skip(mode === 'docker', 'local paths do not work with remote setup');
+ it.fixme(browserName === 'webkit' && platform === 'darwin' && parseInt(os.release(), 10) === 20, 'Does not work on BigSur');
+ it.fixme(browserName === 'webkit' && platform === 'win32');
+
+ const absolutePath = asset('video_webm.html');
+ // Our test server doesn't support range requests required to play on Mac,
+ // so we load the page using a file url.
+ await page.goto(url.pathToFileURL(absolutePath).href);
+ await page.$eval('video', v => v.play());
+ await page.$eval('video', v => v.pause());
+});
+
it('should play audio @smoke', async ({ page, server, browserName, platform }) => {
it.fixme(browserName === 'firefox' && platform === 'win32', 'https://github.com/microsoft/playwright/issues/10887');
it.fixme(browserName === 'firefox' && platform === 'linux', 'https://github.com/microsoft/playwright/issues/10887');