{"id":19845391,"url":"https://github.com/qavajs/steps-playwright","last_synced_at":"2025-10-24T00:06:44.392Z","repository":{"id":60945347,"uuid":"546060029","full_name":"qavajs/steps-playwright","owner":"qavajs","description":"Collection of playwright steps for qavajs framework","archived":false,"fork":false,"pushed_at":"2024-11-01T11:06:49.000Z","size":1249,"stargazers_count":15,"open_issues_count":3,"forks_count":6,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-11-06T08:44:09.198Z","etag":null,"topics":["qa","test-automation","testing"],"latest_commit_sha":null,"homepage":null,"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/qavajs.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":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-10-05T13:03:39.000Z","updated_at":"2024-10-28T19:36:31.000Z","dependencies_parsed_at":"2023-02-14T17:00:54.201Z","dependency_job_id":"ec94c837-254f-41f1-8831-5c76419ba959","html_url":"https://github.com/qavajs/steps-playwright","commit_stats":{"total_commits":123,"total_committers":6,"mean_commits":20.5,"dds":"0.33333333333333337","last_synced_commit":"44778b5f47ade97324affda39f725056a1b79643"},"previous_names":[],"tags_count":65,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qavajs%2Fsteps-playwright","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qavajs%2Fsteps-playwright/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qavajs%2Fsteps-playwright/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qavajs%2Fsteps-playwright/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/qavajs","download_url":"https://codeload.github.com/qavajs/steps-playwright/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224278484,"owners_count":17285080,"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":["qa","test-automation","testing"],"created_at":"2024-11-12T13:07:33.823Z","updated_at":"2025-10-24T00:06:44.387Z","avatar_url":"https://github.com/qavajs.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![npm version](https://badge.fury.io/js/@qavajs%2Fsteps-playwright.svg)](https://badge.fury.io/js/@qavajs%2Fsteps-playwright)\n\n# @qavajs/steps-playwright\n**`@qavajs/steps-playwright`** provides a comprehensive set of pre-built step definitions for [qavajs](https://github.com/qavajs/qavajs), powered by [Playwright](https://playwright.dev). \nIt enables easy and efficient browser automation in a behavior-driven development (BDD) style using Cucumber syntax.\n\n## Features\n\n- Predefined steps for web automation using Playwright\n- Seamless integration with `@qavajs/core`\n- Support for dynamic locators and parameters\n- Built-in assertions and synchronization steps\n- Easily extendable for custom needs\n\n## Installation\n```bash\nnpm install @qavajs/steps-playwright\n```\n\n## Configuration\n```typescript\nimport App from './page_object'\nexport default {\n    require: [\n        'node_modules/@qavajs/steps-playwright/index.js'\n    ],\n    browser: {\n        timeout: {\n            present: 10000,\n            visible: 20000,\n            page: 10000,\n            value: 5000, // expect value timeout\n            valueInterval: 500, // expect value interval\n            pageRefreshInterval: 2000 // refresh page for _I refresh page..._ steps\n        },\n        capabilities: {\n            browserName: 'chromium',\n            headless: true\n        }\n    },\n    pageObject: new App()\n}\n```\n\n## Context variables\n@qavajs/steps-playwright exposes following to step context\n         \n| variable                  | type                             | description                          |\n|---------------------------|----------------------------------|--------------------------------------|\n| `this.playwright.browser` | `Browser \\| ElectronApplication` | browser instance                     |\n| `this.playwright.driver`  | `Browser \\| ElectronApplication` | browser instance (alias for browser) |\n| `this.playwright.context` | `BrowserContext`                 | current browser context              |\n| `this.playwright.page`    | `Page`                           | current context page                 |\n\n## Connect to playwright server\nIn order to connect to playwright server pass `wsEndpoint` property in capabilities object\n```typescript\nexport default {\n    browser: {\n        capabilities: {\n            browserName: 'chromium',\n            wsEndpoint: 'ws://127.0.0.1:60291/2bd48ce272de2b543e4c8c533f664b83'\n        }\n    },\n}\n\n```\n\n## Connect to cdp endpoint\nIn order to connect to CDP endpoint pass `cdpEndpoint` property in capabilities object \n```typescript\nexport default {\n    browser: {\n        capabilities: {\n            browserName: 'chromium',\n            cdpEndpoint: 'http://localhost:9222/'\n        }\n    },\n}\n```\n\n## Screenshot strategy\n@qavajs/steps-playwright has build-in capability to take screenshot on particular event. If you need to add \nscreenshot to your report add `screenshot.event` property to profile config.\nSupported events:\n- onFail\n- beforeStep\n- afterStep\n\n```typescript\nexport default {\n    browser: {\n        screenshot: {\n            event: ['onFail'], //event to take screenshot\n            fullPage: true // option to take full page screenshot (default false)\n        }\n    }\n}\n\n```\n\n## Playwright traces\n@qavajs support capturing playwright traces. \nhttps://playwright.dev/docs/next/trace-viewer-intro\n\nTrace Viewer - https://trace.playwright.dev/\n\n```typescript\nexport default {\n    //...\n    browser: {\n        trace: {\n            event: ['onFail'], // Events to save trace. Possible value onFail or afterScenario \n            dir: 'dirToStoreTraces', // Dir to store traces. Default - traces/\n            attach: true, // Whether trace need to be attached to cucumber report. Default - false\n            screenshots: true, // Whether to capture screenshots during tracing. Screenshots are used to build a timeline preview. Default - true\n            snapshots: true, // Whether to capture DOM and network activity\n        }\n    }\n}\n```\n\n## Video\n```typescript\nexport default {\n    //...\n    browser: {\n        video: {\n            event: ['onFail'], // Events to save video. Possible value onFail or afterScenario \n            dir: 'dirToStoreVideo', // Dir to store video. Default is video/\n            size: { width: 640, height: 480 }, // Video resolution\n            attach: true // Define if trace need to be attached to cucumber report. Default false\n        }\n    }\n}\n```\n\n## reuseSession\n`reuseSession` flag allows to share session between tests in frames of process. But setting of this flag\ntransfers session control to user.\n\n```typescript\nexport default {\n    browser: {\n        reuseSession: true\n    }\n}\n\n```\n\n## restartBrowser\n`restartBrowser` flag allows to restart browser between tests instead of default restarting context\n\n```typescript\nexport default {\n    browser: {\n        restartBrowser: true\n    }\n}\n\n```\n\n\n## Development and testing\nInstall dependencies\n```\nnpm install\n```\n\nInstall playwright browsers\n```\nnpm install:browsers`\n```\n\nBuild lib\n```\nnpm run build\n```\n\nExecute unit test (with vitest)\n```\nnpm run test`\n```\n\nExecute e2e browser tests\n```\nnpm run test:e2e`\n```\n\nExecute e2e electron tests\n```\nnpm run test:e2e:electron`\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqavajs%2Fsteps-playwright","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fqavajs%2Fsteps-playwright","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqavajs%2Fsteps-playwright/lists"}