2.2.3 • Published 6 months ago

metamask-testing-tools v2.2.3

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

metamask-testing-tools

This is a collection of tools for testing metamask, metamask flask and metamask snaps with Playwright.

Install

pnpm add metamask-testing-tools -D

Usage

This package is meant to be used with Playwright. It provides a createFixture function that returns a test and expect function that can be used to write tests.

More information on writing tests with Playwright can be found here.

// tests.spec.js

import { createFixture } from 'metamask-testing-tools'

const { test, expect } = createFixture({
  download: {
    flask: true,
  },
  snap: {
    snapId: 'npm:@filsnap',
  },
})

test('should get address mainnet', async ({ metamask, page }) => {
  const result = await metamask.invokeSnap({
    request: {
      method: 'fil_getAddress',
    },
    page,
  })

  expect(result).toBe('f1jbnosztqwadgh4smvsnojdvwjgqxsmtzy5n5imi')
})

Docs

Check https://hugomrdias.github.io/filsnap-testing/modules/metamask_testing_tools.html

ENV variables

These variables can be used to override the default values.

  • GITHUB_TOKEN - GitHub API token to download metamask from github releases.
  • METAMASK_TAG - Tag of metamask to download. Defaults to latest.
  • METAMASK_MNEMONIC - Seed to use for metamask.
  • METAMASK_PASSWORD - Password to use for metamask.
  • METAMASK_SNAP_ID - Snap ID to use for metamask.
  • METAMASK_SNAP_VERSION - Snap version to use for metamask.
2.2.3

6 months ago

2.2.1

8 months ago

2.2.0

8 months ago

2.2.2

8 months ago

2.1.0

8 months ago

1.2.8

10 months ago

1.2.7

10 months ago

2.0.1

9 months ago

2.0.0

9 months ago

1.2.6

1 year ago

1.2.5

1 year ago

1.2.4

1 year ago

1.2.2

1 year ago

1.2.1

1 year ago

1.2.0

1 year ago

1.1.9

2 years ago

1.1.8

2 years ago

1.1.7

2 years ago

1.1.10

2 years ago

1.1.6

2 years ago

1.1.1

2 years ago

1.0.2

2 years ago

1.1.0

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago

1.1.5

2 years ago

1.1.4

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

1.0.3

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago