Skip to content

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

feat(firefox-beta): roll to r1310 (#10954)

Andrey Lushnikov2957b7b013d5
diff --git a/packages/playwright-core/browsers.json b/packages/playwright-core/browsers.json
index dd4aa4222e..1e99edcc0f 100644
--- a/packages/playwright-core/browsers.json
+++ b/packages/playwright-core/browsers.json
@@ -18,7 +18,7 @@
},
{
"name": "firefox-beta",
- "revision": "1309",
+ "revision": "1310",
"installByDefault": false
},
{
diff --git a/tests/assets/empty-standard-mode.html b/tests/assets/empty-standard-mode.html
new file mode 100644
index 0000000000..0e76edd65b
--- /dev/null
+++ b/tests/assets/empty-standard-mode.html
@@ -0,0 +1 @@
+<!DOCTYPE html>
diff --git a/tests/assets/error.html b/tests/assets/error.html
index 9532d14cf7..0851c4df81 100644
--- a/tests/assets/error.html
+++ b/tests/assets/error.html
@@ -1,4 +1,4 @@
-<script>
+<!DOCTYPE html> <script>
console.error('Not a JS error');
a();
diff --git a/tests/browsercontext-add-cookies.spec.ts b/tests/browsercontext-add-cookies.spec.ts
index 6e591a5840..e4c909f4fe 100644
--- a/tests/browsercontext-add-cookies.spec.ts
+++ b/tests/browsercontext-add-cookies.spec.ts
@@ -353,7 +353,7 @@ it('should set cookies for a frame', async ({ context, page, server }) => {
expect(await page.frames()[1].evaluate('document.cookie')).toBe('frame-cookie=value');
});
-it('should(not) block third party cookies', async ({ context, page, server, browserName }) => {
+it('should(not) block third party cookies', async ({ context, page, server, browserName, browserMajorVersion }) => {
await page.goto(server.EMPTY_PAGE);
await page.evaluate(src => {
let fulfill;
@@ -366,7 +366,7 @@ it('should(not) block third party cookies', async ({ context, page, server, brow
}, server.CROSS_PROCESS_PREFIX + '/grid.html');
await page.frames()[1].evaluate(`document.cookie = 'username=John Doe'`);
await page.waitForTimeout(2000);
- const allowsThirdParty = browserName === 'firefox';
+ const allowsThirdParty = browserName === 'firefox' && browserMajorVersion < 96;
const cookies = await context.cookies(server.CROSS_PROCESS_PREFIX + '/grid.html');
if (allowsThirdParty) {
expect(cookies).toEqual([
diff --git a/tests/browsercontext-cookies.spec.ts b/tests/browsercontext-cookies.spec.ts
index 74b6061d4c..49e23e91d9 100644
--- a/tests/browsercontext-cookies.spec.ts
+++ b/tests/browsercontext-cookies.spec.ts
@@ -21,13 +21,14 @@ it('should return no cookies in pristine browser context', async ({ context, pag
expect(await context.cookies()).toEqual([]);
});
-it('should get a cookie', async ({ context, page, server, browserName }) => {
+it('should get a cookie', async ({ context, page, server, browserName, browserMajorVersion }) => {
await page.goto(server.EMPTY_PAGE);
const documentCookie = await page.evaluate(() => {
document.cookie = 'username=John Doe';
return document.cookie;
});
expect(documentCookie).toBe('username=John Doe');
+ const defaultSameSiteCookieValue = browserName === 'chromium' || (browserName === 'firefox' && browserMajorVersion >= 96) ? 'Lax' : 'None';
expect(await context.cookies()).toEqual([{
name: 'username',
value: 'John Doe',
@@ -36,11 +37,11 @@ it('should get a cookie', async ({ context, page, server, browserName }) => {
expires: -1,
httpOnly: false,
secure: false,
- sameSite: browserName === 'chromium' ? 'Lax' : 'None',
+ sameSite: defaultSameSiteCookieValue,
}]);
});
-it('should get a non-session cookie', async ({ context, page, server, browserName }) => {
+it('should get a non-session cookie', async ({ context, page, server, browserName, browserMajorVersion }) => {
await page.goto(server.EMPTY_PAGE);
// @see https://en.wikipedia.org/wiki/Year_2038_problem
const date = +(new Date('1/1/2038'));
@@ -50,6 +51,7 @@ it('should get a non-session cookie', async ({ context, page, server, browserNam
return document.cookie;
}, date);
expect(documentCookie).toBe('username=John Doe');
+ const defaultSameSiteCookieValue = browserName === 'chromium' || (browserName === 'firefox' && browserMajorVersion >= 96) ? 'Lax' : 'None';
expect(await context.cookies()).toEqual([{
name: 'username',
value: 'John Doe',
@@ -58,7 +60,7 @@ it('should get a non-session cookie', async ({ context, page, server, browserNam
expires: date / 1000,
httpOnly: false,
secure: false,
- sameSite: browserName === 'chromium' ? 'Lax' : 'None',
+ sameSite: defaultSameSiteCookieValue,
}]);
});
@@ -99,7 +101,7 @@ it('should properly report "Lax" sameSite cookie', async ({ context, page, serve
expect(cookies[0].sameSite).toBe('Lax');
});
-it('should get multiple cookies', async ({ context, page, server, browserName }) => {
+it('should get multiple cookies', async ({ context, page, server, browserName, browserMajorVersion }) => {
await page.goto(server.EMPTY_PAGE);
const documentCookie = await page.evaluate(() => {
document.cookie = 'username=John Doe';
@@ -107,6 +109,7 @@ it('should get multiple cookies', async ({ context, page, server, browserName })
return document.cookie.split('; ').sort().join('; ');
});
const cookies = new Set(await context.cookies());
+ const defaultSameSiteCookieValue = browserName === 'chromium' || (browserName === 'firefox' && browserMajorVersion >= 96) ? 'Lax' : 'None';
expect(documentCookie).toBe('password=1234; username=John Doe');
expect(cookies).toEqual(new Set([
{
@@ -117,7 +120,7 @@ it('should get multiple cookies', async ({ context, page, server, browserName })
expires: -1,
httpOnly: false,
secure: false,
- sameSite: browserName === 'chromium' ? 'Lax' : 'None',
+ sameSite: defaultSameSiteCookieValue,
},
{
name: 'username',
@@ -127,7 +130,7 @@ it('should get multiple cookies', async ({ context, page, server, browserName })
expires: -1,
httpOnly: false,
secure: false,
- sameSite: browserName === 'chromium' ? 'Lax' : 'None',
+ sameSite: defaultSameSiteCookieValue,
},
]));
});
diff --git a/tests/browsercontext-route.spec.ts b/tests/browsercontext-route.spec.ts
index 5eb528392d..a448211c98 100644
--- a/tests/browsercontext-route.spec.ts
+++ b/tests/browsercontext-route.spec.ts
@@ -108,7 +108,7 @@ it('should fall back to context.route', async ({ browser, server }) => {
await context.close();
});
-it('should support Set-Cookie header', async ({ contextFactory, server, browserName }) => {
+it('should support Set-Cookie header', async ({ contextFactory, server, browserName, browserMajorVersion }) => {
it.fixme(browserName === 'webkit');
const context = await contextFactory();
@@ -123,8 +123,9 @@ it('should support Set-Cookie header', async ({ contextFactory, server, browserN
});
});
await page.goto('https://example.com');
+ const defaultSameSiteCookieValue = browserName === 'chromium' || (browserName === 'firefox' && browserMajorVersion >= 96) ? 'Lax' : 'None';
expect(await context.cookies()).toEqual([{
- sameSite: browserName === 'chromium' ? 'Lax' : 'None',
+ sameSite: defaultSameSiteCookieValue,
name: 'name',
value: 'value',
domain: '.example.com',
@@ -153,7 +154,7 @@ it('should ignore secure Set-Cookie header for insecure requests', async ({ cont
expect(await context.cookies()).toEqual([]);
});
-it('should use Set-Cookie header in future requests', async ({ contextFactory, server, browserName }) => {
+it('should use Set-Cookie header in future requests', async ({ contextFactory, server, browserName, browserMajorVersion }) => {
it.fixme(browserName === 'webkit');
const context = await contextFactory();
@@ -169,8 +170,9 @@ it('should use Set-Cookie header in future requests', async ({ contextFactory, s
});
});
await page.goto(server.EMPTY_PAGE);
+ const defaultSameSiteCookieValue = browserName === 'chromium' || (browserName === 'firefox' && browserMajorVersion >= 96) ? 'Lax' : 'None';
expect(await context.cookies()).toEqual([{
- sameSite: browserName === 'chromium' ? 'Lax' : 'None',
+ sameSite: defaultSameSiteCookieValue,
name: 'name',
value: 'value',
domain: 'localhost',
diff --git a/tests/channels.spec.ts b/tests/channels.spec.ts
index 04d25afccc..d06a9b4f29 100644
--- a/tests/channels.spec.ts
+++ b/tests/channels.spec.ts
@@ -47,7 +47,9 @@ it('should scope context handles', async ({ browserType, server }) => {
const context = await browser.newContext();
const page = await context.newPage();
- await page.goto(server.EMPTY_PAGE);
+ // Firefox Beta 96 yields a console warning for the pages that
+ // don't use `<!DOCTYPE HTML> tag.
+ await page.goto(server.PREFIX + '/empty-standard-mode.html');
await expectScopeState(browser, {
_guid: '',
objects: [
diff --git a/tests/defaultbrowsercontext-1.spec.ts b/tests/defaultbrowsercontext-1.spec.ts
index 035490f6db..1b96722c97 100644
--- a/tests/defaultbrowsercontext-1.spec.ts
+++ b/tests/defaultbrowsercontext-1.spec.ts
@@ -19,7 +19,7 @@ import { playwrightTest as it, expect } from './config/browserTest';
import { verifyViewport } from './config/utils';
import fs from 'fs';
-it('context.cookies() should work', async ({ server, launchPersistent, browserName }) => {
+it('context.cookies() should work', async ({ server, launchPersistent, browserName, browserMajorVersion }) => {
const { page } = await launchPersistent();
await page.goto(server.EMPTY_PAGE);
const documentCookie = await page.evaluate(() => {
@@ -27,6 +27,7 @@ it('context.cookies() should work', async ({ server, launchPersistent, browserNa
return document.cookie;
});
expect(documentCookie).toBe('username=John Doe');
+ const defaultSameSiteCookieValue = browserName === 'chromium' || (browserName === 'firefox' && browserMajorVersion >= 96) ? 'Lax' : 'None';
expect(await page.context().cookies()).toEqual([{
name: 'username',
value: 'John Doe',
@@ -35,7 +36,7 @@ it('context.cookies() should work', async ({ server, launchPersistent, browserNa
expires: -1,
httpOnly: false,
secure: false,
- sameSite: browserName === 'chromium' ? 'Lax' : 'None',
+ sameSite: defaultSameSiteCookieValue,
}]);
});
@@ -80,7 +81,7 @@ it('context.clearCookies() should work', async ({ server, launchPersistent }) =>
expect(await page.evaluate('document.cookie')).toBe('');
});
-it('should(not) block third party cookies', async ({ server, launchPersistent, browserName }) => {
+it('should(not) block third party cookies', async ({ server, launchPersistent, browserName, browserMajorVersion }) => {
const { page, context } = await launchPersistent();
await page.goto(server.EMPTY_PAGE);
await page.evaluate(src => {
@@ -97,7 +98,7 @@ it('should(not) block third party cookies', async ({ server, launchPersistent, b
return document.cookie;
});
await page.waitForTimeout(2000);
- const allowsThirdParty = browserName === 'firefox';
+ const allowsThirdParty = browserName === 'firefox' && browserMajorVersion <= 95;
expect(documentCookie).toBe(allowsThirdParty ? 'username=John Doe' : '');
const cookies = await context.cookies(server.CROSS_PROCESS_PREFIX + '/grid.html');
if (allowsThirdParty) {
diff --git a/tests/headful.spec.ts b/tests/headful.spec.ts
index 1ff26be39e..bc2043666c 100644
--- a/tests/headful.spec.ts
+++ b/tests/headful.spec.ts
@@ -67,7 +67,7 @@ it('should close browser after context menu was triggered', async ({ browserType
await browser.close();
});
-it('should(not) block third party cookies', async ({ browserType, server, browserName }) => {
+it('should(not) block third party cookies', async ({ browserType, server, browserName, browserMajorVersion }) => {
const browser = await browserType.launch({ headless: false });
const page = await browser.newPage();
await page.goto(server.EMPTY_PAGE);
@@ -85,7 +85,7 @@ it('should(not) block third party cookies', async ({ browserType, server, browse
return document.cookie;
});
await page.waitForTimeout(2000);
- const allowsThirdParty = browserName === 'firefox';
+ const allowsThirdParty = browserName === 'firefox' && browserMajorVersion <= 95;
expect(documentCookie).toBe(allowsThirdParty ? 'username=John Doe' : '');
const cookies = await page.context().cookies(server.CROSS_PROCESS_PREFIX + '/grid.html');
if (allowsThirdParty) {
diff --git a/tests/page/wheel.spec.ts b/tests/page/wheel.spec.ts
index e2949c57f2..adeef68356 100644
--- a/tests/page/wheel.spec.ts
+++ b/tests/page/wheel.spec.ts
@@ -104,9 +104,9 @@ it('should work when the event is canceled', async ({ page }) => {
altKey: false,
metaKey: false,
});
- // give the page a chacne to scroll
+ // Give the page a chance to scroll.
await page.waitForTimeout(100);
- // ensure that it did not.
+ // Ensure that it did not.
expect(await page.evaluate('window.scrollY')).toBe(0);
});