diff --git a/app/components/UI/AssetOverview/AssetOverview.tsx b/app/components/UI/AssetOverview/AssetOverview.tsx index d6266bfbd57..2833c18f8ef 100644 --- a/app/components/UI/AssetOverview/AssetOverview.tsx +++ b/app/components/UI/AssetOverview/AssetOverview.tsx @@ -1,10 +1,9 @@ import { zeroAddress } from 'ethereumjs-util'; import React, { useCallback, useEffect } from 'react'; -import { Platform, TouchableOpacity, View } from 'react-native'; +import { TouchableOpacity, View } from 'react-native'; import { useDispatch, useSelector } from 'react-redux'; import { strings } from '../../../../locales/i18n'; -import { TOKEN_ASSET_OVERVIEW } from '../../../../wdio/screen-objects/testIDs/Screens/TokenOverviewScreen.testIds'; -import generateTestId from '../../../../wdio/utils/generateTestId'; +import { TokenOverviewSelectorsIDs } from '../../../../e2e/selectors/TokenOverview.selectors'; import { newAssetTransaction } from '../../../actions/transaction'; import AppConstants from '../../../core/AppConstants'; import Engine from '../../../core/Engine'; @@ -261,7 +260,7 @@ const AssetOverview: React.FC = ({ return ( {asset.hasBalanceError ? ( renderWarning() diff --git a/app/components/UI/AssetOverview/Price/Price.tsx b/app/components/UI/AssetOverview/Price/Price.tsx index f297a40115f..9d95b9e17b5 100644 --- a/app/components/UI/AssetOverview/Price/Price.tsx +++ b/app/components/UI/AssetOverview/Price/Price.tsx @@ -17,7 +17,7 @@ import Text, { import PriceChart from '../PriceChart/PriceChart'; import { distributeDataPoints } from '../PriceChart/utils'; import styleSheet from './Price.styles'; -import { TOKEN_PRICE } from '../../../../../wdio/screen-objects/testIDs/Screens/TokenOverviewScreen.testIds'; +import { TokenOverviewSelectorsIDs } from '../../../../../e2e/selectors/TokenOverview.selectors'; import { TokenI } from '../../Tokens/types'; interface PriceProps { @@ -90,7 +90,7 @@ const Price = ({ {asset.symbol} )} {!isNaN(price) && ( - + {isLoading ? ( diff --git a/app/components/UI/Navbar/index.js b/app/components/UI/Navbar/index.js index fd8aa98b1f8..aeda7315f1d 100644 --- a/app/components/UI/Navbar/index.js +++ b/app/components/UI/Navbar/index.js @@ -1118,7 +1118,7 @@ export function getImportTokenNavbarOptions( // eslint-disable-next-line react/jsx-no-bind navigation.pop()} style={styles.backButton} - testID={ImportTokenViewSelectorsIDs.BACK_BUTTON} + testID={CommonSelectorsIDs.BACK_ARROW_BUTTON} > navigation.pop()} style={styles.backButton} - testID={ImportTokenViewSelectorsIDs.BACK_BUTTON} + testID={CommonSelectorsIDs.BACK_ARROW_BUTTON} > - + {!this.state.ready || this.props.loading ? this.renderLoader() : this.renderList()} diff --git a/app/components/Views/Asset/__snapshots__/index.test.js.snap b/app/components/Views/Asset/__snapshots__/index.test.js.snap index 48af7238227..627aedf5a32 100644 --- a/app/components/Views/Asset/__snapshots__/index.test.js.snap +++ b/app/components/Views/Asset/__snapshots__/index.test.js.snap @@ -16,7 +16,6 @@ exports[`Asset should render correctly 1`] = ` "flex": 1, } } - testID="txn-screen" > { const mockOnBuy = jest.fn(); @@ -49,35 +43,35 @@ describe('AssetDetailsActions', () => { it('calls onBuy when the buy button is pressed', () => { const { getByTestId } = render(); - fireEvent.press(getByTestId(TOKEN_OVERVIEW_BUY_BUTTON)); + fireEvent.press(getByTestId(TokenOverviewSelectorsIDs.BUY_BUTTON)); expect(mockOnBuy).toHaveBeenCalled(); }); it('calls goToSwaps when the swap button is pressed', () => { const { getByTestId } = render(); - fireEvent.press(getByTestId(TOKEN_OVERVIEW_SWAP_BUTTON)); + fireEvent.press(getByTestId(TokenOverviewSelectorsIDs.SWAP_BUTTON)); expect(mockGoToSwaps).toHaveBeenCalled(); }); it('calls goToBridge when the bridge button is pressed', () => { const { getByTestId } = render(); - fireEvent.press(getByTestId(TOKEN_OVERVIEW_BRIDGE_BUTTON)); + fireEvent.press(getByTestId(TokenOverviewSelectorsIDs.BRIDGE_BUTTON)); expect(mockGoToBridge).toHaveBeenCalled(); }); it('calls onSend when the send button is pressed', () => { const { getByTestId } = render(); - fireEvent.press(getByTestId(TOKEN_OVERVIEW_SEND_BUTTON)); + fireEvent.press(getByTestId(TokenOverviewSelectorsIDs.SEND_BUTTON)); expect(mockOnSend).toHaveBeenCalled(); }); it('calls onReceive when the receive button is pressed', () => { const { getByTestId } = render(); - fireEvent.press(getByTestId(TOKEN_OVERVIEW_RECEIVE_BUTTON)); + fireEvent.press(getByTestId(TokenOverviewSelectorsIDs.RECEIVE_BUTTON)); expect(mockOnReceive).toHaveBeenCalled(); }); diff --git a/app/components/Views/AssetDetails/AssetDetailsActions/AssetDetailsActions.tsx b/app/components/Views/AssetDetails/AssetDetailsActions/AssetDetailsActions.tsx index ef3ed101777..c1919568a7c 100644 --- a/app/components/Views/AssetDetails/AssetDetailsActions/AssetDetailsActions.tsx +++ b/app/components/Views/AssetDetails/AssetDetailsActions/AssetDetailsActions.tsx @@ -1,22 +1,15 @@ import React from 'react'; -import { View, Platform } from 'react-native'; +import { View } from 'react-native'; import styleSheet from './AssetDetailsActions.styles'; import { useStyles } from '../../../../component-library/hooks'; import WalletAction from '../../../../components/UI/WalletAction'; import { strings } from '../../../../../locales/i18n'; -import generateTestId from '../../../../../wdio/utils/generateTestId'; import { IconName } from '../../../../component-library/components/Icons/Icon'; import { AvatarSize } from '../../../../component-library/components/Avatars/Avatar'; import Text, { TextVariant, } from '../../../../component-library/components/Texts/Text'; -import { - TOKEN_OVERVIEW_BRIDGE_BUTTON, - TOKEN_OVERVIEW_BUY_BUTTON, - TOKEN_OVERVIEW_RECEIVE_BUTTON, - TOKEN_OVERVIEW_SEND_BUTTON, - TOKEN_OVERVIEW_SWAP_BUTTON, -} from '../../../../../wdio/screen-objects/testIDs/Screens/TokenOverviewScreen.testIds'; +import { TokenOverviewSelectorsIDs } from '../../../../../e2e/selectors/TokenOverview.selectors'; export interface AssetDetailsActionsProps { displayBuyButton: boolean | undefined; @@ -49,7 +42,7 @@ export const AssetDetailsActions: React.FC = ({ onPress={onBuy} iconStyle={styles.icon} containerStyle={styles.containerStyle} - {...generateTestId(Platform, TOKEN_OVERVIEW_BUY_BUTTON)} + actionID={TokenOverviewSelectorsIDs.BUY_BUTTON} /> {strings('asset_overview.buy_button')} @@ -65,7 +58,7 @@ export const AssetDetailsActions: React.FC = ({ onPress={goToSwaps} iconStyle={styles.icon} containerStyle={styles.containerStyle} - {...generateTestId(Platform, TOKEN_OVERVIEW_SWAP_BUTTON)} + actionID={TokenOverviewSelectorsIDs.SWAP_BUTTON} /> {strings('asset_overview.swap')} @@ -80,7 +73,7 @@ export const AssetDetailsActions: React.FC = ({ onPress={goToBridge} iconStyle={styles.icon} containerStyle={styles.containerStyle} - {...generateTestId(Platform, TOKEN_OVERVIEW_BRIDGE_BUTTON)} + actionID={TokenOverviewSelectorsIDs.BRIDGE_BUTTON} /> {strings('asset_overview.bridge')} @@ -93,7 +86,7 @@ export const AssetDetailsActions: React.FC = ({ onPress={onSend} iconStyle={styles.icon} containerStyle={styles.containerStyle} - {...generateTestId(Platform, TOKEN_OVERVIEW_SEND_BUTTON)} + actionID={TokenOverviewSelectorsIDs.SEND_BUTTON} /> {strings('asset_overview.send_button')} @@ -106,7 +99,7 @@ export const AssetDetailsActions: React.FC = ({ onPress={onReceive} iconStyle={styles.icon} containerStyle={styles.containerStyle} - {...generateTestId(Platform, TOKEN_OVERVIEW_RECEIVE_BUTTON)} + actionID={TokenOverviewSelectorsIDs.RECEIVE_BUTTON} /> {strings('asset_overview.receive_button')} diff --git a/e2e/pages/Receive/PaymentRequestQrModal.js b/e2e/pages/Receive/PaymentRequestQrModal.js new file mode 100644 index 00000000000..580c35ef172 --- /dev/null +++ b/e2e/pages/Receive/PaymentRequestQrModal.js @@ -0,0 +1,19 @@ +import Matchers from '../../utils/Matchers'; +import Gestures from '../../utils/Gestures'; +import { SendLinkViewSelectorsIDs } from '../../selectors/SendLinkView.selectors'; + +class PaymentRequestQrModal { + get container() { + return Matchers.getElementByID(SendLinkViewSelectorsIDs.QR_MODAL); + } + + get closeButton() { + return Matchers.getElementByID(SendLinkViewSelectorsIDs.CLOSE_QR_MODAL_BUTTON); + } + + async tapCloseButton() { + await Gestures.waitAndTap(this.closeButton); + } +} + +export default new PaymentRequestQrModal(); diff --git a/e2e/pages/modals/RequestPaymentModal.js b/e2e/pages/Receive/RequestPaymentModal.js similarity index 100% rename from e2e/pages/modals/RequestPaymentModal.js rename to e2e/pages/Receive/RequestPaymentModal.js diff --git a/e2e/pages/Receive/SendLinkView.js b/e2e/pages/Receive/SendLinkView.js new file mode 100644 index 00000000000..73663c6bbbb --- /dev/null +++ b/e2e/pages/Receive/SendLinkView.js @@ -0,0 +1,33 @@ +import Matchers from '../../utils/Matchers'; +import Gestures from '../../utils/Gestures'; +import { SendLinkViewSelectorsIDs } from '../../selectors/SendLinkView.selectors'; + +class SendLinkView { + get container() { + return Matchers.getElementByID(SendLinkViewSelectorsIDs.CONTAINER_ID); + } + + get qrModal() { + return Matchers.getElementByID(SendLinkViewSelectorsIDs.QR_MODAL); + } + + get closeSendLinkButton() { + return Matchers.getElementByID(SendLinkViewSelectorsIDs.CLOSE_SEND_LINK_VIEW_BUTTON); + } + + get qrCodeButton() { + return device.getPlatform() === 'android' + ? Matchers.getElementByLabel(SendLinkViewSelectorsIDs.QR_CODE_BUTTON) + : Matchers.getElementByID(SendLinkViewSelectorsIDs.QR_CODE_BUTTON); + } + + async tapQRCodeButton() { + await Gestures.waitAndTap(this.qrCodeButton); + } + + async tapCloseSendLinkButton() { + await Gestures.waitAndTap(this.closeSendLinkButton); + } +} + +export default new SendLinkView(); diff --git a/e2e/pages/SendLinkView.js b/e2e/pages/SendLinkView.js deleted file mode 100644 index 82a1477bfb0..00000000000 --- a/e2e/pages/SendLinkView.js +++ /dev/null @@ -1,34 +0,0 @@ -import TestHelpers from '../helpers'; -import { SendLinkViewSelectorsIDs } from '../selectors/SendLinkView.selectors'; - -export default class SendLinkView { - static async tapQRCodeButton() { - if (device.getPlatform() === 'android') { - await TestHelpers.waitAndTapByLabel( - SendLinkViewSelectorsIDs.QR_CODE_BUTTON, - ); - } else { - await TestHelpers.tap(SendLinkViewSelectorsIDs.QR_CODE_BUTTON); - } - } - - static async isVisible() { - await TestHelpers.checkIfVisible(SendLinkViewSelectorsIDs.CONTAINER_ID); - } - - static async isNotVisible() { - await TestHelpers.checkIfNotVisible(SendLinkViewSelectorsIDs.CONTAINER_ID); - } - static async tapCloseSendLinkButton() { - await TestHelpers.tap(SendLinkViewSelectorsIDs.CLOSE_SEND_LINK_VIEW_BUTTON); - } - - // QR Modal - static async tapQRCodeCloseButton() { - await TestHelpers.tap(SendLinkViewSelectorsIDs.CLOSE_QR_MODAL_BUTTON); - } - - static async isQRModalVisible() { - await TestHelpers.checkIfVisible(SendLinkViewSelectorsIDs.QR_MODAL); - } -} diff --git a/e2e/pages/TokenOverview.js b/e2e/pages/TokenOverview.js index 433b8ad3aa2..25e22153919 100644 --- a/e2e/pages/TokenOverview.js +++ b/e2e/pages/TokenOverview.js @@ -1,83 +1,94 @@ -import TestHelpers from '../helpers'; +import Matchers from '../utils/Matchers'; +import Gestures from '../utils/Gestures'; import { - TOKEN_PRICE, - TOKEN_OVERVIEW_SEND_BUTTON, - TOKEN_OVERVIEW_RECEIVE_BUTTON, - TOKEN_OVERVIEW_BUY_BUTTON, - TOKEN_OVERVIEW_SWAP_BUTTON, -} from '../../wdio/screen-objects/testIDs/Screens/TokenOverviewScreen.testIds'; -import { ImportTokenViewSelectorsIDs } from '../selectors/wallet/ImportTokenView.selectors'; -import enContent from '../../locales/languages/en.json'; + TokenOverviewSelectorsIDs, + TokenOverviewSelectorsText +} from '../selectors/TokenOverview.selectors'; -const chartTimePeriod = [ - enContent.asset_overview.chart_time_period_navigation['1d'], - enContent.asset_overview.chart_time_period_navigation['1w'], - enContent.asset_overview.chart_time_period_navigation['1m'], - enContent.asset_overview.chart_time_period_navigation['3m'], - enContent.asset_overview.chart_time_period_navigation['1y'], - enContent.asset_overview.chart_time_period_navigation['3y'], -]; +class TokenOverview { + get container() { + return Matchers.getElementByID(TokenOverviewSelectorsIDs.TOKEN_PRICE); + } + + get tokenPrice() { + return Matchers.getElementByID(TokenOverviewSelectorsIDs.TOKEN_PRICE); + } + + get sendButton() { + return Matchers.getElementByID(TokenOverviewSelectorsIDs.SEND_BUTTON); + } + + get swapButton() { + return Matchers.getElementByID(TokenOverviewSelectorsIDs.SWAP_BUTTON); + } -export default class TokenOverview { - static async tapSendButton() { - await TestHelpers.waitAndTap(TOKEN_OVERVIEW_SEND_BUTTON); + get receiveButton() { + return Matchers.getElementByID(TokenOverviewSelectorsIDs.RECEIVE_BUTTON); } - static async tapSwapButton() { - await TestHelpers.waitAndTap(TOKEN_OVERVIEW_SWAP_BUTTON); + get noChartData() { + return Matchers.getElementByText(TokenOverviewSelectorsText.NO_CHART_DATA); } - static async scrollOnScreen() { - await TestHelpers.swipe(TOKEN_PRICE, 'up', 'fast', 0.6); + get chartPeriod1d() { + return Matchers.getElementByText(TokenOverviewSelectorsText['1d']); } - static async tapBackButton() { - await TestHelpers.waitAndTap(ImportTokenViewSelectorsIDs.BACK_BUTTON); + get chartPeriod1w() { + return Matchers.getElementByText(TokenOverviewSelectorsText['1w']); } - static async isVisible() { - await TestHelpers.checkIfVisible(TOKEN_OVERVIEW_SEND_BUTTON); + get chartPeriod1m() { + return Matchers.getElementByText(TokenOverviewSelectorsText['1m']); } - static async selectChart(chartPeriod) { - await TestHelpers.tapByText(chartPeriod); + get chartPeriod3m() { + return Matchers.getElementByText(TokenOverviewSelectorsText['3m']); } - static async checkIfChartIsVisible() { - for (const period of chartTimePeriod) { - await this.selectChart(period); - await TestHelpers.checkIfElementWithTextIsNotVisible( - enContent.asset_overview.no_chart_data.title, - ); - } + get chartPeriod1y() { + return Matchers.getElementByText(TokenOverviewSelectorsText['1y']); } - static async TokenQuoteIsNotZero() { - await TestHelpers.checkIfElementNotToHaveText(TOKEN_PRICE, '$0'); + get chartPeriod3y() { + return Matchers.getElementByText(TokenOverviewSelectorsText['3y']); } - static async TokenQuoteIsZero() { - await TestHelpers.checkIfHasText(TOKEN_PRICE, '$0'); + async tapSendButton() { + await Gestures.waitAndTap(this.sendButton); } - static async ChartNotVisible() { - await TestHelpers.checkIfElementWithTextIsVisible( - enContent.asset_overview.no_chart_data.title, - ); + async tapSwapButton() { + await Gestures.waitAndTap(this.swapButton); } - static async isReceiveButtonVisible() { - await TestHelpers.checkIfExists(TOKEN_OVERVIEW_RECEIVE_BUTTON); + + async scrollOnScreen() { + await Gestures.swipe(this.tokenPrice, 'up', 'fast', 0.6); } - static async isSendButtonVisible() { - await TestHelpers.checkIfExists(TOKEN_OVERVIEW_SEND_BUTTON); + async tapChartPeriod1d() { + await Gestures.waitAndTap(this.chartPeriod1d); } - static async isBuyButtonVisible() { - await TestHelpers.checkIfExists(TOKEN_OVERVIEW_BUY_BUTTON); + async tapChartPeriod1w() { + await Gestures.waitAndTap(this.chartPeriod1w); } - static async isSwapButtonVisible() { - await TestHelpers.checkIfExists(TOKEN_OVERVIEW_SWAP_BUTTON); + async tapChartPeriod1m() { + await Gestures.waitAndTap(this.chartPeriod1m); + } + + async tapChartPeriod3m() { + await Gestures.waitAndTap(this.chartPeriod3m); + } + + async tapChartPeriod1y() { + await Gestures.waitAndTap(this.chartPeriod1y); + } + + async tapChartPeriod3y() { + await Gestures.waitAndTap(this.chartPeriod3y); } } + +export default new TokenOverview(); diff --git a/e2e/selectors/TokenOverview.selectors.js b/e2e/selectors/TokenOverview.selectors.js new file mode 100644 index 00000000000..c268b88033b --- /dev/null +++ b/e2e/selectors/TokenOverview.selectors.js @@ -0,0 +1,21 @@ +import enContent from '../../locales/languages/en.json'; + +export const TokenOverviewSelectorsIDs = { + CONTAINER: 'token-asset-overview', + TOKEN_PRICE: 'token-price', + SEND_BUTTON: 'token-send-button', + RECEIVE_BUTTON: 'token-receive-button', + BUY_BUTTON: 'token-buy-button', + SWAP_BUTTON: 'token-swap-button', + BRIDGE_BUTTON: 'token-bridge-button', +}; + +export const TokenOverviewSelectorsText = { + NO_CHART_DATA: enContent.asset_overview.no_chart_data.title, + '1d': enContent.asset_overview.chart_time_period_navigation['1d'], + '1w': enContent.asset_overview.chart_time_period_navigation['1w'], + '1m': enContent.asset_overview.chart_time_period_navigation['1m'], + '3m': enContent.asset_overview.chart_time_period_navigation['3m'], + '1y': enContent.asset_overview.chart_time_period_navigation['1y'], + '3y': enContent.asset_overview.chart_time_period_navigation['3y'], +}; diff --git a/e2e/selectors/wallet/ImportTokenView.selectors.js b/e2e/selectors/wallet/ImportTokenView.selectors.js index 4ad9af6c348..4288e200383 100644 --- a/e2e/selectors/wallet/ImportTokenView.selectors.js +++ b/e2e/selectors/wallet/ImportTokenView.selectors.js @@ -10,7 +10,6 @@ export const ImportTokenViewSelectorsIDs = { DECIMAL_INPUT: 'input-token-decimal', ADDRESS_WARNING_MESSAGE: 'token-address-warning', PRECISION_WARNING_MESSAGE: 'token-decimals-warning', - BACK_BUTTON: 'asset-back-button', ADD_CONFIRM_CUSTOM_ASSET: 'add-confirm-custom-asset', ADD_CANCEL_ADD_CUSTOM_ASSET_MODAL: 'add-cancel-custom-asset-modal', NEXT_BUTTON: 'token-import-next-button', diff --git a/e2e/specs/quarantine/swap-token-chart.failing.js b/e2e/specs/quarantine/swap-token-chart.failing.js index a3ef99be5e6..4e9b7b534de 100644 --- a/e2e/specs/quarantine/swap-token-chart.failing.js +++ b/e2e/specs/quarantine/swap-token-chart.failing.js @@ -53,8 +53,8 @@ describe(Regression('Swap from Token view'), () => { await TabBarComponent.tapWallet(); await Assertions.checkIfVisible(WalletView.container); await WalletView.tapOnToken('Ethereum'); + await Assertions.checkIfVisible(TokenOverview.container); await TokenOverview.scrollOnScreen(); - await TokenOverview.isVisible(); await TokenOverview.tapSwapButton(); if (!swapOnboarded) await Onboarding.tapStartSwapping(); await Assertions.checkIfVisible(QuoteView.getQuotes); diff --git a/e2e/specs/swaps/token-details.spec.js b/e2e/specs/swaps/token-details.spec.js index f0de17126e9..b2f0db4ba99 100644 --- a/e2e/specs/swaps/token-details.spec.js +++ b/e2e/specs/swaps/token-details.spec.js @@ -7,6 +7,9 @@ import { switchToSepoliaNetwork, } from '../../viewHelper'; import { CustomNetworks } from '../../resources/networks.e2e'; +import Assertions from '../../utils/Assertions'; +import CommonView from '../../pages/CommonView'; + describe(SmokeSwaps('Token Chart Tests'), () => { beforeAll(async () => { @@ -20,19 +23,32 @@ describe(SmokeSwaps('Token Chart Tests'), () => { it('should view the token chart', async () => { await WalletView.tapOnToken(); - await TokenOverview.TokenQuoteIsNotZero(); - await TokenOverview.checkIfChartIsVisible(); + await Assertions.checkIfElementNotToHaveText(TokenOverview.tokenPrice, '$0'); + + await TokenOverview.tapChartPeriod1d(); + await Assertions.checkIfVisible(TokenOverview.chartPeriod1d); + await TokenOverview.tapChartPeriod1w(); + await Assertions.checkIfVisible(TokenOverview.chartPeriod1w); + await TokenOverview.tapChartPeriod1m(); + await Assertions.checkIfVisible(TokenOverview.chartPeriod1m); + await TokenOverview.tapChartPeriod3m(); + await Assertions.checkIfVisible(TokenOverview.chartPeriod3m); + await TokenOverview.tapChartPeriod1y(); + await Assertions.checkIfVisible(TokenOverview.chartPeriod1y); + await TokenOverview.tapChartPeriod3y(); + await Assertions.checkIfVisible(TokenOverview.chartPeriod3y); + await TokenOverview.scrollOnScreen(); - await TokenOverview.isReceiveButtonVisible(); - await TokenOverview.isSendButtonVisible(); - await TokenOverview.isSwapButtonVisible(); - await TokenOverview.tapBackButton(); + await Assertions.checkIfVisible(TokenOverview.receiveButton); + await Assertions.checkIfVisible(TokenOverview.sendButton); + await Assertions.checkIfVisible(TokenOverview.swapButton); + await CommonView.tapBackButton(); }); it('should not display the chart when using Sepolia test network', async () => { await switchToSepoliaNetwork(); await WalletView.tapOnToken(CustomNetworks.Sepolia.providerConfig.ticker); - await TokenOverview.ChartNotVisible(); - await TokenOverview.TokenQuoteIsZero(); + await Assertions.checkIfNotVisible(TokenOverview.noChartData); + await Assertions.checkIfElementToHaveText(TokenOverview.tokenPrice, '$0'); }); }); diff --git a/e2e/specs/wallet/request-token-flow.spec.js b/e2e/specs/wallet/request-token-flow.spec.js index 83f015797f8..01687985db2 100644 --- a/e2e/specs/wallet/request-token-flow.spec.js +++ b/e2e/specs/wallet/request-token-flow.spec.js @@ -1,11 +1,12 @@ 'use strict'; import { SmokeCore } from '../../tags'; -import SendLinkView from '../../pages/SendLinkView'; +import RequestPaymentModal from '../../pages/Receive/RequestPaymentModal'; +import SendLinkView from '../../pages/Receive/SendLinkView'; +import PaymentRequestQrModal from '../../pages/Receive/PaymentRequestQrModal'; import RequestPaymentView from '../../pages/RequestPaymentView'; import TabBarComponent from '../../pages/TabBarComponent'; import WalletActionsModal from '../../pages/modals/WalletActionsModal'; import ProtectYourWalletModal from '../../pages/modals/ProtectYourWalletModal'; -import RequestPaymentModal from '../../pages/modals/RequestPaymentModal'; import { loginToApp } from '../../viewHelper'; import { loadFixture, @@ -63,16 +64,16 @@ describe(SmokeCore('Request Token Flow with Unprotected Wallet'), () => { it('should request DAI amount', async () => { await RequestPaymentView.typeInTokenAmount(5.5); - await SendLinkView.isVisible(); + await Assertions.checkIfVisible(SendLinkView.container); }); it('should see DAI request QR code', async () => { await SendLinkView.tapQRCodeButton(); - await SendLinkView.isQRModalVisible(); + await Assertions.checkIfVisible(PaymentRequestQrModal.container); }); it('should close request', async () => { - await SendLinkView.tapQRCodeCloseButton(); + await PaymentRequestQrModal.tapCloseButton(); await SendLinkView.tapCloseSendLinkButton(); }); diff --git a/wdio/screen-objects/TokenOverviewScreen.js b/wdio/screen-objects/TokenOverviewScreen.js index 2fc17edb3b3..713da151acb 100644 --- a/wdio/screen-objects/TokenOverviewScreen.js +++ b/wdio/screen-objects/TokenOverviewScreen.js @@ -1,26 +1,14 @@ -import { - TOKEN_ASSET_OVERVIEW, - TOKEN_OVERVIEW_SEND_BUTTON, -} from './testIDs/Screens/TokenOverviewScreen.testIds.js'; import Selectors from '../helpers/Selectors'; import Gestures from '../helpers/Gestures'; -import { ImportTokenViewSelectorsIDs } from '../../e2e/selectors/wallet/ImportTokenView.selectors'; +import { TokenOverviewSelectorsIDs } from '../../e2e/selectors/TokenOverview.selectors'; class TokenOverviewScreen { get tokenAssetOverview() { - return Selectors.getElementByPlatform(TOKEN_ASSET_OVERVIEW); + return Selectors.getElementByPlatform(TokenOverviewSelectorsIDs.CONTAINER); } get sendButton() { - return Selectors.getElementByPlatform(TOKEN_OVERVIEW_SEND_BUTTON); - } - - get backButtonTokenOverview() { - return Selectors.getElementByPlatform(ImportTokenViewSelectorsIDs.BACK_BUTTON); - } - - async tapBackButton() { - await Gestures.waitAndTap(this.backButtonTokenOverview); + return Selectors.getElementByPlatform(TokenOverviewSelectorsIDs.SEND_BUTTON); } async isTokenOverviewVisible() { diff --git a/wdio/screen-objects/testIDs/Screens/TokenOverviewScreen.testIds.js b/wdio/screen-objects/testIDs/Screens/TokenOverviewScreen.testIds.js deleted file mode 100644 index c719ab1d7f1..00000000000 --- a/wdio/screen-objects/testIDs/Screens/TokenOverviewScreen.testIds.js +++ /dev/null @@ -1,9 +0,0 @@ -export const TOKEN_ASSET_OVERVIEW = 'token-asset-overview'; -export const TOKEN_PRICE = 'token-price'; -export const TOKEN_OVERVIEW_SEND_BUTTON = 'token-send-button'; -export const TOKEN_OVERVIEW_BRIDGE_BUTTON = 'token-bridge-button'; -export const TOKEN_OVERVIEW_RECEIVE_BUTTON = 'token-receive-button'; -export const TOKEN_OVERVIEW_BUY_BUTTON = 'token-buy-button'; -export const TOKEN_OVERVIEW_SWAP_BUTTON = 'token-swap-button'; -export const TOKEN_OVERVIEW_TXN_SCREEN = 'txn-screen'; - diff --git a/wdio/step-definitions/send-flow.steps.js b/wdio/step-definitions/send-flow.steps.js index 1ee8101ab79..231e31025ce 100644 --- a/wdio/step-definitions/send-flow.steps.js +++ b/wdio/step-definitions/send-flow.steps.js @@ -131,7 +131,6 @@ Then(/^I am taken to the token overview screen/, async () => { }); Then(/^I tap back from the Token overview page/, async () => { - await TokenOverviewScreen.tapBackButton(); await WalletMainScreen.isMainWalletViewVisible(); });