Last active
June 3, 2022 13:34
-
-
Save yvesbou/dd68bf45d2c9cdd2584f6ea1aa6436fb to your computer and use it in GitHub Desktop.
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
describe('Test User Login', () => { | |
it('Connects with Metamask', () => { | |
cy.visit('http://localhost:3000') | |
// find "Connect Wallet" button and click it | |
cy.contains('Connect Wallet').click(); | |
// assuming there is only metamask popping up | |
// always important to switch between metamask and cypress window | |
cy.switchToMetamaskWindow(); | |
// connect to dapp | |
cy.acceptMetamaskAccess().should("be.true"); | |
cy.confirmMetamaskSignatureRequest(); | |
// switch back to cypress window (your dApp) | |
cy.switchToCypressWindow(); | |
// check UI change | |
cy.contains('...').should('be.visible'); | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment