Skip to content

Commit cf5849b

Browse files
Bill LeoutsakosBill Leoutsakos
authored andcommitted
Preserve browser fixture failures
Report network isolation violations without masking the original Playwright test or fixture error.
1 parent d330a42 commit cf5849b

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

apps/sim/e2e/fixtures/browser-test.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,20 @@ export const test = base.extend<BrowserFixtures>({
99
browserNetworkGuard: [
1010
async ({ context }, use) => {
1111
const guard = await installBrowserNetworkGuard(context)
12+
const failures: unknown[] = []
1213
try {
1314
await use(undefined)
14-
} finally {
15+
} catch (error) {
16+
failures.push(error)
17+
}
18+
try {
1519
guard.assertNoUnexpectedRequests()
20+
} catch (error) {
21+
failures.push(error)
22+
}
23+
if (failures.length === 1) throw failures[0]
24+
if (failures.length > 1) {
25+
throw new AggregateError(failures, 'Browser test and network isolation both failed')
1626
}
1727
},
1828
{ auto: true },

0 commit comments

Comments
 (0)