MetaMask / MetaMask/metamask-mobile

[Bug] Refactor EditAccountNameView.js file to follow the correct

Open
#11,447 1 comment 1 reaction 0 assignees View on GitHub
external-contributor team-accounts-framework type-refactor
Dominant language
TypeScript
Stars
3k
Forks
1.7k
Avg merge
1d 14h
Merged PRs (30d)
669

Description

### What is this about?

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.

This page file was introduce in this pr: https://github.com/MetaMask/metamask-mobile/pull/10450
### Scenario

_No response_

### Design

_No response_

### Technical Details

Files inside the scope for this batch:

- EditAccountNameView.js

We want our pages to follow the below pattern:

Page object
```
import {CAROUSEL_SCREEN_ONE_IMAGE_ID,
WELCOME_SCREEN_GET_STARTED_BUTTON_ID,
} from '../screen-objects/testIDs/Screens/WelcomeScreen.testIds';

class OnboardingCarouselView {

get carosuelScreenOneImage() {
return Matchers.getElementByID(CAROUSEL_SCREEN_ONE_IMAGE_ID);
}

get welcomeButton() {
return Matchers.getElementByID(WELCOME_SCREEN_GET_STARTED_BUTTON_ID);
}

async tapOnGetStartedButton() {
await Gestures.tapAndLongPress(this.welcomeButton);
}

}

```
Test Code:
```
import OnboardingCarouselView from '../pages/Onboarding/OnboardingCarouselView';

import Assertions from '../utils/Assertions';

describe('Example test', () => {
it('should verify onboarding', async () => {
const OnBoardingCarousel = await OnboardingView.carosuelScreenOneImageID;
await Assertions.checkIfVisible(OnBoardingCarousel);

await OnboardingCarouselView.tapOnGetStartedButton();

});
});

````

### Threat Modeling Framework

_No response_

### Acceptance Criteria

_No response_

### Stakeholder review needed before the work gets merged

- [ ] Engineering (needed in most cases)
- [ ] Design
- [ ] Product
- [ ] QA (automation tests are required to pass before merging PRs but not all changes are covered by automation tests - please review if QA is needed beyond automation tests)
- [ ] Security
- [ ] Legal
- [ ] Marketing
- [ ] Management (please specify)
- [ ] Other (please specify)

### References

_No response_

Contributor guide

Open the contributing guide

Research direction

Start by locating EditAccountNameView.js in the modal folder and its associated testIDs, then compare the page object and test usage with the pattern shown in the issue. Review the tests that reference this page object; done means the file and test IDs follow that pattern and the relevant automation tests pass.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react-native
Domain
mobile, testing-qa
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.