diff --git a/src/libs/E2E/reactNativeLaunchingTest.ts b/src/libs/E2E/reactNativeLaunchingTest.ts index 931b41524696..31faa803ec61 100644 --- a/src/libs/E2E/reactNativeLaunchingTest.ts +++ b/src/libs/E2E/reactNativeLaunchingTest.ts @@ -68,6 +68,7 @@ E2EClient.getTestConfig() return E2EClient.submitTestResults({ name: config.name, error: `Test '${config.name}' not found`, + critical: false, }); } diff --git a/src/libs/E2E/types.ts b/src/libs/E2E/types.ts index 5185a75625a3..3cb33e3bbce3 100644 --- a/src/libs/E2E/types.ts +++ b/src/libs/E2E/types.ts @@ -39,6 +39,12 @@ type TestResult = { /** Optional, if set indicates that the test run failed and has no valid results. */ error?: string; + /** + * Whether error is critical. If `true`, then server will be stopped and `e2e` tests will fail. Otherwise will simply log a warning. + * Default value is `true` + */ + critical?: boolean; + /** Render count */ renderCount?: number; }; diff --git a/tests/e2e/testRunner.ts b/tests/e2e/testRunner.ts index 5edc8c068229..8d898321309e 100644 --- a/tests/e2e/testRunner.ts +++ b/tests/e2e/testRunner.ts @@ -93,9 +93,14 @@ const runTests = async (): Promise => { // Collect results while tests are being executed server.addTestResultListener((testResult) => { - if (testResult?.error != null) { + const {critical = true} = testResult; + + if (testResult?.error != null && critical) { throw new Error(`Test '${testResult.name}' failed with error: ${testResult.error}`); } + if (testResult?.error != null && !critical) { + Logger.warn(`Test '${testResult.name}' failed with error: ${testResult.error}`); + } let result = 0; if (testResult?.duration !== undefined) {