-
-
Notifications
You must be signed in to change notification settings - Fork 200
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ feat: Synpress with MetaMask mock (#1123)
* ✨ feat: Synpress with metamask mock * fix: cleanup * fix: dependencies * fix: e2e test * fix: refreshed PPOM testing scenarios
- Loading branch information
Showing
25 changed files
with
1,143 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { MetaMaskMock, testWithMetaMaskMock } from '@synthetixio/synpress' | ||
|
||
const test = testWithMetaMaskMock | ||
|
||
const { expect } = test | ||
|
||
test('should mock MetaMask in the Test Dapp', async ({ page }) => { | ||
await page.goto('/') | ||
|
||
await expect(page.locator('#accounts')).toHaveText('0xd73b04b0e696b0945283defa3eee453814758f1a') | ||
|
||
await page.locator('#getAccounts').click() | ||
await expect(page.locator('#getAccountsResult')).toHaveText('0xd73b04b0e696b0945283defa3eee453814758f1a') | ||
}) | ||
|
||
test('should add new account using MetaMask mock', async ({ page }) => { | ||
const metamask = new MetaMaskMock(page) | ||
|
||
metamask.importWallet('candy maple cake sugar pudding cream honey rich smooth crumble sweet treat') | ||
await metamask.addNewAccount() | ||
|
||
await expect(page.locator('#accounts')).toHaveText('0xd73b04b0e696b0945283defa3eee453814758f1a') | ||
}) |
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
Oops, something went wrong.