Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/constants/internal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,11 @@ export {
TMP_DIRECTORY_PATH,
} from './paths';
/** @internal */
export {TARGET_CLOSED_ERROR_MESSAGE, TEST_ENDED_ERROR_MESSAGE} from './playwright';
export {
OBJECT_NOT_BOUND_ERROR_REGEXP,
TARGET_CLOSED_ERROR_MESSAGE,
TEST_ENDED_ERROR_MESSAGE,
} from './playwright';
/** @internal */
export {RESOLVED_PROMISE} from './promise';
/** @internal */
Expand Down
8 changes: 8 additions & 0 deletions src/constants/playwright.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/**
* Playwright error message for some connection error.
* The test fails after such an error, so it cannot be completely ignored (we write it in the warning).
* @internal
*/
export const OBJECT_NOT_BOUND_ERROR_REGEXP =
/Object with guid response@[a-zA-Z0-9]+ was not bound in the connection/;

/**
* Playwright error message for already closed target (`TargetClosedError`).
* @internal
Expand Down
2 changes: 1 addition & 1 deletion src/utils/end/endE2ed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export const endE2ed = (definedEndE2edReason: EndE2edReason): void => {
setEndE2edReason(definedEndE2edReason);

if (testsSubprocess?.killed === false) {
console.log('Kill tests subprocess');
console.log(`Kill tests subprocess (reason: ${definedEndE2edReason})`);

testsSubprocess.kill();
}
Expand Down
8 changes: 6 additions & 2 deletions src/utils/getGlobalErrorHandler.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import {TARGET_CLOSED_ERROR_MESSAGE, TEST_ENDED_ERROR_MESSAGE} from '../constants/internal';
import {
OBJECT_NOT_BOUND_ERROR_REGEXP,
TARGET_CLOSED_ERROR_MESSAGE,
TEST_ENDED_ERROR_MESSAGE,
} from '../constants/internal';

import {E2edError} from './error';
import {writeGlobalError, writeGlobalWarning} from './fs';
Expand All @@ -24,7 +28,7 @@ export const getGlobalErrorHandler =
return;
}

if (type === 'TestUnhandledRejection') {
if (type === 'TestUnhandledRejection' || OBJECT_NOT_BOUND_ERROR_REGEXP.test(errorString)) {
void writeGlobalWarning(errorString).catch(() => {});
} else {
void writeGlobalError(errorString).catch(() => {});
Expand Down
Loading