-
-
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: MetaMask setup in Cypress part 1 * feat: wallet setup is working as expected * fix: gitignore cleanup * fix: clean imports * fix: export from metamask package * fix: dependencies issues * fix: cleanup * fix: test scripts * fix: format * fix: renamed configureBeforeSynpress.ts to configureSynpress.ts * fix: improve metamask/cypress stability * fix: format * fix: cleanup * feat: Implemented getPlaywrightMetamask and addNewAccount * fix: cleanup * feat: Implemented switchNetwork and switchAccount for Cypress * feat: Added renameAccount for Cypress (#1187)
- Loading branch information
Showing
10 changed files
with
161 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 |
---|---|---|
@@ -0,0 +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) | ||
}) | ||
}) | ||
|
||
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
it('should switch network', () => { | ||
cy.getNetwork().should('eq', 'Ethereum Mainnet') | ||
|
||
const targetNetwork = 'Linea Mainnet' | ||
cy.switchNetwork(targetNetwork).then(() => { | ||
cy.getNetwork().should('eq', targetNetwork) | ||
}) | ||
}) | ||
|
||
it('should switch network to the testnet', () => { | ||
cy.getNetwork().should('eq', 'Ethereum Mainnet') | ||
|
||
const targetNetwork = 'Sepolia' | ||
cy.switchNetwork(targetNetwork, true).then(() => { | ||
cy.getNetwork().should('eq', targetNetwork) | ||
}) | ||
}) | ||
|
||
afterEach(() => { | ||
cy.switchNetwork('Ethereum Mainnet') | ||
}) |
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