{"id":20196532,"url":"https://github.com/endalk200/puppeteer-plugins","last_synced_at":"2025-05-07T04:31:20.434Z","repository":{"id":39750404,"uuid":"496131105","full_name":"endalk200/puppeteer-plugins","owner":"endalk200","description":"Puppeteer plugin that extends puppeteer features and contains utility and helper functions that makes working with puppeteer enjoyable.","archived":true,"fork":false,"pushed_at":"2023-07-19T16:06:50.000Z","size":873,"stargazers_count":5,"open_issues_count":3,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-18T03:45:10.203Z","etag":null,"topics":["helpers","helpers-library","puppeteer","puppeteer-helpers","puppeteer-plugins","puppeteer-utils","utils","utils-library"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/endalk200.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-05-25T07:42:46.000Z","updated_at":"2025-02-08T17:17:40.000Z","dependencies_parsed_at":"2024-11-14T07:15:19.031Z","dependency_job_id":null,"html_url":"https://github.com/endalk200/puppeteer-plugins","commit_stats":{"total_commits":18,"total_committers":2,"mean_commits":9.0,"dds":0.05555555555555558,"last_synced_commit":"1839c8598daa735ecce25e01d9c2003a56c4b9a2"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/endalk200%2Fpuppeteer-plugins","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/endalk200%2Fpuppeteer-plugins/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/endalk200%2Fpuppeteer-plugins/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/endalk200%2Fpuppeteer-plugins/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/endalk200","download_url":"https://codeload.github.com/endalk200/puppeteer-plugins/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252813856,"owners_count":21808391,"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":["helpers","helpers-library","puppeteer","puppeteer-helpers","puppeteer-plugins","puppeteer-utils","utils","utils-library"],"created_at":"2024-11-14T04:24:36.395Z","updated_at":"2025-05-07T04:31:18.247Z","avatar_url":"https://github.com/endalk200.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![MIT License](https://img.shields.io/apm/l/atomic-design-ui.svg?)](https://github.com/tterb/atomic-design-ui/blob/master/LICENSEs) [![react hooks test CI](https://github.com/endalk200/puppeteer-plugins/actions/workflows/test-ci.yml/badge.svg)](https://github.com/endalk200/puppeteer-plugins/actions/workflows/test-ci.yml) [![NPM](https://img.shields.io/npm/v/puppeteer-plugins)](https://www.npmjs.com/package/puppeteer-plugins) [![NPM](https://img.shields.io/npm/dm/puppeteer-plugins)](https://www.npmjs.com/package/puppeteer-plugins)\n\n# Puppeteer Plugins\n\npuppeteer plugins is a collection of helper functions and plugins for puppeteer. The package contains plugins that extend puppeteer functionality. It will make working with sites using puppeteer easier.\n\n## Installation\n\n```bash\nnpm install puppeteer-plugins\n\n# or\n\nyarn add puppeteer-plugins\n```\n\n## API\n\n### 1. `_type`\n\nThe `_type` helper function is wrapper for puppeteer `type` API. It has additional features and safeguards that puppeteer doesn't offer out of the box. It has validation feature built in. It will first try to find the element with the given selector within the given timeout. If it can not find it will throw `ElementNotFoundError`. If it finds the element it will type in the given data and validate the inputs value to make sure it has been typed in.\n\n```typescript\nimport { _type } from \"puppeteer-plugins\";\n\nawait _type({ page: page, selector: \"input[name='firstName']\", data: \"John\" });\n\nawait _type({\n    pageOrFrame: page,\n    selector: \"input[name='lastName']\",\n    data: \"Doe\",\n    expectedValue: \"Doe\",\n    delay: 500,\n});\n```\n\n### 2. `_select`\n\nThe `_select` helper function is wrapper for the puppeteer `select` API with additional features and safeguards. This helper functions sets the select value either using the select options `value` or `innerText`\n\n```typescript\nimport { _select } from \"puppeteer-plugins\";\n\nawait _select({\n    pageOrFrame: page,\n    selector: \"select[name=favoriteFramework]\",\n    value: \"REACT\",\n});\n\nawait _select({\n    pageOrFrame: page,\n    selector: \"select[name=favoriteFramework]\",\n    value: \"React\",\n    text: \"React\",\n});\n```\n\n### 3. `_setValue`\n\n`_setValue` is helper function that can handle `input`, `textarea` and `select` HTML elements. It will figure out what the HTML element is and perform the action accordingly\n\n```typescript\nimport { _setValue } from \"puppeteer-plugins\";\n\nawait _setValue({ pageOrFrame: page, selector: \"input[name='lastName']\", data: \"Doe\" });\n\nawait _setValue({\n    pageOrFrame: page,\n    selector: \"select[name=favoriteFramework]\",\n    data: \"REACT\",\n});\n```\n\n### 4. `_getFrame`\n\nWorking with `iframes` in puppeteer can be a little bit tricky. This helper function makes working with `iframes` very easy.\n\n```typescript\nimport { _getFrame } from \"puppeteer-plugins\";\n\nconst frame = await _getFrame({\n    selector: \"iframe[name='main-frame']\",\n    pageOrFrame: page,\n});\n\n// You can also get nested frames\nconst outerFrame = await _getFrame({\n    selector: \"iframe[name='outer-frame']\",\n    pageOrFrame: page,\n});\nconst innerFrame = await _getFrame({\n    selector: \"iframe[name='inner-frame']\",\n    pageOrFrame: outerFrame,\n});\n\n// Or you can do it at once like this\n\nconst nestedFrame = await _getFrame({\n    selector: \"iframe[name='inner-frame']\",\n    pageOrFrame: await _getFrame({\n        selector: \"iframe[name='outer-frame']\",\n        pageOrFrame: page,\n    }),\n});\n```\n\n## NOTE:\n\nThere more plugins and helper functions coming to this package. Stay tuned.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fendalk200%2Fpuppeteer-plugins","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fendalk200%2Fpuppeteer-plugins","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fendalk200%2Fpuppeteer-plugins/lists"}