Skip to content

Commit 9d4826d

Browse files
committed
PRO-20007 fix: do nog fail run with Playwright OBJECT_NOT_BOUND error
1 parent ea23c2a commit 9d4826d

3 files changed

Lines changed: 19 additions & 3 deletions

File tree

src/constants/internal.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,11 @@ export {
6868
TMP_DIRECTORY_PATH,
6969
} from './paths';
7070
/** @internal */
71-
export {TARGET_CLOSED_ERROR_MESSAGE, TEST_ENDED_ERROR_MESSAGE} from './playwright';
71+
export {
72+
OBJECT_NOT_BOUND_ERROR_REGEXP,
73+
TARGET_CLOSED_ERROR_MESSAGE,
74+
TEST_ENDED_ERROR_MESSAGE,
75+
} from './playwright';
7276
/** @internal */
7377
export {RESOLVED_PROMISE} from './promise';
7478
/** @internal */

src/constants/playwright.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
/**
2+
* Playwright error message for some connection error.
3+
* The test fails after such an error, so it cannot be completely ignored (we write it in the warning).
4+
* @internal
5+
*/
6+
export const OBJECT_NOT_BOUND_ERROR_REGEXP =
7+
/Object with guid response@[a-zA-Z0-9]+ was not bound in the connection/;
8+
19
/**
210
* Playwright error message for already closed target (`TargetClosedError`).
311
* @internal

src/utils/getGlobalErrorHandler.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
import {TARGET_CLOSED_ERROR_MESSAGE, TEST_ENDED_ERROR_MESSAGE} from '../constants/internal';
1+
import {
2+
OBJECT_NOT_BOUND_ERROR_REGEXP,
3+
TARGET_CLOSED_ERROR_MESSAGE,
4+
TEST_ENDED_ERROR_MESSAGE,
5+
} from '../constants/internal';
26

37
import {E2edError} from './error';
48
import {writeGlobalError, writeGlobalWarning} from './fs';
@@ -24,7 +28,7 @@ export const getGlobalErrorHandler =
2428
return;
2529
}
2630

27-
if (type === 'TestUnhandledRejection') {
31+
if (type === 'TestUnhandledRejection' || OBJECT_NOT_BOUND_ERROR_REGEXP.test(errorString)) {
2832
void writeGlobalWarning(errorString).catch(() => {});
2933
} else {
3034
void writeGlobalError(errorString).catch(() => {});

0 commit comments

Comments
 (0)