{"id":20420203,"url":"https://github.com/ghoshasish99/playwright-cucumber","last_synced_at":"2025-04-12T18:08:38.449Z","repository":{"id":38828897,"uuid":"328498691","full_name":"ghoshasish99/Playwright-Cucumber","owner":"ghoshasish99","description":"This repository explains how to use Playwright with Cucumber","archived":false,"fork":false,"pushed_at":"2021-02-17T18:38:03.000Z","size":114,"stargazers_count":36,"open_issues_count":2,"forks_count":20,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-12T18:07:44.281Z","etag":null,"topics":["cucumberjs","javascript","moon","playwright","testautomation","testautomationframework"],"latest_commit_sha":null,"homepage":"https://github.com/ghoshasish99/Playwright-Cucumber","language":"HTML","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/ghoshasish99.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":"2021-01-10T23:12:13.000Z","updated_at":"2025-01-11T09:33:44.000Z","dependencies_parsed_at":"2022-09-10T02:10:58.937Z","dependency_job_id":null,"html_url":"https://github.com/ghoshasish99/Playwright-Cucumber","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghoshasish99%2FPlaywright-Cucumber","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghoshasish99%2FPlaywright-Cucumber/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghoshasish99%2FPlaywright-Cucumber/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghoshasish99%2FPlaywright-Cucumber/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ghoshasish99","download_url":"https://codeload.github.com/ghoshasish99/Playwright-Cucumber/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248610341,"owners_count":21132921,"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":["cucumberjs","javascript","moon","playwright","testautomation","testautomationframework"],"created_at":"2024-11-15T06:42:02.878Z","updated_at":"2025-04-12T18:08:38.427Z","avatar_url":"https://github.com/ghoshasish99.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n![Playwright Test Execution](https://github.com/ghoshasish99/Playwright-Cucumber/workflows/Playwright%20Test%20Execution/badge.svg)\n    \n# Playwright (execution on Moon) with CucumberJS\n    \nPlaywright end-to-end test automation with CucumberJS\n    \n## Getting Started\n\n* To install Playwright : `npm install playwright --save-dev`\n* To install Cucumber   : `npm install cucumber --save-dev`\n* To install Junit Reporter : `npm install cucumberjs-junitxml --save-dev`\n* To install Chai : `npm install chai --save-dev`\n \n## To execute the tests\n\nDefine the scripts in package.json as follows :\n```json\n\"scripts\": {\n    \"test\": \"cucumber-js --parallel 1 -f json:report/report.json \u0026\u0026 node report.js \u0026\u0026 cat report/report.json | npx cucumber-junit \u003e report/junitreport.xml\"\n  }\n```\nFinally execute the tests with `npm test`\n\n### Create a global browser for the test session\n```Javascript\nBeforeAll(async() =\u003e{\n        if (moonHost){\n                global.browser = await chromium.connect({\n                timeout: 0,\n                wsEndpoint: 'ws://'+moonHost+':4444/playwright/chromium'\n            });\n        }\n        else{\n            global.browser = await chromium.launch();\n        }\n});\n```\n### Create a fresh browser context for each test\n```Javascript\nBefore(async() =\u003e{\n    global.context = await global.browser.newContext();\n    global.page = await global.context.newPage();\n});\n```\n### A sample Feature file\n```gherkin\nScenario Outline: Login to the E-Shop Application with Wrong Password\n    Given User launched eshop login page\n    When User logged in eshop using the invalid emailid \"\u003cEmailID\u003e\" and the invalid password \"\u003cPassword\u003e\"\n    Then User should not get logged in\n\n    Examples:\n      | EmailID                    | Password  |\n      | testuser_negative@shop.com | Testing$1 |\n```\n### A sample stepdefinition\n```Javascript\nWhen('User logged in eshop using the invalid emailid {string} and the invalid password {string}',async(username,password) =\u003e{\n    await loginpage.login(username,password);\n});\n```\n### Example of how a Playwright code snippet looks\n```Javascript\nconst { firefox } = require('playwright');\n\n(async () =\u003e {\n  const browser = await firefox.launch();\n  const context = await browser.newContext();\n  const page = await context.newPage();\n  await page.goto('https://www.example.com/');\n  await page.screenshot({ path: 'page.png', fullPage: true });\n\n  await browser.close();\n})();\n```\nFor more on Playwright click [here](https://playwright.dev/)\n\nTo know about Moon, how to deploy and use Moon, read the article below :\nhttps://ghoshasish99.medium.com/deploy-moon-on-azure-and-google-cloud-607a9604bccc\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fghoshasish99%2Fplaywright-cucumber","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fghoshasish99%2Fplaywright-cucumber","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fghoshasish99%2Fplaywright-cucumber/lists"}