-
-
Notifications
You must be signed in to change notification settings - Fork 195
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ feat: Get account address helper with missing token transfers (#1107)
## Motivation and context Missing e2e tests for token transfers with a function to get account address. ## Quality checklist - [x] I have performed a self-review of my code. - [x] If it is a core feature, I have added thorough e2e tests. **⚠️ 👆 Delete any section you see irrelevant before submitting the pull request 👆⚠️ ** --- <details open="true"><summary>Generated summary</summary> > ## TL;DR > This pull request introduces a new feature to the MetaMask wallet that allows users to retrieve the current account address. This is achieved by adding a new method `getAccountAddress` to the `MetaMask` class and the corresponding action in the `HomePage` class. > > ## What changed > - A new method `getAccountAddress` was added to the `MetaMask` class. > - A new action `getAccountAddress` was added to the `HomePage` class. > - The `HomePage` class was updated to include the new `getAccountAddress` action. > - The `HomePage` selectors were updated to include the selectors needed for the new action. > - The e2e tests were updated to include tests for the new feature. > > ## How to test > 1. Pull the changes from this branch to your local environment. > 2. Run the e2e tests using the command `npm run test:e2e`. > 3. All tests should pass, including the new tests for the `getAccountAddress` feature. > > ## Why make this change > This change is necessary to allow users to retrieve their current account address from the MetaMask wallet. This is a common requirement for many dApps and will improve the usability of the wallet. </details>
- Loading branch information
Showing
6 changed files
with
58 additions
and
1 deletion.
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
13 changes: 13 additions & 0 deletions
13
wallets/metamask/src/pages/HomePage/actions/getAccountAddress.ts
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,13 @@ | ||
import type { Page } from '@playwright/test' | ||
import Selectors from '../selectors' | ||
|
||
export default async function getAccountAddress(page: Page): Promise<string> { | ||
await page.locator(Selectors.threeDotsMenu.threeDotsButton).click() | ||
await page.locator(Selectors.threeDotsMenu.accountDetailsButton).click() | ||
|
||
const account = await page.locator(Selectors.copyAccountAddressButton).last().innerText() | ||
|
||
await page.locator(Selectors.threeDotsMenu.accountDetailsCloseButton).click() | ||
|
||
return account | ||
} |
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