{"id":13604950,"url":"https://github.com/ChainSafe/dappeteer","last_synced_at":"2025-04-12T02:32:20.867Z","repository":{"id":37478768,"uuid":"338263289","full_name":"ChainSafe/dappeteer","owner":"ChainSafe","description":"[DEPRECATED]🏌🏼‍E2E testing for dApps using Puppeteer + MetaMask","archived":true,"fork":false,"pushed_at":"2024-04-12T09:01:04.000Z","size":17856,"stargazers_count":493,"open_issues_count":42,"forks_count":154,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-04-08T20:49:08.335Z","etag":null,"topics":["arhived","dapp","deprecated","e2e","ethereum","frontend","playwright","pupeteer"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"decentraland/dappeteer","license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ChainSafe.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-02-12T08:37:28.000Z","updated_at":"2025-03-23T07:54:58.000Z","dependencies_parsed_at":"2024-04-12T10:25:02.646Z","dependency_job_id":"cc52d3c8-0b54-4a6b-b743-5f38183a5a07","html_url":"https://github.com/ChainSafe/dappeteer","commit_stats":{"total_commits":258,"total_committers":22,"mean_commits":"11.727272727272727","dds":0.5697674418604651,"last_synced_commit":"b79ab4c74fab87747933d8f428624dcbffc3dd19"},"previous_names":[],"tags_count":34,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChainSafe%2Fdappeteer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChainSafe%2Fdappeteer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChainSafe%2Fdappeteer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChainSafe%2Fdappeteer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ChainSafe","download_url":"https://codeload.github.com/ChainSafe/dappeteer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248506923,"owners_count":21115509,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["arhived","dapp","deprecated","e2e","ethereum","frontend","playwright","pupeteer"],"created_at":"2024-08-01T19:00:53.013Z","updated_at":"2025-04-12T02:32:20.423Z","avatar_url":"https://github.com/ChainSafe.png","language":"TypeScript","funding_links":[],"categories":["Web3 Testing"],"sub_categories":["Whitepapers"],"readme":"## Deprecation Notice\n\n**Notice:** dAppeteer is deprecated and is no longer actively maintained. Due to ongoing changes in the MetaMask ecosystem and constraints in our resources, we have decided to discontinue development. This repository will remain available in a read-only, archived state.\n\n**Alternatives:**\nWe encourage users to explore the following alternatives, which provide continued support and active development for dApp testing:\n- **Synpress**: A robust testing framework with strong community support. [Explore Synpress on GitHub](https://github.com/Synthetixio/synpress).\n- **Official Way to Test Snaps**: Learn the recommended methods for testing your MetaMask Snaps. [Find out how to test a snap here](https://docs.metamask.io/snaps/how-to/test-a-snap/).\n\nWe thank our community for the support and contributions over the years. For any additional questions or guidance on transitioning to new tools, please feel free to reach out.\n\nThank you for your understanding and collaboration.\n\n# dAppeteer\n\nE2E testing for dApps using Puppeteer + MetaMask\n\n## Installation\n\n```\n$ npm install -s @chainsafe/dappeteer\n```\nor\n```\n$ yarn add @chainsafe/dappeteer\n```\n\n## Usage\n\n```js\nimport dappeteer from '@chainsafe/dappeteer';\n\nasync function main() {\n  const { metaMask, browser } = await dappeteer.bootstrap();\n\n  // create a new page and visit your dapp\n  const dappPage = await browser.newPage();\n  await dappPage.goto('http://my-dapp.com');\n\n  // you can change the network if you want\n  await metaMask.switchNetwork('goerli');\n\n  // do something in your dapp that prompts MetaMask to add a Token\n  const addTokenButton = await dappPage.$('#add-token');\n  await addTokenButton.click();\n  // instruct MetaMask to accept this request\n  await metaMask.acceptAddToken();\n\n  // do something that prompts MetaMask to confirm a transaction\n  const payButton = await dappPage.$('#pay-with-eth');\n  await payButton.click();\n\n  // 🏌\n  await metaMask.confirmTransaction();\n}\n\nmain();\n```\n\n## Usage with Snaps\n\n```js\nimport dappeteer from '@chainsafe/dappeteer';\nimport { exec } from \"child_process\";\n\nasync function buildSnap(): Promise\u003cstring\u003e {\n  console.log(`Building my-snap...`);\n  await new Promise((resolve, reject) =\u003e {\n    exec(`cd ./my-snap \u0026\u0026 npx mm-snap build`, (error, stdout) =\u003e {\n      if (error) {\n        reject(error);\n        return;\n      }\n      resolve(stdout);\n    });\n  });\n\n  return \"./my-snap\";\n}\n\nasync function main() {\n  // build your local snap\n  const builtSnapDir = await buildSnap()\n\n  // setup dappateer and install your snap\n  const { metaMask, snapId, browser } = await dappeteer.initSnapEnv({\n    snapIdOrLocation: builtSnapDir,\n  });\n\n  // you need to have a webpage open to interact with MetaMask, you can also visit a dApp page\n  const dappPage = await browser.newPage();\n  await dappPage.goto('http://example.org/');\n\n  // invoke a method from your snap that prompts users with approve/reject dialog\n  await metaMask.snaps.invokeSnap(dappPage, snapId, \"my-method\")\n\n  // instruct MetaMask to accept this request\n  await metaMask.snaps.dialog.positive();\n\n  // get the notification emitter and the promise that will receive the notifications\n  const emitter = await metaMask.snaps.getNotificationEmitter();\n  const notificationPromise = emitter.waitForNotification();\n\n  // do something that prompts your snap to emit notifications\n  await metaMask.snaps.invokeSnap(dappPage, snapId, \"notify\");\n\n  // Make sure the notification promise has resolved\n  await notificationPromise;\n\n  // You can now read the snap notifications and run tests against them\n  const notifications = await metaMask.snaps.getAllNotifications();\n}\n\nmain();\n```\n\n- All methods can be found on [API page](docs/API.md)  \n- Instructions to setup [dAppeteer with Jest](docs/JEST.md)  \n- Mocha example can be found [inside test folder](./test)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FChainSafe%2Fdappeteer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FChainSafe%2Fdappeteer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FChainSafe%2Fdappeteer/lists"}