{"id":13496132,"url":"https://github.com/Tallyb/cucumber-playwright","last_synced_at":"2025-03-28T17:35:04.197Z","repository":{"id":37015428,"uuid":"335607286","full_name":"Tallyb/cucumber-playwright","owner":"Tallyb","description":null,"archived":false,"fork":false,"pushed_at":"2025-03-21T10:08:35.000Z","size":6074,"stargazers_count":409,"open_issues_count":19,"forks_count":104,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-03-21T11:24:14.848Z","etag":null,"topics":[],"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/Tallyb.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":"2021-02-03T11:48:26.000Z","updated_at":"2025-03-19T04:40:38.000Z","dependencies_parsed_at":"2024-01-01T19:27:10.560Z","dependency_job_id":"a8db843c-f294-436f-a056-5f8c537718ba","html_url":"https://github.com/Tallyb/cucumber-playwright","commit_stats":null,"previous_names":[],"tags_count":5,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tallyb%2Fcucumber-playwright","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tallyb%2Fcucumber-playwright/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tallyb%2Fcucumber-playwright/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tallyb%2Fcucumber-playwright/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Tallyb","download_url":"https://codeload.github.com/Tallyb/cucumber-playwright/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246069894,"owners_count":20718807,"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":[],"created_at":"2024-07-31T19:01:42.776Z","updated_at":"2025-03-28T17:35:03.773Z","avatar_url":"https://github.com/Tallyb.png","language":"TypeScript","funding_links":[],"categories":["Integrations","TypeScript"],"sub_categories":[],"readme":"# cucumber-playwright\n\n![Test](https://github.com/Tallyb/cucumber-playwright/workflows/Test/badge.svg)\n\nA starter repo for writing E2E tests based on Cucumber(7) with Playwright using Typescript.\n\n## The Why\n[Read](https://tally-b.medium.com/e2e-testing-with-cucumber-and-playwright-9584d3ef3360) or [watch](https://www.youtube.com/watch?v=PUVFmhYJNJA\u0026list=PLwwCtx3xQxlVMZzS4oi2TafVRngQ1wF_0\u0026index=2). \n\n## Can we use XXX from playwright in the playwright-cucumber project? \n\nThe playwright-cucumber project started when playwright was a browser automation library. It did not have a test runner, hence cucumber-js was used as the test runner and PW used for the automation.\nSince then PW added their amazing PW test library which is a test runner. But, sadly, it overlaps the functionality provided by cucumber-js. Therefore you need to make the decision now of which runner you want to run: cucumber for BDD style tests or PW test for “normal” tests. \nSome of the features provided by PW test are also available in cucumber-js, such as parallel run and different configurations (profiles in cucumber-js terms), but may require a different configuration. \n\n## Kudos\n\nThis repository is based on the [Cucumber-typescript-starter](https://github.com/hdorgeval/cucumber7-ts-starter/) repo.\n\n## What's inside\n\n- Typescript setup for writing steps with eslint/typescript and prettier\n- Launching of Playwright browser before running all tests\n- Launching new context and page for each scenario\n- Running feature with video recording option\n- Report generated with last good image attached\n- Allure reports\n- Utilies function to help you with writing steps\n- VScode configuration to debug a single feature or an only scenario (run when located on the feature file)\n\n## Usage\n\nCreate a repo based on this template and start writing your tests.\n\n## To run your tests\n\n`npm run test` or `npx cucumber-js` runs all tests\n`npm run test \u003cfeature name\u003e` or `npx cucumber-js \u003cfeature name\u003e` run the single feature\n\n## Browser selection\n\nBy default we will use chromium. You can define an envrionment variable called BROWSER and\nset the name of the browser. Available options: chromium, firefox, webkit\n\nOn Linux and Mac you can write:\n\n`BROWSER=firefox npm run test` or `BROWSER=firefox npx cucumber-js` runs all tests using Firefox\n\nOne Windows you need to write\n\n```\nset BROWSER=firefox\nnpm run test\n```\n\n## Working with Page Objects\n\nI am not fond of the Page Object Model (POM) for testing. It feels like a leftover from Java world, and I do not think it fits the Javascript world. However, you can check [this PR](https://github.com/Tallyb/cucumber-playwright/pull/95/files) to see POM implementation. \n\n## Debugging Features\n\n### From CLI\n\n- `npm run debug` - headful mode with APIs enables both APIs and debug options\n- `npm run api` - headless mode with debug apis\n- `npm run video` - headless mode vith video\n\n## In Visual Studio Code\n\n- Open the feature\n- Select the debug options in the VSCode debugger\n- Set breakpoints in the code\n\nTo stop the feature, you can add the `Then debug` step inside your feature. It will stop your debugger.\n\n## To choose a reporter\n\nThe last reporter/formatter found on the cucumber-js command-line wins:\n\n```text\n--format summary --format @cucumber/pretty-formatter --format cucumber-console-formatter\n```\n\nIn [cucumber.mjs](cucumber.mjs) file, modify the options.\n\n\nTo use Allure reporting, you can run with env param: `USE_ALLURE=1`, and then use the `npm run allure` to show the report.\n\n## To ignore a scenario\n\n- tag the scenario with `@ignore`\n\n## To check for typescript, linting and gherkin errors\n\n- run the command `npm run build`.\n\n## To view the steps usage\n\n- run the command `npm run steps-usage`.\n\n## To view the html report of the last run\n\n- run the command `npm run report`.\n\n### At least in Lubuntu 20.04 to open the html report\n\n- Modify the `package.json` in `\"report\": \"xdg-open reports/report.html\"`\n\n## To view allure report\n- run the command `npm run allure`.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FTallyb%2Fcucumber-playwright","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FTallyb%2Fcucumber-playwright","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FTallyb%2Fcucumber-playwright/lists"}