Skip to content

Commit

Permalink
test: unflake "should fail without credentials" (microsoft#27606)
Browse files Browse the repository at this point in the history
Speculative fix. The test marked as failed => we reuse the browser
without closing the context.
  • Loading branch information
yury-s authored Oct 13, 2023
1 parent d6adfee commit 80c4080
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions tests/library/browsercontext-credentials.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 }) => {
Expand Down

0 comments on commit 80c4080

Please sign in to comment.