Created
March 30, 2022 09:40
-
-
Save maxhoheiser/1fd33e000f8d10db2031f3fd8b418ca2 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
Cypress.Commands.add("disconnectAllAccountsFromAllDapps", () => { | |
cy.visit(`/`); | |
cy.get("[data-cy=metamaskButton]").then(($btn) => { | |
if ($btn.text() !== "Connect Wallet") { | |
cy.switchToAccount(1); | |
cy.disconnectMetamaskWalletFromDapp().should("be.true"); | |
cy.switchMetamaskAccount(2).should("be.true"); | |
cy.disconnectMetamaskWalletFromDapp().should("be.true"); | |
cy.switchMetamaskAccount(3).should("be.true"); | |
cy.disconnectMetamaskWalletFromDapp().should("be.true"); | |
cy.visit("/"); | |
cy.findByRole("button", { name: /connect wallet/i }).should("be.visible"); | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment