test: unflake "should fail without credentials" (#27606)

Speculative fix. The test marked as failed => we reuse the browser
without closing the context.
This commit is contained in:
Yury Semikhatsky 2023-10-13 14:15:12 -07:00 committed by GitHub
parent d6adfee7c0
commit 80c408023e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -30,9 +30,12 @@ it('should fail without credentials', async ({ browser, server, isChromiumHeaded
server.setAuth('/empty.html', 'user', 'pass');
const context = await browser.newContext();
const page = await context.newPage();
const response = await page.goto(server.EMPTY_PAGE);
expect(response.status()).toBe(401);
await context.close();
try {
const response = await page.goto(server.EMPTY_PAGE);
expect(response.status()).toBe(401);
} finally {
await context.close();
}
});
it('should work with setHTTPCredentials', async ({ browser, server, isChromiumHeadedLike }) => {