Add CONTINUE_ON_ERRORS test flag

This allows when debugging tests to avoid that the test ends before
having an opportunity to debug what really went wrong.
This commit is contained in:
Sebastian Martinez
2024-02-15 09:38:28 -03:00
parent 364844f47f
commit bdd83644a6
+8 -6
View File
@@ -57,12 +57,14 @@ export const test = base.extend<{
log(msg.text(), browserLabel, outputLog);
});
page.on("pageerror", msg => {
expect(
false,
`Test failed because there was a console error in the app: ${msg}`,
).toBeTruthy();
});
if (!process.env.CONTINUE_ON_ERRORS) {
page.on("pageerror", msg => {
expect(
false,
`Test failed because there was a console error in the app: ${msg}`,
).toBeTruthy();
});
}
if (!customAppConfig) {
// Remember: `page.addInitScript()` is run in the browser which