-
-
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(3615): E2E to check the labels displaying the default account an…
…d chain (#12830) <!-- 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** E2E to assert the permission summary is displaying the expected content after the user has connected with default account and chain. <!-- 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? --> ## **Related issues** Contributes to: MetaMask/MetaMask-planning#3615 ## **Manual testing steps** 1. `yarn watch:clean` 2. `yarn test:e2e:ios:debug:build` 3. `yarn test:e2e:ios:debug:run <path to test file>` ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** <!-- [screenshots/recordings] --> ## **Pre-merge author checklist** - [ ] I’ve followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.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-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **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
0157bb7
commit faf5340
Showing
5 changed files
with
86 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
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
63 changes: 63 additions & 0 deletions
63
e2e/specs/multichain/permission-system-summary-default-permissions.spec.js
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,63 @@ | ||
'use strict'; | ||
import TestHelpers from '../../helpers'; | ||
import { SmokeMultiChainPermissions } from '../../tags'; | ||
import Browser from '../../pages/Browser/BrowserView'; | ||
import TabBarComponent from '../../pages/wallet/TabBarComponent'; | ||
import ConnectedAccountsModal from '../../pages/Browser/ConnectedAccountsModal'; | ||
import FixtureBuilder from '../../fixtures/fixture-builder'; | ||
import { withFixtures } from '../../fixtures/fixture-helper'; | ||
import { loginToApp } from '../../viewHelper'; | ||
import Assertions from '../../utils/Assertions'; | ||
import PermissionSummaryBottomSheet from '../../pages/Browser/PermissionSummaryBottomSheet'; | ||
import { PermissionSummaryBottomSheetSelectorsText } from '../../selectors/Browser/PermissionSummaryBottomSheet.selectors'; | ||
|
||
describe( | ||
SmokeMultiChainPermissions('Permission System - Default Permissions'), | ||
() => { | ||
beforeAll(async () => { | ||
jest.setTimeout(150000); | ||
await TestHelpers.reverseServerPort(); | ||
}); | ||
|
||
it('should display default account and chain permissions in permission summary', async () => { | ||
// Test setup with fixtures | ||
await withFixtures( | ||
{ | ||
dapp: true, | ||
fixture: new FixtureBuilder() | ||
.withPermissionControllerConnectedToTestDapp() | ||
.withChainPermission() // Initialize with Ethereum mainnet only | ||
.build(), | ||
restartDevice: true, | ||
}, | ||
async () => { | ||
// Step 1: Initial app setup | ||
await loginToApp(); | ||
await TabBarComponent.tapBrowser(); | ||
await Browser.navigateToTestDApp(); | ||
|
||
// Step 2: Navigate to permissions management | ||
await Browser.tapNetworkAvatarButtonOnBrowser(); | ||
await ConnectedAccountsModal.tapManagePermissionsButton(); | ||
|
||
// Step 3: Verify account permissions | ||
const accountLabelElement = | ||
await PermissionSummaryBottomSheet.accountPermissionLabelContainer; | ||
const accountLabelAttributes = | ||
await accountLabelElement.getAttributes(); | ||
const accountLabel = accountLabelAttributes.label; | ||
|
||
await Assertions.checkIfTextMatches( | ||
accountLabel, | ||
PermissionSummaryBottomSheetSelectorsText.ACCOUNT_ONE_LABEL, | ||
); | ||
|
||
// Step 4: Verify chain permissions | ||
await Assertions.checkIfVisible( | ||
PermissionSummaryBottomSheet.ethereumMainnetText, | ||
); | ||
}, | ||
); | ||
}); | ||
}, | ||
); |