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
feat(auth): fix firefox auth flake (#1525)
Pavel Feldman5bde0b59b5e4
diff --git a/package.json b/package.jsonindex 69ac69add1..916be2540f 100644--- a/package.json+++ b/package.json@@ -9,7 +9,7 @@"main": "index.js","playwright": {"chromium_revision": "751710",- "firefox_revision": "1051",+ "firefox_revision": "1054","webkit_revision": "1182"},"scripts": {diff --git a/test/browsercontext.spec.js b/test/browsercontext.spec.jsindex 01afa4870c..d733fd53cb 100644--- a/test/browsercontext.spec.js+++ b/test/browsercontext.spec.js@@ -421,8 +421,7 @@ module.exports.describe = function({testRunner, expect, playwright, CHROMIUM, FFexpect(response.status()).toBe(200);await context.close();});- // flaky: https://github.com/microsoft/playwright/pull/1301/checks?check_run_id=496478707- it.fail(FFOX && LINUX)('should fail if wrong credentials', async({browser, server}) => {+ it('should fail if wrong credentials', async({browser, server}) => {server.setAuth('/empty.html', 'user', 'pass');const context = await browser.newContext({httpCredentials: { username: 'foo', password: 'bar' }@@ -438,8 +437,7 @@ module.exports.describe = function({testRunner, expect, playwright, CHROMIUM, FFexpect(response.status()).toBe(200);await context.close();});- // flaky: https://github.com/microsoft/playwright/pull/1320/checks?check_run_id=498666394- it.fail(FFOX && LINUX)('should allow disable authentication', async({browser, server}) => {+ it('should allow disable authentication', async({browser, server}) => {server.setAuth('/empty.html', 'user', 'pass');const context = await browser.newContext({httpCredentials: { username: 'user', password: 'pass' }@@ -453,6 +451,18 @@ module.exports.describe = function({testRunner, expect, playwright, CHROMIUM, FFexpect(response.status()).toBe(401);await context.close();});+ it('should return resource body', async({browser, server}) => {+ server.setAuth('/playground.html', 'user', 'pass');+ const context = await browser.newContext({+ httpCredentials: { username: 'user', password: 'pass' }+ });+ const page = await context.newPage();+ let response = await page.goto(server.PREFIX + '/playground.html');+ expect(response.status()).toBe(200);+ expect(await page.title()).toBe("Playground");+ expect((await response.body()).toString()).toContain("Playground");+ await context.close();+ });});describe('BrowserContext.setOffline', function() {diff --git a/test/navigation.spec.js b/test/navigation.spec.jsindex 0c7cc92396..0d1f132ffa 100644--- a/test/navigation.spec.js+++ b/test/navigation.spec.js@@ -103,7 +103,8 @@ module.exports.describe = function({testRunner, expect, playwright, MAC, WIN, FFit('should work with redirects', async({page, server}) => {server.setRedirect('/redirect/1.html', '/redirect/2.html');server.setRedirect('/redirect/2.html', '/empty.html');- await page.goto(server.PREFIX + '/redirect/1.html');+ const response = await page.goto(server.PREFIX + '/redirect/1.html');+ expect(response.status()).toBe(200);expect(page.url()).toBe(server.EMPTY_PAGE);});it('should navigate to about:blank', async({page, server}) => {