-
-
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: Added renameAccount for Cypress (#1187)
- Loading branch information
Showing
10 changed files
with
82 additions
and
15 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export const defaultAccount = 'Account 1' |
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
21 changes: 19 additions & 2 deletions
21
wallets/metamask/src/playwright/pages/HomePage/actions/renameAccount.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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { defaultAccount } from '../../src/cypress/constans' | ||
|
||
const newAccountName = 'New Test Account Name' | ||
|
||
it('should rename currently connected account with specified name', () => { | ||
cy.addNewAccount(newAccountName).then(() => { | ||
cy.renameAccount(newAccountName, 'Renaming test').then(() => { | ||
cy.getAccount().should('eq', 'Renaming test') | ||
}) | ||
}) | ||
}) | ||
|
||
after(() => { | ||
cy.switchAccount(defaultAccount) | ||
}) |
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 |
---|---|---|
@@ -1,11 +1,13 @@ | ||
import { defaultAccount } from '../../src/cypress/constans' | ||
|
||
it('should switch back to the `Account 1` account', () => { | ||
const accountName = 'New Account to test switch' | ||
|
||
cy.addNewAccount(accountName).then(() => { | ||
cy.getAccount().should('eq', accountName) | ||
|
||
cy.switchAccount('Account 1').then(() => { | ||
cy.getAccount().should('eq', 'Account 1') | ||
}) | ||
}) | ||
}) | ||
|
||
after(() => { | ||
cy.switchAccount(defaultAccount) | ||
}) |
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