Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ feat: Synpress with MetaMask mock #1123

Merged
merged 5 commits into from
Apr 8, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions examples/new-dawn/test/e2e/00_mock.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { MetaMaskMock, testWithMetaMaskMock } from '@synthetixio/synpress'

const test = testWithMetaMaskMock

const { expect } = test

test('should work to the MetaMask Test Dapp', async ({ page }) => {
const metamask = new MetaMaskMock(page)
Fixed Show fixed Hide fixed

await page.goto('/')

await expect(page.locator('#accounts')).toHaveText('0xd73b04b0e696b0945283defa3eee453814758f1a')

await page.locator('#getAccounts').click()
await expect(page.locator('#getAccountsResult')).toHaveText('0xd73b04b0e696b0945283defa3eee453814758f1a')
})
2 changes: 1 addition & 1 deletion packages/tsconfig/base.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "https://json.schemastore.org/tsconfig",
"compilerOptions": {
"target": "ES2022",
"lib": ["ES2022"],
"lib": ["ES2022", "DOM"],
"moduleResolution": "bundler",
"module": "ES2022",
"verbatimModuleSyntax": true,
Expand Down
Loading
Loading