-
Notifications
You must be signed in to change notification settings - Fork 34
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
When running this code.
import { BrowserContext, expect, test as baseTest } from "@playwright/test";
import dappwright, { Dappwright, MetaMaskWallet } from "@tenkeylabs/dappwright";
export const test = baseTest.extend<{
context: BrowserContext;
wallet: Dappwright;
}>({
context: async ({}, use) => {
// Launch context with extension
const [wallet, _, context] = await dappwright.bootstrap("", {
wallet: "metamask",
version: MetaMaskWallet.recommendedVersion,
seed: "test test test test test test test test test test test junk", // Hardhat's default https://hardhat.org/hardhat-network/docs/reference#accounts
headless: false,
});
// Add Hardhat as a custom network
await wallet.addNetwork({
networkName: "Hardhat",
rpc: "http://localhost:8546",
chainId: 31337,
symbol: "ETH",
});
await use(context);
},
wallet: async ({ context }, use) => {
const metamask = await dappwright.getWallet("metamask", context);
await use(metamask);
},
});
will throw the following error
SyntaxError: async innerText() {
return (await this._elementChannel.innerText()).value;
}
> 25 | await wallet.addNetwork({
To Reproduce
Steps to reproduce the behavior:
- Go to example document at README
- run tests with playright
- see error
Logs
1) [chrome-latest:Windows 11-browserstack] › wallet-test.spec.ts:5:5 › wallet_test ───────────────
SyntaxError: async innerText() {
return (await this._elementChannel.innerText()).value;
}
at ../with-web3-test.ts:25
23 | // });
24 |
> 25 | await wallet.addNetwork({
| ^Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.

System:
- OS: Ventrua
- OS version: 13.6.7
- NodeJs version: v20.17.0
- dAppwright version: ^2.8.6
- testing framework [e.g jest]: playwight
- testing framework versions: playwright: 1.40.1, @playwright/test: 1.40.1
Additional context
Add any other context about the problem here.
maxmaxme
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working