diff --git a/src/libs/E2E/reactNativeLaunchingTest.ts b/src/libs/E2E/reactNativeLaunchingTest.ts index f61bee8dae6a..f952998f0aad 100644 --- a/src/libs/E2E/reactNativeLaunchingTest.ts +++ b/src/libs/E2E/reactNativeLaunchingTest.ts @@ -36,7 +36,6 @@ const tests: Tests = { [E2EConfig.TEST_NAMES.ChatOpening]: require('./tests/chatOpeningTest.e2e').default, [E2EConfig.TEST_NAMES.ReportTyping]: require('./tests/reportTypingTest.e2e').default, [E2EConfig.TEST_NAMES.Linking]: require('./tests/linkingTest.e2e').default, - [E2EConfig.TEST_NAMES.PreloadedLinking]: require('./tests/preloadedLinkingTest.e2e').default, }; // Once we receive the TII measurement we know that the app is initialized and ready to be used: diff --git a/src/libs/E2E/tests/preloadedLinkingTest.e2e.ts b/src/libs/E2E/tests/preloadedLinkingTest.e2e.ts deleted file mode 100644 index a36200b1a702..000000000000 --- a/src/libs/E2E/tests/preloadedLinkingTest.e2e.ts +++ /dev/null @@ -1,82 +0,0 @@ -import {DeviceEventEmitter} from 'react-native'; -import type {NativeConfig} from 'react-native-config'; -import Config from 'react-native-config'; -import Timing from '@libs/actions/Timing'; -import E2ELogin from '@libs/E2E/actions/e2eLogin'; -import waitForAppLoaded from '@libs/E2E/actions/waitForAppLoaded'; -import E2EClient from '@libs/E2E/client'; -import getConfigValueOrThrow from '@libs/E2E/utils/getConfigValueOrThrow'; -import getPromiseWithResolve from '@libs/E2E/utils/getPromiseWithResolve'; -import Navigation from '@libs/Navigation/Navigation'; -import Performance from '@libs/Performance'; -import CONST from '@src/CONST'; -import ROUTES from '@src/ROUTES'; - -type ViewableItem = { - reportActionID?: string; -}; -type ViewableItemResponse = Array<{item?: ViewableItem}>; - -const test = (config: NativeConfig) => { - console.debug('[E2E] Logging in for comment linking'); - - const reportID = getConfigValueOrThrow('reportID', config); - const linkedReportActionID = getConfigValueOrThrow('linkedReportActionID', config); - - E2ELogin().then((neededLogin) => { - if (neededLogin) { - return waitForAppLoaded().then(() => E2EClient.submitTestDone()); - } - - const [appearMessagePromise, appearMessageResolve] = getPromiseWithResolve(); - const [switchReportPromise, switchReportResolve] = getPromiseWithResolve(); - - Promise.all([appearMessagePromise, switchReportPromise]) - .then(() => { - console.debug('[E2E] Test completed successfully, exiting…'); - E2EClient.submitTestDone(); - }) - .catch((err) => { - console.debug('[E2E] Error while submitting test results:', err); - }); - - const subscription = DeviceEventEmitter.addListener('onViewableItemsChanged', (res: ViewableItemResponse) => { - console.debug('[E2E] Viewable items retrieved, verifying correct message…', res); - if (!!res && res?.[0]?.item?.reportActionID === linkedReportActionID) { - appearMessageResolve(); - subscription.remove(); - } else { - console.debug(`[E2E] Provided message id '${res?.[0]?.item?.reportActionID}' doesn't match to an expected '${linkedReportActionID}'. Waiting for a next one…`); - } - }); - - Performance.subscribeToMeasurements((entry) => { - if (entry.name === CONST.TIMING.SIDEBAR_LOADED) { - console.debug('[E2E] Sidebar loaded, navigating to a report…'); - Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(reportID)); - return; - } - - if (entry.name === CONST.TIMING.REPORT_INITIAL_RENDER) { - console.debug('[E2E] Navigating to linked report action…'); - Timing.start(CONST.TIMING.SWITCH_REPORT); - Performance.markStart(CONST.TIMING.SWITCH_REPORT); - - Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(reportID, linkedReportActionID)); - return; - } - - if (entry.name === CONST.TIMING.CHAT_RENDER) { - E2EClient.submitTestResults({ - branch: Config.E2E_BRANCH, - name: 'Comment linking', - metric: entry.duration, - }); - - switchReportResolve(); - } - }); - }); -}; - -export default test; diff --git a/tests/e2e/config.ts b/tests/e2e/config.ts index 9241463f6a0c..8963e07c31c8 100644 --- a/tests/e2e/config.ts +++ b/tests/e2e/config.ts @@ -8,7 +8,6 @@ const TEST_NAMES = { ReportTyping: 'Report typing', ChatOpening: 'Chat opening', Linking: 'Linking', - PreloadedLinking: 'Preloaded linking', }; /** @@ -90,7 +89,6 @@ export default { // #announce Chat with many messages reportID: '5421294415618529', }, - // linking from chat A to a specific message in chat B [TEST_NAMES.Linking]: { name: TEST_NAMES.Linking, reportScreen: { @@ -101,16 +99,6 @@ export default { linkedReportID: '5421294415618529', linkedReportActionID: '2845024374735019929', }, - // linking from chat A to a specific message in the same chat A - [TEST_NAMES.PreloadedLinking]: { - name: TEST_NAMES.PreloadedLinking, - reportScreen: { - autoFocus: true, - }, - // Crowded Policy (Do Not Delete) Report, has a input bar available: - reportID: '5421294415618529', - linkedReportActionID: '8984197495983183608', // Message 4897 - }, }, };