-
-
Notifications
You must be signed in to change notification settings - Fork 196
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
188 additions
and
251 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 |
---|---|---|
@@ -1,38 +1,29 @@ | ||
import { | ||
EthereumWalletMock, | ||
testWithEthereumWalletMock, | ||
} from "@synthetixio/synpress"; | ||
import { EthereumWalletMock, testWithEthereumWalletMock } from '@synthetixio/synpress' | ||
|
||
const test = testWithEthereumWalletMock; | ||
const test = testWithEthereumWalletMock | ||
|
||
const { expect } = test; | ||
const { expect } = test | ||
|
||
test("should mock MetaMask in the Test Dapp", async ({ page, walletMock }) => { | ||
expect(await walletMock.getAllAccounts()).toHaveLength(1); | ||
test('should mock MetaMask in the Test Dapp', async ({ page, walletMock }) => { | ||
expect(await walletMock.getAllAccounts()).toHaveLength(1) | ||
|
||
await page.locator("#connectButton").click(); | ||
await page.locator('#connectButton').click() | ||
|
||
await expect(page.locator("#accounts")).toHaveText( | ||
"0xd73b04b0e696b0945283defa3eee453814758f1a" | ||
); | ||
await expect(page.locator('#accounts')).toHaveText('0xd73b04b0e696b0945283defa3eee453814758f1a') | ||
|
||
await page.locator("#getAccounts").click(); | ||
await expect(page.locator("#getAccountsResult")).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 walletMock = new EthereumWalletMock(page); | ||
test('should add new account using MetaMask mock', async ({ page }) => { | ||
const walletMock = new EthereumWalletMock(page) | ||
|
||
await walletMock.importWallet( | ||
"candy maple cake sugar pudding cream honey rich smooth crumble sweet treat" | ||
); | ||
await walletMock.addNewAccount(); | ||
await walletMock.importWallet('candy maple cake sugar pudding cream honey rich smooth crumble sweet treat') | ||
await walletMock.addNewAccount() | ||
|
||
await page.locator("#connectButton").click(); | ||
await page.locator('#connectButton').click() | ||
|
||
await expect(page.locator("#accounts")).toHaveText( | ||
"0x6503D95e3F20389EE9496b277ABfFDb8eCCD2cc5,0xd73b04b0e696b0945283defa3eee453814758f1a" | ||
); | ||
}); | ||
await expect(page.locator('#accounts')).toHaveText( | ||
'0x6503D95e3F20389EE9496b277ABfFDb8eCCD2cc5,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
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
export * from "./ethereum-wallet-mock"; | ||
export * from "./utils"; | ||
export * from "./testWithEthereumWalletMock"; | ||
export * from './ethereum-wallet-mock' | ||
export * from './utils' | ||
export * from './testWithEthereumWalletMock' |
Oops, something went wrong.