{"id":49511705,"url":"https://github.com/andrxo/protractor-puppeteer-plugin","last_synced_at":"2026-05-01T20:01:15.982Z","repository":{"id":57331862,"uuid":"208494477","full_name":"andrxo/protractor-puppeteer-plugin","owner":"andrxo","description":"The main goal of this plugin is to enable the use of two tools in autotests written on Protractor. Also, this plugin can measure page performance using Lighthouse.","archived":false,"fork":false,"pushed_at":"2022-07-18T10:25:49.000Z","size":101,"stargazers_count":7,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-04-13T18:40:07.821Z","etag":null,"topics":["autotests","chrome","lighthouse","protractor","protractor-puppeteer-plugin","puppeteer"],"latest_commit_sha":null,"homepage":"","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/andrxo.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2019-09-14T19:42:48.000Z","updated_at":"2022-01-15T16:41:50.000Z","dependencies_parsed_at":"2022-09-21T03:23:32.872Z","dependency_job_id":null,"html_url":"https://github.com/andrxo/protractor-puppeteer-plugin","commit_stats":null,"previous_names":["andrxo/protractor-puppeteer-plugin"],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/andrxo/protractor-puppeteer-plugin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrxo%2Fprotractor-puppeteer-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrxo%2Fprotractor-puppeteer-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrxo%2Fprotractor-puppeteer-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrxo%2Fprotractor-puppeteer-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andrxo","download_url":"https://codeload.github.com/andrxo/protractor-puppeteer-plugin/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrxo%2Fprotractor-puppeteer-plugin/sbom","scorecard":{"id":13093,"data":{"date":"2025-08-11","repo":{"name":"github.com/And93/protractor-puppeteer-plugin","commit":"79e45f6d3de031e1248a846e2e7812bdea0c92f6"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-14T15:03:23.454Z","repository_id":57331862,"created_at":"2025-08-14T15:03:23.454Z","updated_at":"2025-08-14T15:03:23.454Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32510815,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"online","status_checked_at":"2026-05-01T02:00:05.856Z","response_time":64,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["autotests","chrome","lighthouse","protractor","protractor-puppeteer-plugin","puppeteer"],"created_at":"2026-05-01T20:01:14.282Z","updated_at":"2026-05-01T20:01:15.943Z","avatar_url":"https://github.com/andrxo.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Protractor-puppeteer plugin\n\nThe main goal of this plugin is to enable the use of two tools in autotests written on Protractor. Also, this plugin can\nmeasure page performance using Lighthouse.\n\n**Chrome only supported.**\n\n## Requirements:\n\n| Protractor-puppeteer plugin | Protractor | Puppeteer | Lighthouse | NodeJS      |\n|-----------------------------|------------|-----------|------------|-------------|\n| ^1.0.0                      | ^5.0.0     | ^2.1.0    | -          | ^10         |\n| ^2.0.0                      | ^5.0.0     | ^3.0.0    | -          | ^10         |\n| ^3.0.0                      | ^5.0.0     | ^4.0.0    | -          | ^10         |\n| ^4.0.0                      | ^5.0.0     | ^5.0.0    | -          | ^10         |\n| ^5.0.0                      | ^5.0.0     | ^5.2.0    | ^6.3.0     | ^10         |\n| ^5.2.0                      | ^5.0.0     | ^5.5.0    | ^7.0.0     | ^12         |\n| ^6.0.0                      | ^5.0.0     | ^8.0.0    | ^7.2.0     | ^12.13.0    |\n| ^7.0.0                      | ^5.0.0     | ^10.2.0   | ^8.3.0     | ^12.13.0    |\n| ^8.0.0 (`Current`)          | ^5.0.0     | ^13.0.1   | ^9.2.0     | ^14.0.0     |\n\n## How to add this plugin to protractor:\n\n```\n// protractor.conf.js\n\nplugins: [{\n    package: 'protractor-puppeteer-plugin',\n    (or path: require.resolve('protractor-puppeteer-plugin'))\n    configFile?: './path/to/puppeteer.conf.json',\n    configOptions?: {\n        connectToBrowser?: boolean, (Default: false) // This prop allows to connect Puppeteer to Protractor\n        connectOptions?: {\n            defaultViewport?: {\n                width?: number, (Default: 800px)\n                height?: number, (Default: 600px)\n                deviceScaleFactor?: number, (Default: 1)\n                isMobile?: boolean, (Default: false)\n                hasTouch?: boolean, (Default: false)\n                isLandscape?: boolean (Default: false)\n            },\n            ignoreHTTPSErrors?: boolean, (Default: false)\n            slowMo?: number, (Default: 0ms)\n        },\n        timeout?: number, (Default: 30000ms)\n        defaultArgs?: {\n            headless?: boolean,\n            args?: Array\u003cstring\u003e,\n            userDataDir?: string,\n            devtools?: boolean,\n        },\n        harDir?: './path/to/artifatcs/dir/', (Default: './artifacts/har/')\n        selenoid?: {\n            host: string, (E.g.: 'selenoid.example.com' or 'localhost')\n            port?: number, (Default: 4444)\n        },\n        lighthouse?: {\n            enabled?: boolean, (Default: false) // This prop allows to connect Lighthouse to Protractor\n            flags?: {[key: string]: any}, See types: https://github.com/GoogleChrome/lighthouse/blob/master/types/externs.d.ts#L151\n                                            Default: {port: (!) Determined automatically, logLevel: 'info', output: ['json', 'html']}\n                                            (!) It is not recommended to change the port.\n            config?: {[key: string]: any}, See documentation: https://github.com/GoogleChrome/lighthouse/blob/master/docs/configuration.md\n                                            and types: https://github.com/GoogleChrome/lighthouse/blob/master/types/config.d.ts#L16\n                                            Default: https://github.com/GoogleChrome/lighthouse/blob/master/lighthouse-core/config/lr-desktop-config.js#L11\n            reportsDir?: string (Default: './artifacts/lighthouse/')\n        },\n        logLevel?: 'verbose' | 'info' | 'warn' | 'error' | 'silent', (Default: 'info') // Changes the plugin logs\n    },\n}]\n```\n\n**(!) Note:** The `configFile` property takes precedence over the `configOptions` property.\n\n### What should 'configFile' contain?\n\nThe `configFile` must be `.json` extension and contains the following properties.\n\nE.g.:\n\n```\n// puppeteer.conf.json\n{\n    \"connectToBrowser\"?: boolean, (Default: false) // This prop allows to connect Puppeteer to Protractor\n    \"connectOptions\"?: {\n       \"defaultViewport\"?: {\n           \"width\"?: number, (Default: 800px)\n           \"height\"?: number, (Default: 600px)\n           \"deviceScaleFactor\"?: number, (Default: 1)\n           \"isMobile\"?: boolean, (Default: false)\n           \"hasTouch\"?: boolean, (Default: false)\n           \"isLandscape\"?: boolean (Default: false)\n       },\n       \"ignoreHTTPSErrors\"?: boolean, (Default: false)\n       \"slowMo\"?: number (Default: 0ms)\n    },\n    \"timeout\"?: number, (Default: 30000ms)\n    \"defaultArgs\"?: {\n        \"headless\"?: boolean,\n        \"args\"?: Array\u003cstring\u003e,\n        \"userDataDir\"?: string,\n        \"devtools\"?: boolean\n    },\n    \"harDir\"?: \"./path/to/artifatcs/dir/\", (Default: \"./artifacts/har/\")\n    \"selenoid\"?: {\n        \"host\": string, (E.g.: \"selenoid.example.com\" or \"localhost\")\n        \"port\"?: number (Default: 4444)\n    },\n    \"lighthouse\"?: {\n        \"enabled\"?: boolean, (Default: false) // This prop allows to connect Lighthouse to Protractor\n        \"flags\"?: {[key: string]: any}, See types: https://github.com/GoogleChrome/lighthouse/blob/master/types/externs.d.ts#L151\n                                        Default: {\"port\": (!) Determined automatically, \"logLevel\": \"info\", \"output\": [\"json\", \"html\"]}\n                                        (!) It is not recommended to change the port.\n        \"config\"?: {[key: string]: any}, See documentation: https://github.com/GoogleChrome/lighthouse/blob/master/docs/configuration.md\n                                        and types: https://github.com/GoogleChrome/lighthouse/blob/master/types/config.d.ts#L16\n                                        Default: https://github.com/GoogleChrome/lighthouse/blob/master/lighthouse-core/config/lr-desktop-config.js#L11\n        \"reportsDir\"?: string (Default: \"./artifacts/lighthouse/\")\n    },\n    \"logLevel\"?: \"verbose\" | \"info\" | \"warn\" | \"error\" | \"silent\" (Default: \"info\") // Changes the plugin logs\n}\n```\n\n### Documentation\n\n* [`connectOptions`](https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#puppeteerconnectoptions)\n* [`timeout`](https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#pagesetdefaulttimeouttimeout)\n* [`defaultArgs`](https://github.com/puppeteer/puppeteer/blob/master/docs/api.md#puppeteerdefaultargsoptions)\n* [`flags (types)`](https://github.com/GoogleChrome/lighthouse/blob/master/types/externs.d.ts#L151)\n* [`config (types)`](https://github.com/GoogleChrome/lighthouse/blob/master/types/config.d.ts#L16)\n* [`config (documentation)`](https://github.com/GoogleChrome/lighthouse/blob/master/docs/configuration.md)\n\n## How to use:\n\n1. If you would like to connect to browser by yourself, or you would like to use some functions which return\n   from `class: Puppeteer`, you should use `puppeteer` property:\n\n    ```javascript\n    const {browser} = require('protractor');\n    \n    await browser.puppeteer.launch([options]);\n    await browser.puppeteer.connect(options);\n    await browser.puppeteer.createBrowserFetcher([options]);\n    browser.puppeteer.defaultArgs([options]);\n    \n    const iDevices = browser.puppeteer.devices['iDevices'];\n    \n    // etc.\n    ``` \n\n   More information about this class you can find here:\n    * [`class: Puppeteer`](https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#class-puppeteer)\n\n2. If Puppeteer was connected by `protractor-puppeteer-plugin`, you should use `cdp` property. The `cdp` property\n   provides to use all features of Puppeteer after merging with Protractor.\n\n    ```javascript\n    const {browser} = require('protractor');\n    \n    browser.puppeteer. // --\u003e Puppeteer\n    \n    // ...\n    \n    browser.cdp.target. // --\u003e Target\n    browser.cdp.client. // --\u003e CDPSession\n    browser.cdp.page. // --\u003e Page\n    browser.cdp.browser. // --\u003e Browser\n    ```\n\n   More information about this class you can find here:\n    * [`class: Puppeteer`](https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#class-puppeteer)\n    * [`class: Target`](https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#class-target)\n    * [`class: CDPSession`](https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#class-cdpsession)\n    * [`class: Page`](https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#class-page)\n    * [`class: Browser`](https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#class-browser)\n\n3. For saving `har` files (with all calls from network) use:\n\n    ```javascript\n    const {browser} = require('protractor');\n     \n    await browser.har.start();\n    // test actions\n    await browser.har.stop(reportName);\n    // HAR file will stored automatically. Default: './artifacts/har/' directory.\n    // If the 'reportName' parameter is passed, the report name will be: '%timestamp%_PID_%pid%_%reportName%.har'\n    // If not, will be the default: '%timestamp%_PID_%pid%_chrome_browser_har_log.har'\n    ```\n\n   Saved files can be read by Chrome.\n\n4. If `browser.restart()` was executed, you need to connect Puppeteer one more time:\n\n   ```javascript\n   const {browser} = require('protractor');\n   const {setup} = require('protractor-puppeteer-plugin');\n   \n   await browser.restart();\n   await setup();\n   ```\n\n5. Lighthouse. If you need to measure page performance, run the function:\n\n    ```javascript\n    const {browser} = require('protractor');\n   \n    await browser.lighthouse(url, {flags?, config?, connection?, reportName?});\n    // The report(s) will stored automatically. Default: './artifacts/lighthouse/' directory; '.html' and '.json' formats.\n    ```\n\n   where:\n    * `url` - The URL to test.\n    * `flags`- Optional settings for the Lighthouse run. If present, they will override any settings in the config;\n      \u003e Default flags: `{\"port\": (!) Determined automatically, \"logLevel\": \"info\", \"output\": [\"json\", \"html\"]}`.\n      **(!) It is not recommended to change the port**.\n      [Types](https://github.com/GoogleChrome/lighthouse/blob/master/types/externs.d.ts#L151).\n    * `config` - Configuration for the Lighthouse run. If not present, the default config is used;\n      \u003e [Default config](https://github.com/GoogleChrome/lighthouse/blob/master/lighthouse-core/config/lr-desktop-config.js#L11),\n      [Documentation](https://github.com/GoogleChrome/lighthouse/blob/master/docs/configuration.md) and\n      [Types](https://github.com/GoogleChrome/lighthouse/blob/master/types/config.d.ts#L16).\n    * `connection` - Custom connection if it's not ChromeProtocol. If not present, the `host` and `port` are used;\n      \u003e [Source code](https://github.com/GoogleChrome/lighthouse/blob/master/lighthouse-core/gather/connections/cri.js)\n    * `reportName` - If the 'reportName' parameter is passed, the report name will be: '%timestamp%\\_PID\\_%pid%_\n      %reportName%.%format%'. If not, will be the default: '%timestamp%\\_PID\\_%pid%_lighthouse_report.%format%'\n\n   During the execution Lighthouse opens a new tab, performs necessary actions, closes the tab and generates a report.\n   More information about this class you can find here:\n    * [`Lighthouse`](https://github.com/GoogleChrome/lighthouse)\n\n### Example:\n\n#### Javascript\n\n```javascript    \n// protractor.conf.js\nplugins: [{\n    package: 'protractor-puppeteer-plugin',\n    configFile: './path/to/puppeteer.conf.json',\n}]\n\n// puppeteer.conf.json\n{\n    \"connectToBrowser\": true,\n    \"connectOptions\": {\n        \"defaultViewport\": {\n            \"width\": 1366,\n            \"height\": 768\n        }\n    },\n    \"timeout\": 60000,\n    \"lighthouse\": {\n        \"enabled\": true\n    }\n}   \n\n// awesome.test.js\nconst {browser} = require('protractor');\n\ndescribe('Example suite', () =\u003e {\n    it('Protractor and Puppeteer together', async () =\u003e {\n        await browser.get('https://angular.io/');\n\n        await browser.cdp.page.waitForSelector('.button.hero-cta', {visible: true, hidden: false});\n        await browser.$('.button.hero-cta').click();\n\n        await browser.cdp.page.goto('https://cli.angular.io/', {waitUntil: ['networkidle0', 'domcontentloaded']});\n        await browser.cdp.page.waitForResponse('https://cli.angular.io/favicon.ico');\n\n        const getStartedBrn = browser.$('href=\"https://angular.io/cli\"');\n\n        await browser.wait(browser.ExpectedConditions.visibilityOf(getStartedBrn));\n\n        await browser.har.start();\n        await getStartedBrn.click();\n        await browser.har.stop('Protractor and Puppeteer together');\n        // Report name: '%timestamp%_PID_%pid%_Protractor_and_Puppeteer_together.har'\n\n        expect(browser.$('aio-doc-viewer').isDisplayed()).to.eventually.equal(\n            true,\n            'The \"Get started\" page was not opened'\n        );\n    });\n\n    it('Mocking a response using Puppeteer', async () =\u003e {\n        await browser.cdp.page.setRequestInterception(true);\n\n        browser.cdp.page.on('request', async request =\u003e {\n            if (request.url().includes('photos')) {\n                await request.respond({\n                    body: '[{title: \"Hello World!!!\"}]'\n                })\n            } else {\n                await request.continue();\n            }\n        });\n\n        await browser.cdp.page.goto('http://jsonplaceholder.typicode.com/photos');\n        // or\n        // await browser.waitForAngularEnabled(false);\n        // await browser.get('http://jsonplaceholder.typicode.com/photos');\n    });\n\n    it('Lighthouse example', async () =\u003e {\n        await browser.lighthouse('https://angular.io/', {reportName: 'Lighthouse example'});\n        // Report names:\n        //  - '%timestamp%_PID_%pid%_Lighthouse_example.html'\n        //  - '%timestamp%_PID_%pid%_Lighthouse_example.json'\n    });\n});\n```\n\n#### Typescript\n\n```typescript\n// ============== TypeScript ==============\n// protractor.conf.ts\nimport {Config} from 'protractor';\nimport 'protractor-puppeteer-plugin'; // to have autocomplete OR add 'protractor-puppeteer-plugin' value to types in tsconfig.json https://www.typescriptlang.org/tsconfig#types\n\nexport const config: Config = {\n    // ...\n    plugins: [{\n        configFile: {}, // ---\u003e autocomplete is available\n        configOptions: {} // ---\u003e autocomplete is available\n    }],\n}\n\n// awesome.test.ts\nimport {browser} from 'protractor';\nimport 'protractor-puppeteer-plugin'; // to have autocomplete OR add 'protractor-puppeteer-plugin' value to types in tsconfig.json https://www.typescriptlang.org/tsconfig#types\n\ndescribe('Example suite', () =\u003e {\n    it('Simple test', async () =\u003e { \n        browser.puppeteer. // ---\u003e autocomplete is available\n        browser.har. // ---\u003e autocomplete is available\n        browser.cdp. // ---\u003e autocomplete is available\n        await browser.lighthouse(params); // ---\u003e autocomplete is available for params\n    });\n});\n```\n\n## How to use in Docker\n\n1. If you would like to use autotests within the same container with `selenium-standalone/chrome`, you don't need to do\n   anything.\n\n2. If you would like to use autotest and `selenium-standalone/chrome` in different containers, you have to manage a port\n   for Chrome debug protocol. Since you won’t be able to know on which port the Chrome debugger is available, and based\n   on Chrome’s policy is prohibited connect to Chrome from the outside.\n\nTo do this, you need to pass the following arguments:\n\n* `--headless`\n* `--remote-debugging-address=0.0.0.0`\n* `--remote-debugging-port=9222` - with port address you want\n\n**(!)** But for parallel mode, you have to manage the ports by yourself.\n\n```javascript\n// protractor.conf.js\ncapabilities: {\n    browserName: 'chrome',\n    'goog:chromeOptions': {\n        args: [\n            '--headless',\n            '--remote-debugging-address=0.0.0.0',\n            '--remote-debugging-port=9222'\n        ]\n    }\n}\n```\n\nMore arguments you can find here:\n\n* [List of Chromium Command Line Switches](https://peter.sh/experiments/chromium-command-line-switches/)\n\n## Workarounds\n\n1. Error: '**Error: You probably have multiple tabs open to the same origin.**'\n   during `await browser.lighthouse('https://my-site/')`:\n\n**(!)** This workaround will be applied automatically, if the option `connectToBrowser: true` is set in\nthe `protractor-puppeteer-plugin` config. More details about the\nissue: https://github.com/GoogleChrome/lighthouse/issues/3024\n\n```typescript\nimport {browser} from 'protractor';\nimport {describe, it} from 'mocha';\nimport 'protractor-puppeteer-plugin'\n\ndescribe('Lighthouse workaround', () =\u003e {\n\n    it('Failed test', async () =\u003e {\n        // await browser.cdp.page.goto('https://angular.io/');\n        // or\n        await browser.get('https://angular.io/');\n        await browser.$('.button.hero-cta').click();\n        await browser.lighthouse('https://angular.io/'); // Error: You probably have multiple tabs open to the same origin.\n    });\n\n    it('Successful test', async () =\u003e {\n        // await browser.cdp.page.goto('https://angular.io/');\n        // or\n        await browser.get('https://angular.io/');\n        await browser.$('.button.hero-cta').click();\n\n        // workaround\n\n        async function lighthouse(url) {\n            const currentUrl = browser.cdp.page.url();\n\n            await browser.cdp.browser.newPage();\n            const [firstPage, secondPage] = await browser.cdp.browser.pages();\n            await firstPage.close();\n\n            await browser.lighthouse(url);\n\n            const [tab] = await browser.getAllWindowHandles();\n            await browser.switchTo().window(tab);\n            Object.assign(browser.cdp.page, secondPage);\n\n            await browser.get(currentUrl); // Now it works\n            // or\n            // await browser.cdp.page.goto(currentUrl); // Now it works\n        }\n\n        await lighthouse('https://angular.io/');\n    });\n});\n```\n\n## Documentation:\n\nProtractor:\n\n* https://www.protractortest.org\n* https://github.com/angular/protractor\n\nPuppeteer:\n\n* https://pptr.dev/\n* https://github.com/puppeteer/puppeteer\n* https://try-puppeteer.appspot.com/\n* https://developers.google.com/web/tools/puppeteer\n* Examples:\n    * https://developers.google.com/web/tools/puppeteer/examples\n\nChrome DevTools Protocol:\n\n* https://chromedevtools.github.io/devtools-protocol/\n\nLighthouse:\n\n* https://github.com/GoogleChrome/lighthouse\n* https://developers.google.com/web/tools/lighthouse\n* https://github.com/GoogleChrome/lighthouse/blob/master/docs/readme.md#using-programmatically\n* Using Puppeteer with Lighthouse:\n    * https://github.com/GoogleChrome/lighthouse/blob/master/docs/puppeteer.md\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrxo%2Fprotractor-puppeteer-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandrxo%2Fprotractor-puppeteer-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrxo%2Fprotractor-puppeteer-plugin/lists"}