-
-
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
- Loading branch information
Showing
9 changed files
with
149 additions
and
28 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,15 @@ | ||
import type { BrowserContext, Page } from '@playwright/test' | ||
import { MetaMask } from '../playwright' | ||
|
||
let metamask: MetaMask | undefined | ||
|
||
export default function getPlaywrightMetamask( | ||
context: BrowserContext, | ||
metamaskExtensionPage: Page, | ||
metamaskExtensionId: string | ||
) { | ||
if (!metamask) { | ||
metamask = new MetaMask(context, metamaskExtensionPage, 'password', metamaskExtensionId) | ||
} | ||
return metamask | ||
} |
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
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,7 @@ | ||
it('should add a new account with a specified name', () => { | ||
const accountName = 'Test Account 2' | ||
|
||
cy.addNewAccount(accountName).then(() => { | ||
cy.getAccount().should('eq', accountName) | ||
}) | ||
}) |
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,6 @@ | ||
it('should connect account to the app', () => { | ||
cy.get('#connectButton').click() | ||
cy.connectToDapp() | ||
|
||
cy.get('#accounts').should('contain', '0x') | ||
}) |