-
-
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: Move onboarding testIDs to Selectors folder inside e2e (#7610)
## **Description** Move the testIDs in each page object in the onboarding folder to the appropriate selectors folder. Relocate testIDs mostly used on the Onboarding folder from the app/constants/test-ids.js file to the same selectors folder. ## **Related issues** Fixes: #7559 ## **Screenshots/Recordings** Bitrise Smoke test build: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/5a99a91a-4c59-474f-9ea1-9aebc58fe869 Wdio test build: https://app.bitrise.io/build/4c903484-72cc-4c56-a112-4bb4089537cd - [ ] I’ve followed [MetaMask Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [ ] I've clearly explained what problem this PR is solving and how it is solved. - [ ] I've linked related issues - [ ] I've included manual testing steps - [ ] I've included screenshots/recordings if applicable - [ ] 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)). - [ ] I’ve properly set the pull request status: - [ ] In case it's not yet "ready for review", I've set it to "draft". - [ ] In case it's "ready for review", I've changed it from "draft" to "non-draft". ## **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
6e1035d
commit 3022144
Showing
16 changed files
with
110 additions
and
154 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
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 |
---|---|---|
@@ -1,59 +1,48 @@ | ||
import TestHelpers from '../../helpers'; | ||
|
||
import { | ||
CREATE_PASSWORD_CONTAINER_ID, | ||
CREATE_PASSWORD_INPUT_BOX_ID, | ||
CONFIRM_PASSWORD_INPUT_BOX_ID, | ||
IOS_I_UNDERSTAND_BUTTON_ID, | ||
ANDROID_I_UNDERSTAND_BUTTON_ID, | ||
} from '../../../app/constants/test-ids'; | ||
|
||
const CREATE_PASSWORD_BUTTON_ID = 'submit-button'; | ||
const REMEMBER_ME_ID = 'remember-me-toggle'; | ||
import { ChoosePasswordSelectorsIDs } from '../../selectors/Onboarding/ChoosePassword.selectors'; | ||
|
||
export default class CreatePasswordView { | ||
static async toggleRememberMe() { | ||
await TestHelpers.tap(REMEMBER_ME_ID); | ||
} | ||
|
||
static async enterPassword(password) { | ||
await TestHelpers.typeTextAndHideKeyboard( | ||
CREATE_PASSWORD_INPUT_BOX_ID, | ||
ChoosePasswordSelectorsIDs.NEW_PASSWORD_INPUT_ID, | ||
password, | ||
); | ||
} | ||
|
||
static async reEnterPassword(password) { | ||
await TestHelpers.typeTextAndHideKeyboard( | ||
CONFIRM_PASSWORD_INPUT_BOX_ID, | ||
ChoosePasswordSelectorsIDs.CONFIRM_PASSWORD_INPUT_ID, | ||
password, | ||
); | ||
} | ||
|
||
static async tapIUnderstandCheckBox() { | ||
if (device.getPlatform() === 'ios') { | ||
await TestHelpers.tap(IOS_I_UNDERSTAND_BUTTON_ID); | ||
await TestHelpers.tap( | ||
ChoosePasswordSelectorsIDs.IOS_I_UNDERSTAND_BUTTON_ID, | ||
); | ||
} else { | ||
// Tap by the I understand text | ||
await TestHelpers.delay(2000); | ||
await TestHelpers.tap(ANDROID_I_UNDERSTAND_BUTTON_ID); | ||
await TestHelpers.tap( | ||
ChoosePasswordSelectorsIDs.ANDROID_I_UNDERSTAND_BUTTON_ID, | ||
); | ||
} | ||
} | ||
|
||
static async tapCreatePasswordButton() { | ||
if (device.getPlatform() === 'ios') { | ||
await TestHelpers.waitAndTap(CREATE_PASSWORD_BUTTON_ID); | ||
await TestHelpers.waitAndTap(ChoosePasswordSelectorsIDs.SUBMIT_BUTTON_ID); | ||
} else { | ||
await TestHelpers.waitAndTapByLabel(CREATE_PASSWORD_BUTTON_ID); | ||
await TestHelpers.waitAndTapByLabel( | ||
ChoosePasswordSelectorsIDs.SUBMIT_BUTTON_ID, | ||
); | ||
} | ||
} | ||
|
||
// Assertions | ||
static async isVisible() { | ||
await TestHelpers.checkIfVisible(CREATE_PASSWORD_CONTAINER_ID); | ||
} | ||
|
||
static async isNotVisible() { | ||
await TestHelpers.checkIfNotVisible(CREATE_PASSWORD_CONTAINER_ID); | ||
await TestHelpers.checkIfVisible(ChoosePasswordSelectorsIDs.CONTAINER_ID); | ||
} | ||
} |
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
Oops, something went wrong.