Skip to content

Commit

Permalink
Move QR code modal methods to their own page object
Browse files Browse the repository at this point in the history
  • Loading branch information
SamuelSalas committed Oct 24, 2024
1 parent cbb834b commit c27d02a
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 16 deletions.
19 changes: 19 additions & 0 deletions e2e/pages/Receive/PaymentRequestQrModal.js
Original file line number Diff line number Diff line change
@@ -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();
File renamed without changes.
15 changes: 3 additions & 12 deletions e2e/pages/SendLinkView.js → e2e/pages/Receive/SendLinkView.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Matchers from '../utils/Matchers';
import Gestures from '../utils/Gestures';
import { SendLinkViewSelectorsIDs } from '../selectors/SendLinkView.selectors';
import Matchers from '../../utils/Matchers';
import Gestures from '../../utils/Gestures';
import { SendLinkViewSelectorsIDs } from '../../selectors/SendLinkView.selectors';

class SendLinkView {
get container() {
Expand All @@ -11,10 +11,6 @@ class SendLinkView {
return Matchers.getElementByID(SendLinkViewSelectorsIDs.QR_MODAL);
}

get qrCloseButton() {
return Matchers.getElementByID(SendLinkViewSelectorsIDs.CLOSE_QR_MODAL_BUTTON);
}

get closeSendLinkButton() {
return Matchers.getElementByID(SendLinkViewSelectorsIDs.CLOSE_SEND_LINK_VIEW_BUTTON);
}
Expand All @@ -32,11 +28,6 @@ class SendLinkView {
async tapCloseSendLinkButton() {
await Gestures.waitAndTap(this.closeSendLinkButton);
}

// QR Modal
async tapQRCodeCloseButton() {
await Gestures.waitAndTap(this.qrCloseButton);
}
}

export default new SendLinkView();
9 changes: 5 additions & 4 deletions e2e/specs/wallet/request-token-flow.spec.js
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -68,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(SendLinkView.qrModal);
await Assertions.checkIfVisible(PaymentRequestQrModal.container);
});

it('should close request', async () => {
await SendLinkView.tapQRCodeCloseButton();
await PaymentRequestQrModal.tapCloseButton();
await SendLinkView.tapCloseSendLinkButton();
});

Expand Down

0 comments on commit c27d02a

Please sign in to comment.