Skip to content

Commit

Permalink
fix: Flaky test Account Custom Name.. (#26062)
Browse files Browse the repository at this point in the history
<!--
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**

This PR address the fix flaky test related to the `Account Custom Name
Persistence persists custom account label through account change and
wallet lock`

Based on the screenshot from the pipeline, the Create button could not
be clicked. Therefore, it has been replaced with the
clickElementAndWaitToDisappear function.


https://app.circleci.com/pipelines/github/MetaMask/metamask-extension/92651/workflows/dac61e17-caa2-44ab-979c-05c38b16541b/jobs/3449337/tests

```
ElementClickInterceptedError: Element <button class="mm-box mm-text mm-button-base mm-button-base--size-sm mm-button-base--ellipsis multichain-account-picker mm-text--body-md-medium mm-text--ellipsis mm-box--padding-0 mm-box--padding-right-2 mm-box--padding-left-2 mm-box--display-inline-flex mm-box--gap-2 mm-box--justify-content-center mm-box--align-items-center mm-box--color-text-default mm-box--background-color-transparent mm-box--rounded-lg"> is not clickable at point (575,112) because another element <label class="mm-box mm-text mm-label mm-label--html-for mm-form-text-field__label mm-text--body-md mm-text--font-weight-medium mm-box--display-inline-flex mm-box--align-items-center mm-box--color-text-default"> obscures it
```

![image](https://github.com/user-attachments/assets/ace3cde9-cc42-453f-88c7-dace15daaa74)


<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/26062?quickstart=1)

## **Related issues**

Fixes:
#26061

## **Manual testing steps**

Execute the test locally or codespaces using below commands:
yarn
ENABLE_MV3=false yarn build:test:flask
ENABLE_MV3=false yarn test:e2e:single
test/e2e/accounts/create-snap-account.spec.ts --browser=firefox

There should not be CI failures related to the test.

## **Pre-merge author checklist**

- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.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-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [x] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [x] 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.

---------

Co-authored-by: Plasma Corral <[email protected]>
  • Loading branch information
hjetpoluru and plasmacorral authored Jul 24, 2024
1 parent f861486 commit 83e4b2a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion test/e2e/accounts/account-custom-name.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@ describe('Account Custom Name Persistence', function (this: Suite) {
'[data-testid="multichain-account-menu-popover-add-account"]',
);
await driver.fill('[placeholder="Account 2"]', anotherAccountLabel);
await driver.clickElement({ text: 'Create', tag: 'button' });
await driver.clickElementAndWaitToDisappear({
text: 'Create',
tag: 'button',
});
await locateAccountBalanceDOM(driver);

// Verify initial custom account label after freshly added account was active
Expand Down

0 comments on commit 83e4b2a

Please sign in to comment.