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:
parent
d6adfee7c0
commit
80c408023e
|
|
@ -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 }) => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue