Skip to content

Instantly share code, notes, and snippets.

@yvesbou
Last active June 3, 2022 13:34
Show Gist options
  • Save yvesbou/dd68bf45d2c9cdd2584f6ea1aa6436fb to your computer and use it in GitHub Desktop.
Save yvesbou/dd68bf45d2c9cdd2584f6ea1aa6436fb to your computer and use it in GitHub Desktop.
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