diff --git a/app/components/UI/Navbar/index.js b/app/components/UI/Navbar/index.js index 07f352786e0..1e31cfc43d2 100644 --- a/app/components/UI/Navbar/index.js +++ b/app/components/UI/Navbar/index.js @@ -28,7 +28,6 @@ import PickerNetwork from '../../../component-library/components/Pickers/PickerN import BrowserUrlBar from '../BrowserUrlBar'; import generateTestId from '../../../../wdio/utils/generateTestId'; import { NAV_ANDROID_BACK_BUTTON } from '../../../../wdio/screen-objects/testIDs/Screens/NetworksScreen.testids'; -import { REQUEST_SEARCH_RESULTS_BACK_BUTTON } from '../../../../wdio/screen-objects/testIDs/Screens/RequestToken.testIds'; import { BACK_BUTTON_SIMPLE_WEBVIEW } from '../../../../wdio/screen-objects/testIDs/Components/SimpleWebView.testIds'; import Routes from '../../../constants/navigation/Routes'; @@ -43,7 +42,7 @@ import { import { CommonSelectorsIDs } from '../../../../e2e/selectors/Common.selectors'; import { WalletViewSelectorsIDs } from '../../../../e2e/selectors/wallet/WalletView.selectors'; import { NetworksViewSelectorsIDs } from '../../../../e2e/selectors/Settings/NetworksView.selectors'; -import { SendLinkViewSelectorsIDs } from '../../../../e2e/selectors/SendLinkView.selectors'; +import { SendLinkViewSelectorsIDs } from '../../../../e2e/selectors/Receive/SendLinkView.selectors'; import { SendViewSelectorsIDs } from '../../../../e2e/selectors/SendView.selectors'; import { getBlockaidTransactionMetricsParams } from '../../../util/blockaid'; import Icon, { @@ -52,6 +51,7 @@ import Icon, { IconColor, } from '../../../component-library/components/Icons/Icon'; import { AddContactViewSelectorsIDs } from '../../../../e2e/selectors/Settings/Contacts/AddContactView.selectors'; +import { RequestPaymentViewSelectors } from '../../../../e2e/selectors/Receive/RequestPaymentView.selectors'; const trackEvent = (event, params = {}) => { MetaMetrics.getInstance().trackEvent(event, params); @@ -360,7 +360,7 @@ export function getPaymentRequestOptionsTitle( diff --git a/app/components/UI/PaymentRequestSuccess/index.js b/app/components/UI/PaymentRequestSuccess/index.js index 1310dd135d8..08a3925ab65 100644 --- a/app/components/UI/PaymentRequestSuccess/index.js +++ b/app/components/UI/PaymentRequestSuccess/index.js @@ -30,7 +30,7 @@ import { protectWalletModalVisible } from '../../../actions/user'; import ClipboardManager from '../../../core/ClipboardManager'; import { ThemeContext, mockTheme } from '../../../util/theme'; import generateTestId from '../../../../wdio/utils/generateTestId'; -import { SendLinkViewSelectorsIDs } from '../../../../e2e/selectors/SendLinkView.selectors'; +import { SendLinkViewSelectorsIDs } from '../../../../e2e/selectors/Receive/SendLinkView.selectors'; const isIos = Device.isIos(); diff --git a/app/components/UI/ReceiveRequest/index.js b/app/components/UI/ReceiveRequest/index.js index adeb81bc78c..8cdbcb0f5cb 100644 --- a/app/components/UI/ReceiveRequest/index.js +++ b/app/components/UI/ReceiveRequest/index.js @@ -28,7 +28,7 @@ import { isNetworkRampSupported } from '../Ramp/utils'; import { createBuyNavigationDetails } from '../Ramp/routes/utils'; import { selectSelectedInternalAccountChecksummedAddress } from '../../../selectors/accountsController'; import { getRampNetworks } from '../../../reducers/fiatOrders'; -import { RequestPaymentModalSelectorsIDs } from '../../../../e2e/selectors/Modals/RequestPaymentModal.selectors'; +import { RequestPaymentModalSelectorsIDs } from '../../../../e2e/selectors/Receive/RequestPaymentModal.selectors'; import { withMetricsAwareness } from '../../../components/hooks/useMetrics'; import { getDecimalChainId } from '../../../util/networks'; import QRAccountDisplay from '../../Views/QRAccountDisplay'; diff --git a/e2e/pages/Receive/PaymentRequestQrModal.js b/e2e/pages/Receive/PaymentRequestQrBottomSheet.js similarity index 68% rename from e2e/pages/Receive/PaymentRequestQrModal.js rename to e2e/pages/Receive/PaymentRequestQrBottomSheet.js index 580c35ef172..674dba57dcd 100644 --- a/e2e/pages/Receive/PaymentRequestQrModal.js +++ b/e2e/pages/Receive/PaymentRequestQrBottomSheet.js @@ -1,8 +1,8 @@ import Matchers from '../../utils/Matchers'; import Gestures from '../../utils/Gestures'; -import { SendLinkViewSelectorsIDs } from '../../selectors/SendLinkView.selectors'; +import { SendLinkViewSelectorsIDs } from '../../selectors/Receive/SendLinkView.selectors'; -class PaymentRequestQrModal { +class PaymentRequestQrBottomSheet { get container() { return Matchers.getElementByID(SendLinkViewSelectorsIDs.QR_MODAL); } @@ -16,4 +16,4 @@ class PaymentRequestQrModal { } } -export default new PaymentRequestQrModal(); +export default new PaymentRequestQrBottomSheet(); diff --git a/e2e/pages/Receive/RequestPaymentModal.js b/e2e/pages/Receive/RequestPaymentModal.js index 450415b9340..0a01e14148e 100644 --- a/e2e/pages/Receive/RequestPaymentModal.js +++ b/e2e/pages/Receive/RequestPaymentModal.js @@ -1,4 +1,4 @@ -import { RequestPaymentModalSelectorsIDs } from '../../selectors/Modals/RequestPaymentModal.selectors'; +import { RequestPaymentModalSelectorsIDs } from '../../selectors/Receive/RequestPaymentModal.selectors'; import Matchers from '../../utils/Matchers'; import Gestures from '../../utils/Gestures'; @@ -6,7 +6,7 @@ class RequestPaymentModal { get requestPaymentButton() { return device.getPlatform() === 'android' ? Matchers.getElementByLabel( - RequestPaymentModalSelectorsIDs.REQUEST_BUTTON, + RequestPaymentModalSelectorsIDs.REQUEST_BUTTON, ) : Matchers.getElementByID(RequestPaymentModalSelectorsIDs.REQUEST_BUTTON); } diff --git a/e2e/pages/RequestPaymentView.js b/e2e/pages/Receive/RequestPaymentView.js similarity index 86% rename from e2e/pages/RequestPaymentView.js rename to e2e/pages/Receive/RequestPaymentView.js index 2dc413ac75f..22669d405d0 100644 --- a/e2e/pages/RequestPaymentView.js +++ b/e2e/pages/Receive/RequestPaymentView.js @@ -1,6 +1,6 @@ -import { RequestPaymentViewSelectors } from '../selectors/RequestPaymentView.selectors'; -import Matchers from '../utils/Matchers'; -import Gestures from '../utils/Gestures'; +import { RequestPaymentViewSelectors } from '../../selectors/Receive/RequestPaymentView.selectors'; +import Matchers from '../../utils/Matchers'; +import Gestures from '../../utils/Gestures'; class RequestPaymentView { get backButton() { diff --git a/e2e/pages/Receive/SendLinkView.js b/e2e/pages/Receive/SendLinkView.js index 73663c6bbbb..a89e479d218 100644 --- a/e2e/pages/Receive/SendLinkView.js +++ b/e2e/pages/Receive/SendLinkView.js @@ -1,6 +1,6 @@ import Matchers from '../../utils/Matchers'; import Gestures from '../../utils/Gestures'; -import { SendLinkViewSelectorsIDs } from '../../selectors/SendLinkView.selectors'; +import { SendLinkViewSelectorsIDs } from '../../selectors/Receive/SendLinkView.selectors'; class SendLinkView { get container() { diff --git a/e2e/selectors/Modals/RequestPaymentModal.selectors.js b/e2e/selectors/Modals/RequestPaymentModal.selectors.js deleted file mode 100644 index 7f40a1b70ec..00000000000 --- a/e2e/selectors/Modals/RequestPaymentModal.selectors.js +++ /dev/null @@ -1,6 +0,0 @@ -export const RequestPaymentModalSelectorsIDs = { - CONTAINER: 'receive-request-screen', - REQUEST_BUTTON: 'request-payment-button', - QR_MODAL: 'qr-modal', - ACCOUNT_ADDRESS: 'account-address', -}; diff --git a/e2e/selectors/Receive/RequestPaymentModal.selectors.js b/e2e/selectors/Receive/RequestPaymentModal.selectors.js new file mode 100644 index 00000000000..340e77a8073 --- /dev/null +++ b/e2e/selectors/Receive/RequestPaymentModal.selectors.js @@ -0,0 +1,3 @@ +export const RequestPaymentModalSelectorsIDs = { + REQUEST_BUTTON: 'request-payment-button', +}; diff --git a/e2e/selectors/RequestPaymentView.selectors.js b/e2e/selectors/Receive/RequestPaymentView.selectors.js similarity index 84% rename from e2e/selectors/RequestPaymentView.selectors.js rename to e2e/selectors/Receive/RequestPaymentView.selectors.js index 731e5d56b8f..5d0e8c56a1e 100644 --- a/e2e/selectors/RequestPaymentView.selectors.js +++ b/e2e/selectors/Receive/RequestPaymentView.selectors.js @@ -4,5 +4,4 @@ export const RequestPaymentViewSelectors = { REQUEST_ASSET_LIST_ID: 'searched-asset-results', REQUEST_AMOUNT_INPUT_BOX_ID: 'request-amount-input', TOKEN_SEARCH_INPUT_BOX: 'request-search-asset-input', - PAYMENT_REQUEST_CLOSE_BUTTON: 'send-link-close-button', }; diff --git a/e2e/selectors/SendLinkView.selectors.js b/e2e/selectors/Receive/SendLinkView.selectors.js similarity index 100% rename from e2e/selectors/SendLinkView.selectors.js rename to e2e/selectors/Receive/SendLinkView.selectors.js diff --git a/e2e/specs/wallet/request-token-flow.spec.js b/e2e/specs/wallet/request-token-flow.spec.js index 01687985db2..01f11967ab1 100644 --- a/e2e/specs/wallet/request-token-flow.spec.js +++ b/e2e/specs/wallet/request-token-flow.spec.js @@ -2,8 +2,8 @@ import { SmokeCore } from '../../tags'; import RequestPaymentModal from '../../pages/Receive/RequestPaymentModal'; import SendLinkView from '../../pages/Receive/SendLinkView'; -import PaymentRequestQrModal from '../../pages/Receive/PaymentRequestQrModal'; -import RequestPaymentView from '../../pages/RequestPaymentView'; +import PaymentRequestQrBottomSheet from '../../pages/Receive/PaymentRequestQrBottomSheet'; +import RequestPaymentView from '../../pages/Receive/RequestPaymentView'; import TabBarComponent from '../../pages/TabBarComponent'; import WalletActionsModal from '../../pages/modals/WalletActionsModal'; import ProtectYourWalletModal from '../../pages/modals/ProtectYourWalletModal'; @@ -69,11 +69,11 @@ describe(SmokeCore('Request Token Flow with Unprotected Wallet'), () => { it('should see DAI request QR code', async () => { await SendLinkView.tapQRCodeButton(); - await Assertions.checkIfVisible(PaymentRequestQrModal.container); + await Assertions.checkIfVisible(PaymentRequestQrBottomSheet.container); }); it('should close request', async () => { - await PaymentRequestQrModal.tapCloseButton(); + await PaymentRequestQrBottomSheet.tapCloseButton(); await SendLinkView.tapCloseSendLinkButton(); }); diff --git a/wdio/screen-objects/RequestTokenScreen.js b/wdio/screen-objects/RequestTokenScreen.js index e937ab7b6bf..01201b1588c 100644 --- a/wdio/screen-objects/RequestTokenScreen.js +++ b/wdio/screen-objects/RequestTokenScreen.js @@ -1,27 +1,22 @@ import Selectors from '../helpers/Selectors'; import Gestures from '../helpers/Gestures'; -import { - REQUEST_AMOUNT_INPUT, - REQUEST_SEARCH_ASSET_INPUT, - REQUEST_SEARCH_RESULTS_BACK_BUTTON, - REQUEST_SEARCH_SCREEN, -} from './testIDs/Screens/RequestToken.testIds'; +import { RequestPaymentViewSelectors } from '../../e2e/selectors/Receive/RequestPaymentView.selectors'; class RequestTokenScreen { get requestAmount() { - return Selectors.getElementByPlatform(REQUEST_AMOUNT_INPUT); + return Selectors.getElementByPlatform(RequestPaymentViewSelectors.REQUEST_AMOUNT_INPUT_BOX_ID); } get requestSearchInput() { - return Selectors.getElementByPlatform(REQUEST_SEARCH_ASSET_INPUT); + return Selectors.getElementByPlatform(RequestPaymentViewSelectors.TOKEN_SEARCH_INPUT_BOX); } get requestSearchBackButton() { - return Selectors.getElementByPlatform(REQUEST_SEARCH_RESULTS_BACK_BUTTON); + return Selectors.getElementByPlatform(RequestPaymentViewSelectors.BACK_BUTTON_ID); } get requestSearchScreen() { - return Selectors.getElementByPlatform(REQUEST_SEARCH_SCREEN); + return Selectors.getElementByPlatform(RequestPaymentViewSelectors.REQUEST_PAYMENT_CONTAINER_ID); } async typeAmountInRequest(amount) { diff --git a/wdio/screen-objects/SendLinkScreen.js b/wdio/screen-objects/SendLinkScreen.js index b91c03e9afa..1cf1a7367f8 100644 --- a/wdio/screen-objects/SendLinkScreen.js +++ b/wdio/screen-objects/SendLinkScreen.js @@ -1,17 +1,14 @@ import Selectors from '../helpers/Selectors'; import Gestures from '../helpers/Gestures'; -import { - PAYMENT_REQUEST_CLOSE_BUTTON, - PAYMENT_REQUEST_QR_CODE_CLOSE_ICON, -} from './testIDs/Screens/RequestToken.testIds'; +import { SendLinkViewSelectorsIDs } from '../../e2e/selectors/Receive/SendLinkView.selectors'; class SendLinkScreen { get requestCloseButton() { - return Selectors.getElementByPlatform(PAYMENT_REQUEST_CLOSE_BUTTON); + return Selectors.getElementByPlatform(SendLinkViewSelectorsIDs.CLOSE_SEND_LINK_VIEW_BUTTON); } get closeRequestPaymentQRIcon() { - return Selectors.getElementByPlatform(PAYMENT_REQUEST_QR_CODE_CLOSE_ICON); + return Selectors.getElementByPlatform(SendLinkViewSelectorsIDs.CLOSE_QR_MODAL_BUTTON); } async closePaymentRequest() { diff --git a/wdio/screen-objects/testIDs/Screens/RequestToken.testIds.js b/wdio/screen-objects/testIDs/Screens/RequestToken.testIds.js deleted file mode 100644 index 127130409b5..00000000000 --- a/wdio/screen-objects/testIDs/Screens/RequestToken.testIds.js +++ /dev/null @@ -1,8 +0,0 @@ -export const REQUEST_AMOUNT_INPUT = 'request-amount-input'; -export const PAYMENT_REQUEST_CLOSE_BUTTON = 'send-link-close-button'; -export const REQUEST_SEARCH_ASSET_INPUT = 'request-search-asset-input'; -export const REQUEST_SEARCH_RESULTS_BACK_BUTTON = - 'request-search-asset-back-button'; -export const REQUEST_SEARCH_SCREEN = 'request-screen'; -export const PAYMENT_REQUEST_QR_CODE_CLOSE_ICON = - 'payment-request-qrcode-close-button';