{"id":20420204,"url":"https://github.com/ghoshasish99/playwright-k6","last_synced_at":"2026-05-07T21:41:05.446Z","repository":{"id":243049349,"uuid":"811040562","full_name":"ghoshasish99/playwright-k6","owner":"ghoshasish99","description":null,"archived":false,"fork":false,"pushed_at":"2024-06-17T14:59:37.000Z","size":14,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-12-05T21:25:44.138Z","etag":null,"topics":["functional-testing","k6","performance-testing","playwright"],"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/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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-05T20:33:39.000Z","updated_at":"2024-06-26T11:45:21.000Z","dependencies_parsed_at":null,"dependency_job_id":"cf780fe3-4b94-4f23-a7b2-f04b80c88c4d","html_url":"https://github.com/ghoshasish99/playwright-k6","commit_stats":null,"previous_names":["ghoshasish99/ntd-workshop"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ghoshasish99/playwright-k6","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghoshasish99%2Fplaywright-k6","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghoshasish99%2Fplaywright-k6/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghoshasish99%2Fplaywright-k6/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghoshasish99%2Fplaywright-k6/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ghoshasish99","download_url":"https://codeload.github.com/ghoshasish99/playwright-k6/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghoshasish99%2Fplaywright-k6/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32757771,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-07T02:14:30.463Z","status":"ssl_error","status_checked_at":"2026-05-07T02:14:29.405Z","response_time":62,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["functional-testing","k6","performance-testing","playwright"],"created_at":"2024-11-15T06:42:02.885Z","updated_at":"2026-05-07T21:41:05.409Z","avatar_url":"https://github.com/ghoshasish99.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Nordic Testing Days Workshop\n\n[![Functional-Performance Tests](https://github.com/ghoshasish99/ntd-workshop/actions/workflows/functional.yaml/badge.svg)](https://github.com/ghoshasish99/ntd-workshop/actions/workflows/functional.yaml)\n\n## Playwright Commands\n\n⚓ Installation : `npm init playwright@latest`\n\n\u003cbr\u003e\n\n🚀 Run Tests : `npx playwright test` \n\n\u003cbr\u003e\n\n🧐 Run Tests headed : `npx playwright test --headed`\n\nor configure your `playwright.config.js` to have the following :\n\n```javascript\n\nprojects: [\n    {\n      name: 'chromium',\n      use: { ...devices['Desktop Chrome'], headless:false },\n    }\n]\n```\n\u003cbr\u003e\n\n📊 Show Report : `npx playwright show-report`   --\u003e  this will open up the reports automatically on failure \n\n\u003cbr\u003e\n\n⛓️ Parallel/Sequential execution : `npx playwright test --workers=1` --\u003e change the value of `workers` as per the number of parrallel threads you want\n\n\u003cbr\u003e\n\n🟨 You can mark tests as `test.only` to be able to run only those tests using `npx playwright test`\n\n```javascript\n\ntest('has title', async ({ page }) =\u003e {\n  await page.goto('https://playwright.dev/');\n  await expect(page).toHaveTitle(/Playwright1/);\n});\n\ntest.only('get started link', async ({ page }) =\u003e {\n  await page.goto('https://playwright.dev/');\n  await page.getByRole('link', { name: 'Get started' }).click();\n  await expect(page.getByRole('heading', { name: 'Installation' })).toBeVisible();\n});\n\n```\n\n\u003cbr\u003e\n\n🏷️ Tagging :\n\nYou can tag tests by adding your relevant `tags` in the title.\n\n```javascript\n\ntest('has title', async ({ page }) =\u003e {\n  await page.goto('https://playwright.dev/');\n  await expect(page).toHaveTitle(/Playwright1/);\n});\n\ntest.only('get started link @smoke', async ({ page }) =\u003e {\n  await page.goto('https://playwright.dev/');\n  await page.getByRole('link', { name: 'Get started' }).click();\n  await expect(page.getByRole('heading', { name: 'Installation' })).toBeVisible();\n});\n\n```\n\nTo be able to run only the tagged tests, you can use `npx playwright test --grep @smoke`\n\n\u003cbr\u003e\n\n1️⃣ Running in a single browser : `npx playwright test --project=chromium`\n\n\u003cbr\u003e\n\n🔍 To collect evidences in the form of `traces` , `screenshots` or `videos`, you can configure the `playwright.config.js` like so :\n\n```javascript\n\nuse: {\n    trace: 'retain-on-failure',\n    screenshot: 'only-on-failure',\n    video: 'on',\n  }\n\n```\n\n\u003cbr\u003e\n\n🖥️ Run in UI mode : `npx playwright test --ui`\n\n\u003cbr\u003e\n\n⏺️ To open Playwright Recorder : `npx playwright codegen`\n\n### To read more about Playwright, check [this.](https://playwright.dev/)\n\n---------------------------------------------\n\n## k6 Commands\n\n⚓ Installation :\n \n * For Mac - `brew install k6`\n * For Windows - `winget install k6`              \n\n\u003cbr\u003e\n\n✨ Create a new Test File : `k6 new mytest.js` \n\n\u003cbr\u003e\n\n🚀 Run tests : `k6 run mytest.js` \n\n\u003cbr\u003e\n\n💪 Parameterized run : `k6 run --vus 10 --duration 30s mytest.js`\n\n\u003cbr\u003e\n\n📶 Ramp up/down set up :\n\n```javascript\nexport const options = {\n  stages: [\n    { duration: '30s', target: 20 },\n    { duration: '1m30s', target: 10 },\n    { duration: '20s', target: 0 },\n  ],\n};\n```\n\n✅ How to use `Check`s :\n\n```javascript\n\nconst res = http.get('https://httpbin.test.k6.io/');\ncheck(res, { 'status was 200': (r) =\u003e r.status == 200 });\n\n```\n\n🔳 How to use `Group`s :\n\n```javascript\n\n group('Create User', function(){\n    let data = {\n      \"name\": \"Ashish\",\n      \"job\": \"Testing\",\n    }\n    const newUser = http.post('https://reqres.in/api/users',JSON.stringify(data));\n    check(newUser,{'Create Successful':(r)=\u003er.status==201})\n    console.log(\"Created User ID \"+newUser.json().id)\n    sleep(3)\n  });\n\n```\n\n📊 How to use HTML Report :\n\n```javascript\nimport { htmlReport } from \"https://raw.githubusercontent.com/benc-uk/k6-reporter/2.4.0/dist/bundle.js\";\n\n\nexport function handleSummary(data) {\n  return {\n      'TestSummaryReport.html': htmlReport(data, { debug: true })\n  };\n}\n\n```\n\n🌐 How to perform Browser Tests :\n\n```javascript\nimport { browser } from 'k6/experimental/browser';\n\nexecutor: 'constant-vus',\n\nconst page = browser.newPage();\n```\n\nTo run these tests : `K6_BROWSER_HEADLESS=false k6 run browser.js`\n\n### To read more about k6, check [this.](https://k6.io/)\n\n--------------------------\n\n## About the author\n\n🖇️ Check out my profile : https://ashishghosh.carrd.co/\n\n🤝 Connect with me on : [![Linkedin](https://i.sstatic.net/gVE0j.png) LinkedIn](https://www.linkedin.com/in/ashish-ghosh/)\n\n🛠️ View my work on [![GitHub](https://i.sstatic.net/tskMh.png) GitHub](https://github.com/ghoshasish99)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fghoshasish99%2Fplaywright-k6","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fghoshasish99%2Fplaywright-k6","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fghoshasish99%2Fplaywright-k6/lists"}