JSPM

  • Created
  • Published
  • Downloads 1409
  • Score
    100M100P100Q108067F
  • License MIT

browser wallets for playwright

Package Exports

  • w3wallets
  • w3wallets/dist/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (w3wallets) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

w3wallets

License npm version CodeQL

Web3 wallets for Playwright.

This library provides methods for interacting with Web3 wallets using Playwright.

npm install -D w3wallets

Getting Started

The Backpack and the Polkadot{.js} wallets are currently supported.

1. Download wallets

npx w3wallets backpack polkadotJS

The unzipped files should be stored in the .w3wallets/<wallet-name> directory. Add them to .gitignore.

2. Wrap your fixture withWallets

import { test as base } from "@playwright/test";
import { withWallets } from "../src/withWallets";

// Specify one or many wallets that should be installed in the browser
const test = withWallets(base, "backpack", "polkadotJS");

test("has title", async ({ page, backpack }) => {
  await page.goto("https://playwright.dev/");

  const privateKey =
    "4wDJd9Ds5ueTdS95ReAZGSBVkjMcNKbgZk47xcmqzpUJjCt7VoB2Cs7hqwXWRnopzXqE4mCP6BEDHCYrFttEcBw2";

  await backpack.onboard("Eclipse", privateKey);
});

Run tests

To work on this project in VS Code, make sure you open the project's root directory.

  1. Create the .env using .env.example as a reference.
  2. Install dependencies
yarn
  1. Install Chrome browser
npx playwright install chromium
  1. Download wallet extensions
npx w3wallets backpack polkadotJS
  1. Start UI
yarn start:ui
  1. Run Tests with Playwright
yarn test