Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove all instances of TestIDs in page objects #7558

Closed
cortisiko opened this issue Oct 20, 2023 · 1 comment · Fixed by #7687 or #7688
Closed

Remove all instances of TestIDs in page objects #7558

cortisiko opened this issue Oct 20, 2023 · 1 comment · Fixed by #7687 or #7688
Labels
epic INVALID-ISSUE-TEMPLATE Issue's body doesn't match any issue template. release-7.11.0 Issue or pull request that will be included in release 7.11.0

Comments

@cortisiko
Copy link
Member

cortisiko commented Oct 20, 2023

``### Description

We have instances where the testIDs live within the page objects instead of within the testID folder. As a result, this may be confusing to newcomers to the automation code. The solution here is to move the TestIDs from each page object into the respective testID file in the testID folder.

Technical Details

// Main TabBarSelectors object
const TabBarSelectors = {
  WALLET_BUTTON_ID: 'tab-bar-item-Wallet',
  WALLET_BUTTON_XPATH: '//[@a;dslfja;]',
  BROWSER_BUTTON_ID: 'tab-bar-item-Browser',
  BROWSER_BUTTON_CSS: 'div nth(5)',
  ACTION_BUTTON_ID: 'tab-bar-item-Actions',
  ACTION_BUTTON_CLASS: 'button',
  SETTING_BUTTON_ID: 'tab-bar-item-Setting',
  ACTIVITY_BUTTON_ID: 'tab-bar-item-Activity',
};

// Object for ID selectors. Shared between app code and test code
 const TabBarSelectorsIDs = {
  WALLET_BUTTON_ID: TabBarSelectors.WALLET_BUTTON_ID,
  BROWSER_BUTTON_ID: TabBarSelectors.BROWSER_BUTTON_ID,
  ACTION_BUTTON_ID: TabBarSelectors.ACTION_BUTTON_ID,
  SETTING_BUTTON_ID: TabBarSelectors.SETTING_BUTTON_ID,
  ACTIVITY_BUTTON_ID: TabBarSelectors.ACTIVITY_BUTTON_ID,
};

// Object for CSS selectors
 const TabBarSelectorsByCSS = {
  WALLET_BUTTON_CSS: TabBarSelectors.BROWSER_BUTTON_CSS,
};

// Object for XPATH selectors
 const TabBarSelectorsByXPATH = {
  WALLET_BUTTON_XPATH: TabBarSelectors.WALLET_BUTTON_XPATH,
};
 
// Object for Text Selectors
 TabBarTextSelectors
 
export { TabBarSelectorsByID, TabBarSelectorsByCSS, TabBarSelectorsByXPATH };
@cortisiko cortisiko added the epic label Oct 20, 2023
@metamaskbot metamaskbot added the INVALID-ISSUE-TEMPLATE Issue's body doesn't match any issue template. label Oct 20, 2023
@cortisiko cortisiko removed the INVALID-ISSUE-TEMPLATE Issue's body doesn't match any issue template. label Oct 20, 2023
@metamaskbot metamaskbot added the INVALID-ISSUE-TEMPLATE Issue's body doesn't match any issue template. label Oct 26, 2023
chrisleewilcox added a commit that referenced this issue Nov 6, 2023
## **Description**
Refactor selectors for
`/Users/chriswilcox/Desktop/metamask-mobile/e2e/pages/RequestPaymentView.js`.

Fixed issue with
`/Users/chriswilcox/Desktop/metamask-mobile/e2e/specs/wallet/request-token-flow.spec.js`
and how it was using fixtures.

## **Related issues**

Fixes: #7558 

## **Manual testing steps**

1. Go to this page...
2.
3.

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->

### **After**
Passed regression:
https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/da4ca135-c650-4f78-a5b7-b15e50b98ed7

## **Pre-merge author checklist**

- [x] I’ve followed [MetaMask Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've clearly explained what problem this PR is solving and how it
is solved.
- [x] I've linked related issues
- [ ] I've included manual testing steps
- [ ] I've included screenshots/recordings if applicable
- [x] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] 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.
- [ ] 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.
@metamaskbot metamaskbot added the release-7.11.0 Issue or pull request that will be included in release 7.11.0 label Nov 6, 2023
chrisleewilcox added a commit that referenced this issue Nov 6, 2023
## **Description**
- Refactored swaps tests and views
- Added selectors file for swaps
- Fixed flakyness with swaps tests
- Added swap test to smoke tests suite

## **Related issues**

Fixes: #7558 

## **Manual testing steps**

1. Go to this page...
2.
3.

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->

### **After**

![image](https://github.com/MetaMask/metamask-mobile/assets/6626407/56ffa90a-b1a6-44ab-ad0f-e38f66c2a549)


## **Pre-merge author checklist**

- [x] I’ve followed [MetaMask Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've clearly explained what problem this PR is solving and how it
is solved.
- [x] I've linked related issues
- [ ] I've included manual testing steps
- [ ] I've included screenshots/recordings if applicable
- [x] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] 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.
- [x] I’ve properly set the pull request status:
  - [x] In case it's not yet "ready for review", I've set it to "draft".
- [x] 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.
@chrisleewilcox chrisleewilcox reopened this Nov 7, 2023
@cortisiko
Copy link
Member Author

The work here is completed. Closing EPIC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
epic INVALID-ISSUE-TEMPLATE Issue's body doesn't match any issue template. release-7.11.0 Issue or pull request that will be included in release 7.11.0
Projects
None yet
3 participants