Skip to content

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

test: fix modernizer tests (#7553)

Pavel Feldman7fa67c920430
diff --git a/tests/assets/modernizr.html b/tests/assets/modernizr.html
index 445b788417..77981834bc 100644
--- a/tests/assets/modernizr.html
+++ b/tests/assets/modernizr.html
@@ -1,7 +1,7 @@
<script src='modernizr.js'></script>
<body></body>
<script>
-window.report = {};
+const report = {};
for (const name in Modernizr) {
if (name.startsWith('_'))
continue;
@@ -11,5 +11,6 @@ for (const name in Modernizr) {
report[name] = value;
}
document.body.style.whiteSpace = 'pre';
-document.body.textContent = JSON.stringify(window.report, undefined, 4);
-</script>
\ No newline at end of file
+document.body.textContent = JSON.stringify(report, undefined, 4);
+window.report = JSON.parse(document.body.textContent);
+</script>
diff --git a/tests/modernizr.spec.ts b/tests/modernizr.spec.ts
index 809e4c434c..3ee81e93ea 100644
--- a/tests/modernizr.spec.ts
+++ b/tests/modernizr.spec.ts
@@ -30,35 +30,6 @@ async function checkFeatures(name: string, context: any, server: any) {
}
it('safari-14-1', async ({ browser, browserName, platform, server }) => {
- it.fixme();
-
- /* macOS
- + "atRule": undefined,
- "atob-btoa": true,
- "atobbtoa": true,
- - "audio": true,
- + "audio": Object {
- + "m4a": "maybe",
- + "mp3": "probably",
- + "ogg": "",
- + "opus": "",
- + "wav": "",
- + },
- - "hairline": true,
- + "hairline": false,
- + "hasEvent": undefined,
- + "mq": undefined,
- + "testStyles": undefined,
- - "video": true,
- + "video": Object {
- + "h264": "probably",
- + "hls": "probably",
- + "ogg": "",
- + "vp9": "",
- + "webm": "",
- + },
- */
-
/* GTK
- "gamepads": true,
+ "gamepads": false,
@@ -102,7 +73,9 @@ it('safari-14-1', async ({ browser, browserName, platform, server }) => {
*/
it.skip(browserName !== 'webkit' || platform !== 'darwin');
- const context = await browser.newContext();
+ const context = await browser.newContext({
+ deviceScaleFactor: 2
+ });
await checkFeatures('safari-14-1', context, server);
});
@@ -110,17 +83,6 @@ it('mobile-safari-14-1', async ({ playwright, browser, browserName, platform, se
it.fixme();
/* macOS
- + "atRule": undefined,
- "atob-btoa": true,
- "atobbtoa": true,
- - "audio": true,
- + "audio": Object {
- + "m4a": "maybe",
- + "mp3": "probably",
- + "ogg": "",
- + "opus": "",
- + "wav": "",
- + },
- "capture": true,
+ "capture": false,
- "cssscrollbar": false,
@@ -132,34 +94,21 @@ it('mobile-safari-14-1', async ({ playwright, browser, browserName, platform, se
- "devicemotion": true,
- "deviceorientation": true,
+ "devicemotion": false,
- + "deviceorientation": falsef,
+ + "deviceorientation": false,
- "fullscreen": false,
+ "fullscreen": true,
- - "hairline": true,
- + "hairline": false,
- + "hasEvent": undefined,
"inputtypes": Object {
- "month": true,
+ "month": false,
- "week": true,
+ "week": false,
},
- + "mq": undefined,
- "notification": false,
+ "notification": true,
- "overflowscrolling": true,
+ "overflowscrolling": false,
- "pointerlock": false,
+ "pointerlock": true,
- + "testStyles": undefined,
- - "video": true,
- + "video": Object {
- + "h264": "probably",
- + "hls": "probably",
- + "ogg": "",
- + "vp9": "",
- + "webm": "",
- + },
*/
/* GTK