{"id":17981134,"url":"https://github.com/featurist/browser-monkey","last_synced_at":"2025-03-25T18:31:09.364Z","repository":{"id":33490653,"uuid":"37136459","full_name":"featurist/browser-monkey","owner":"featurist","description":"Reliable DOM testing","archived":false,"fork":false,"pushed_at":"2023-01-11T19:04:20.000Z","size":2799,"stargazers_count":54,"open_issues_count":44,"forks_count":7,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-03-16T13:46:59.459Z","etag":null,"topics":["browser","browser-monkey","css-selector","dom","electron","karma","mocha","testing"],"latest_commit_sha":null,"homepage":"https://browsermonkey.org","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/featurist.png","metadata":{"files":{"readme":"readme.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-06-09T14:18:41.000Z","updated_at":"2025-03-09T05:22:06.000Z","dependencies_parsed_at":"2023-01-15T01:16:30.084Z","dependency_job_id":null,"html_url":"https://github.com/featurist/browser-monkey","commit_stats":null,"previous_names":[],"tags_count":90,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/featurist%2Fbrowser-monkey","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/featurist%2Fbrowser-monkey/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/featurist%2Fbrowser-monkey/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/featurist%2Fbrowser-monkey/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/featurist","download_url":"https://codeload.github.com/featurist/browser-monkey/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245519938,"owners_count":20628800,"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":["browser","browser-monkey","css-selector","dom","electron","karma","mocha","testing"],"created_at":"2024-10-29T18:07:50.687Z","updated_at":"2025-03-25T18:31:08.951Z","avatar_url":"https://github.com/featurist.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# browser monkey [![npm version](https://img.shields.io/npm/v/browser-monkey.svg)](https://www.npmjs.com/package/browser-monkey) [![npm](https://img.shields.io/npm/dm/browser-monkey.svg)](https://www.npmjs.com/package/browser-monkey) [![CircleCI](https://circleci.com/gh/featurist/browser-monkey.svg?style=svg)](https://circleci.com/gh/featurist/browser-monkey) [![Gitter chat](https://img.shields.io/gitter/room/nwjs/nw.js.svg)](https://gitter.im/featurist/stack)\n\nReliable DOM testing\n\n```bash\nnpm install browser-monkey\n```\n\nBrowser Monkey is a DOM assertion library. It helps you write framework agnostic browser tests that are reliable in the face of asynchronous behaviours like animations, AJAX and delayed rendering. It also helps you to write tests that exhibit the semantic meaning of the page, as opposed to a jumble of CSS selectors.\n\n* automatically waits for commands and assertions.\n* create rich DSLs for your page structure.\n* framework agnostic: works with React, Angular, jQuery, [Hyperdom](https://github.com/featurist/hyperdom) and many many more.\n* can simulate text entry and clicks.\n* returns promises that resolve when the elements are found.\n\nHere is an [example project](https://github.com/dereke/web-testing) that demonstrates how to use browser-monkey with Karma.\n\n[@dereke](https://github.com/dereke) has made an excellent [video](https://www.youtube.com/watch?v=WQZ2eIfmfEs) of a TDD session using browser-monkey.\n\n# Docs\n[Docs Website](https://browsermonkey.org)\n\n# example\n\n```js codesandbox: basic-example\nimport createMonkey from \"browser-monkey/create\";\nimport createTestDiv from \"browser-monkey/lib/createTestDiv\";\nimport hyperdom from \"hyperdom\";\nimport App from \"./app\";\n\ndescribe(\"beer app\", () =\u003e {\n  let page;\n\n  beforeEach(() =\u003e {\n    const $testContainer = createTestDiv();\n    hyperdom.append($testContainer, new App());\n    page = createMonkey($testContainer);\n  });\n\n  it(\"greets me\", async () =\u003e {\n    await page.find(\"h1\").shouldHave({ text: \"Hello Lubbers\" });\n  });\n\n  it(\"shows me beer\", async () =\u003e {\n    await page.click(\"Beer\");\n    await page.shouldHave({ text: \"Punk IPA\" });\n  });\n});\n```\n\u003ca href=\"https://codesandbox.io/api/v1/sandboxes/define?parameters=N4IgZglgNgpgziAXKADgQwMYGs0HMYB0AVnAPYB2SoGFALjObUiMADrkAEHrI5aAtjB6JuIAEYAnUgHc4MCQFp-FLDACeCmAA8BKWDwA07LjwBu8uBArDRARgIAGR4eOiAJvAwSIKWlfI2PABCUrLyHACyKuocYmiWGBwArnB4MBzauvogRpyi_GgQAUiiRR5aBAAWtPxQLnk8cF4-tHA2bHkmIHC0aBK0gSDoEhgwUBxl2lU14woKpCgM9VxdYknQboPDo-NrGxPk5dO1PK4AvrldHouHDBgQ8O2uq6FyisrkqmqDUGj0PcsVjxKmpFhI3KR-D8_vABiBzpd3DBTAARGA3Dzke6PEodFaibZjBRrQ6wCTQ_5w87sM7sEAXbojAD0aBQKAIcEWGGICGQIBojAYTEQIAg_BQpH6HC8MBhUU-MTAUn4okkMjeSmiaiZMphPAA3OwxRKpbr6AAVWEoiCmDhKyGq17yTUK7VQCBiHUSWUWq02g1G8WS2gcEFgiEq-0q4Gg-QRgPkY3BjgAQTZduVogILLZCfYHia3jEMAAFDxi-FWShDBwSwBKDgAXgAfBw8RxYCH0PhDQE8sWwJKYABRTCVEv1put9tcAU9DgAEkpAGE6IVyOFG9LvTDLT1raZ6738WG45CCFWGG4S0vYavGOv5AYOBvpKm2fW68eVt30luzTA8pfDeK5rkU8hfuckF9lwEC0GWIC4N6MCtBwgg1vEahYrWDYtm2zwcGg0iFF2aQEJAhwIZUtg8HWHKVKQSRQG4AASaDmCWwAcPQWi0CIPAsWMUCkBwAAySRiMWEhtCAHBnNBXDyb2rhwQhcAMbIaHpBW5I5IRcBYYkk54TOhHEXBHC_gQGDutgCFBDA8i0d-XBESRllkepjHMWxHFcTxfGiAACkknwcAAkkFKY8HJCmxb2Sn0gYjIYDm7IkFQ_J0EKzBJlKXHVLU-mhnJGYOjG4aQnmG5aCaIYeGAaBMSGNnxHA74oPheSYdh-C0A58jheQg6TqZHiduktCVBAcAEDpLnShQ87epyS1_mZ7lgChGDjsCtC0CgcCIEyOYQAQKChTgKBnTQ_BMqYABMTI6XATK2AAnA9zkEVNM1zY5EhNhtFkrRK5ByDyFBHtSMEcN6twSKNBHerQSQSJwu0gAURQ1gA2gRXCY9RNYCUJIniZJFi0YiJ4IWs-3WHpXEUDZEDYCIxmtr9s19QNEhDSNDYXKIfPUwT3HTbNOni1wAD8oYIW4_p6fjnT4urmNK6YNbc_98i4w4AC6BB8IIdY0-rtM8GKuA1lxcAjCIus6QbxtimkAD6aNQM-0gQG4U0iLYDgOLFMsrIbdbhyIoUNeBmxq5H360uQKdJSlTKTBUGV8gK9CMLlQb5YRbJXqVUaiKe4JVSAvZ5SGaadRXPDZlW1UnZelEQhgSSCIwBAAI5JPIagAMpjDAGC0JKCEAMRtyA5svjAb6N5-vbp1nxxQJlec5SKAA8ACEKIAPLLuaACaQXDqGMzNuwB-FVAD99k_spuK_rC0Affi0LAzYgp9B2BwUeaBDhiFIFoA-TI_4APYN_A-ghejSkqH0OQtBGw8AAKrmgAGIKAABwxSZK_GBlQP5f3IAfSBbg1Bfx_lrCYbgsEgAXs2GBWsqGIMLC0DgDsMCsIEZnW42cZIMJgbw3wZDnqkDoVQ8h996RnDOEAA\u0026query=module%3D%2Fsrc%2Fapp.spec.js\" target=\"_blank\" rel=\"noopener noreferrer\"\u003eRun this example\u003c/a\u003e\n\n\n## We're hiring!\n\nJoin our remote team and help us build amazing software. Check out [our career opportunities](https://www.featurist.co.uk/careers/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffeaturist%2Fbrowser-monkey","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffeaturist%2Fbrowser-monkey","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffeaturist%2Fbrowser-monkey/lists"}