-
-
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: new network and switch network Cypress APIs
- Loading branch information
Showing
4 changed files
with
69 additions
and
2 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
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,16 @@ | ||
it('should add a new network', () => { | ||
cy.createAnvilNode({ | ||
chainId: 1338, | ||
port: 8546 | ||
}).then(() => { | ||
cy.get('#addEthereumChain').click() | ||
|
||
cy.approveNewNetwork().then(() => { | ||
cy.approveSwitchNetwork().then(() => { | ||
cy.get('#chainId').should('have.text', '0x53a') | ||
|
||
cy.emptyAnvilNode() | ||
}) | ||
}) | ||
}) | ||
}) |
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,16 @@ | ||
it('should switch to the requested network', () => { | ||
cy.createAnvilNode({ | ||
chainId: 1338, | ||
port: 8546 | ||
}).then(() => { | ||
cy.switchNetwork('Ethereum Mainnet').then(() => { | ||
cy.get('#chainId').should('have.text', '0x1') | ||
|
||
cy.get('#switchEthereumChain').click() | ||
|
||
cy.approveSwitchNetwork().then(() => { | ||
cy.get('#chainId').should('have.text', '0x53a') | ||
}) | ||
}) | ||
}) | ||
}) |