Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.
TypeScript automationchromechromiume2e-testingelectronend-to-end-testingfirefoxjavascriptplaywrighttesttest-automationtestingtesting-toolswebwebkit
docs(page): add missing docs on emulateMedia (#6322)
Darío Kondratiukdec973611c08
diff --git a/docs/src/api/class-page.md b/docs/src/api/class-page.mdindex 16cbe5bc81..4184b8f4bf 100644--- a/docs/src/api/class-page.md+++ b/docs/src/api/class-page.md@@ -732,6 +732,8 @@ Optional event-specific initialization properties.## async method: Page.emulateMedia+This method changes the `CSS media type` through the `media` argument, and/or the `'prefers-colors-scheme'` media feature, using the `colorScheme` argument.+```jsawait page.evaluate(() => matchMedia('screen').matches);// → truediff --git a/types/types.d.ts b/types/types.d.tsindex 693a1520fb..23dfe075a6 100644--- a/types/types.d.ts+++ b/types/types.d.ts@@ -1632,6 +1632,9 @@ export interface Page {}): Promise<void>;/**+ * This method changes the `CSS media type` through the `media` argument, and/or the `'prefers-colors-scheme'` media+ * feature, using the `colorScheme` argument.+ ** ```js* await page.evaluate(() => matchMedia('screen').matches);* // → true