All Projects → decentraland → Dappeteer

decentraland / Dappeteer

Licence: other
🏌🏼‍E2E testing for dApps using Puppeteer + MetaMask

Projects that are alternatives of or similar to Dappeteer

Unstoppable Wallet Ios
A secure and decentralized Bitcoin and other cryptocurrency wallet for iPhone. Supports Bitcoin, Ethereum, EOS, Binance Chain, Bitcoin Cash, DASH, ...
Stars: ✭ 180 (+53.85%)
Mutual labels:  ethereum, dapps
Kyberswap
Codebase for KyberSwap that helps users convert tokens instantly and directly from their own hardware wallets, metamask and so on. No setup, No deposit, no withdrawal needed. Try it out on https://kyberswap.com or join telegram for developers https://t.me/KyberDeveloper.
Stars: ✭ 301 (+157.26%)
Mutual labels:  ethereum, dapps
playwright-demos
playwright for scrapping and UI testing / automate testing workflows
Stars: ✭ 65 (-44.44%)
Mutual labels:  e2e, puppeteer
Contracts
Smart contracts comprising the business logic of the Matic Network
Stars: ✭ 130 (+11.11%)
Mutual labels:  ethereum, dapps
Hardhat
Hardhat is a development environment to compile, deploy, test, and debug your Ethereum software. Get Solidity stack traces & console.log.
Stars: ✭ 727 (+521.37%)
Mutual labels:  ethereum, dapps
Mastering Ethereum
分散アプリケーションプラットフォーム「ethereum」の入門書
Stars: ✭ 165 (+41.03%)
Mutual labels:  ethereum, dapps
Recorder
A browser extension that generates Cypress, Playwright and Puppeteer test scripts from your interactions 🖱 ⌨
Stars: ✭ 277 (+136.75%)
Mutual labels:  e2e, puppeteer
jest-puppeteer-istanbul
Collect code coverage information from end-to-end jest puppeteer tests
Stars: ✭ 26 (-77.78%)
Mutual labels:  e2e, puppeteer
Web3modal
A single Web3 / Ethereum provider solution for all Wallets
Stars: ✭ 515 (+340.17%)
Mutual labels:  ethereum, dapps
Token Wizard
(Discontinued) TokenWizard is an DApp to create and manage crowdsale and token contracts using a simple UI
Stars: ✭ 353 (+201.71%)
Mutual labels:  ethereum, dapps
Awesome Solidity
⟠ A curated list of awesome Solidity resources, libraries, tools and more
Stars: ✭ 3,078 (+2530.77%)
Mutual labels:  ethereum, dapps
Etherkit
Stars: ✭ 36 (-69.23%)
Mutual labels:  ethereum, dapps
Typescript Solidity Dev Starter Kit
Starter kit for smart contract development using Typescript
Stars: ✭ 127 (+8.55%)
Mutual labels:  ethereum, dapps
Trust Ray
☁️ API for the Trust Wallet. Project no longer supported and current version used as source of transactions and address tokens in Blockatlas https://github.com/trustwallet/blockatlas/blob/master/config.yml#L64
Stars: ✭ 172 (+47.01%)
Mutual labels:  ethereum, dapps
Pending Xhr Puppeteer
Small tool to wait that all xhr are finished in puppeteer
Stars: ✭ 227 (+94.02%)
Mutual labels:  e2e, puppeteer
Squeezer
Squeezer Framework - Build serverless dApps
Stars: ✭ 3,242 (+2670.94%)
Mutual labels:  ethereum, dapps
Ethereum book
精通以太坊 (中文版)
Stars: ✭ 875 (+647.86%)
Mutual labels:  ethereum, dapps
Tib
Easy e2e browser testing in Node
Stars: ✭ 64 (-45.3%)
Mutual labels:  e2e, puppeteer
Erc 1155
Ethereum Multi-Token Standard (ERC-1155)
Stars: ✭ 112 (-4.27%)
Mutual labels:  ethereum
Ethereum Staking Guide
Ethereum 2.0 Staking Guides
Stars: ✭ 116 (-0.85%)
Mutual labels:  ethereum

dAppeteer

E2E testing for dApps using Puppeteer + MetaMask

Installation

$ npm install -s dappeteer

Usage

import puppeteer from 'puppeteer'
import dappeteer from 'dappeteer'

async function main() {
  const browser = await dappeteer.launch(puppeteer)
  const metamask = await dappeteer.getMetamask(browser)

  // create or import an account
  // await metamask.createAccount()
  await metamask.importAccount('already turtle birth enroll since...')

  // you can change the network if you want
  await metamask.switchNetwork('ropsten')

  // go to a dapp and do something that prompts MetaMask to confirm a transaction
  const page = await browser.newPage()
  await page.goto('http://my-dapp.com')
  const payButton = await page.$('#pay-with-eth')
  await payButton.click()

  // 🏌
  await metamask.confirmTransaction()
}

main()

API

  • dappeteer.launch(puppeteer[, launchOptions]): returns an instance of browser, same as puppeteer.launch, but it also installs the MetaMask extension. It supports all the regular puppeteer.launch options as a second argument with the addition of two extra ones:

    • metamaskPath: Path to the MetaMask extension (by default it uses the one bundled)

    • extensionUrl: URL of the MetaMask extension, by default it is chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/popup.html but if you use a different version you might need to change it use the right extension id.

  • dappeteer.getMetaMask(browser): returns a promise that resolves to an object that allows you to interact with MetaMask by using the following methods:

    • metamask.createAccount([password]): it commands MetaMask to create a new account, it resolves when it's done. It can only be used while you haven't signed in yet, otherwise it throws. The password is optional, it defaults to password1234.

    • metamask.importAccount(seed[, password]): it commands MetaMask to import an account, you need to provide the twelve words seed. It can only be used while you haven't signed in yet, otherwise it throws. The password is optional, it defaults to password1234.

    • metamask.switchAccount(accountIndex): it commands MetaMask to switch to a different account, by passing the index/position of the account in the accounts list.

    • metamask.importPK(privateKey): it commands MetaMask to import an private key. It can only be used while you haven't signed in yet, otherwise it throws.

    • metamask.lock(): signs out from MetaMask. It can only be used if you arelady signed it, otherwise it throws.

    • metamask.unlock([password]): it unlocks the MetaMask extension. It can only be used in you locked/signed out before, otherwise it throws. The password is optional, it defaults to password1234.

    • metamask.switchNetwork(networkName): it changes the current selected network. networkName can take the following values: "main", "ropsten", "rinkeby", "kovan", "localhost".

    • metamask.addNetwork(url): it adds a custom network to MetaMask.

    • metamask.confirmTransaction([{ gas, gasLimit }]): commands MetaMask to submit a transaction. For this to work MetaMask has to be in a transaction confirmation state (basically promting the user to submit/reject a transaction). You can (optionally) pass an object with gas and/or gasLimit, by default they are 20 and 50000 respectively.

    • metamask.sign(): commands MetaMask to sign a message. For this to work MetaMask must be in a sign confirmation state.

    • metamask.approve(): enables the app to connect to MetaMask account in privacy mode

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].