-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: Refactor SendLinkView.js & TokenOverview.js files to follow pag…
…e object model (#11986) <!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until the template has been completely filled out, and PR status checks have passed at least once. --> ## **Description** We are aiming to refactor the page objects in the modal folder so that they strictly follow the page object model pattern. This would aide in providing more readable and help standardize the way we create our tests. Because of the amount of files remaining, this issue will focus on working on three files to refactor, as well as their respective testIDS. Files inside the scope for this batch: - SendLinkView.js - TokenOverview.js ## **Related issues** Fixes: ## **Manual testing steps** 1. Go to this page... 2. 3. ## **Screenshots/Recordings** Regression Test run: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/73c51633-f930-4f5f-874e-1d7338f508ee ### **Before** <!-- [screenshots/recordings] --> ### **After** <!-- [screenshots/recordings] --> ## **Pre-merge author checklist** - [ ] I’ve followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [ ] I've completed the PR template to the best of my ability - [ ] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.
- Loading branch information
1 parent
ead35c4
commit 430d0b3
Showing
20 changed files
with
193 additions
and
165 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,6 @@ exports[`Asset should render correctly 1`] = ` | |
"flex": 1, | ||
} | ||
} | ||
testID="txn-screen" | ||
> | ||
<View | ||
style={ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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(); |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.