{"id":20816485,"url":"https://github.com/qaa-demo/genai-playwright-demo","last_synced_at":"2026-04-25T11:32:38.197Z","repository":{"id":234026862,"uuid":"787827664","full_name":"qaa-demo/genai-playwright-demo","owner":"qaa-demo","description":"Generate Playwright Tests 🎭 using Azure OpenAI 🤖","archived":false,"fork":false,"pushed_at":"2024-05-13T18:39:07.000Z","size":243,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-13T13:07:33.419Z","etag":null,"topics":["azureopenai","genai","playwright","playwright-javascript"],"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/qaa-demo.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-04-17T09:00:13.000Z","updated_at":"2024-11-18T11:06:43.000Z","dependencies_parsed_at":"2024-05-13T19:59:09.852Z","dependency_job_id":null,"html_url":"https://github.com/qaa-demo/genai-playwright-demo","commit_stats":null,"previous_names":["qaa-demo/auto-playwright","qaa-demo/genai-playwright-demo"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/qaa-demo/genai-playwright-demo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qaa-demo%2Fgenai-playwright-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qaa-demo%2Fgenai-playwright-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qaa-demo%2Fgenai-playwright-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qaa-demo%2Fgenai-playwright-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/qaa-demo","download_url":"https://codeload.github.com/qaa-demo/genai-playwright-demo/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qaa-demo%2Fgenai-playwright-demo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32261100,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-25T09:15:33.318Z","status":"ssl_error","status_checked_at":"2026-04-25T09:15:31.997Z","response_time":59,"last_error":"SSL_read: 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":["azureopenai","genai","playwright","playwright-javascript"],"created_at":"2024-11-17T21:34:28.628Z","updated_at":"2026-04-25T11:32:38.182Z","avatar_url":"https://github.com/qaa-demo.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# **GenAI Playwright Demo 🤖**\n\nGenerate Playwright Tests 🎭 using Azure OpenAI\n\n## Description\n1. **Configure System Prompt**: Set up the system prompt to instruct the model to act as a Playwright Code Generator, providing the rules and expected output examples.\n\n2. **Configure User Prompt**: Define the user prompt to generate test steps.\n\n3. **Send Request**: Send the request to Azure OpenAI's GPT-4 model using the prompts to generate Playwright test code.\n\n4. **Parse Response**: Parse the response and save it as a Playwright test.\n\n5. **Trigger Test Execution**: Execute the test as a regular Playwright test.\n\n6. **View Results**: View the Playwright execution results using the `npx playwright show-report` command as usual.\n\n\n## Prerequisites\n- Node.js\n- Visual Studio Code\n- An Azure subscription\n- Azure OpenAI service in the Azure subscription\n- An Azure OpenAI Service resource with either the `gpt-35-turbo` or the `gpt-4` models deployed\n- More Details: [Azure OpenAI Prerequisites](https://learn.microsoft.com/en-us/azure/ai-services/openai/chatgpt-quickstart?tabs=command-line%2Cpython-new\u0026pivots=programming-language-javascript#prerequisites)\n\n\n## Description\n- Prompt OpenAI to generate Playwright Test code based on instructions and test steps\n- Parse OpenAI generated response and save it into Playwright Test file in `/tests/` folder\n- Run generated Playwright test from the program automatically with `npm test` command\n- View Execution Results, launch results with `npx playwright show-report` command\n\n## Resources:\n[Quickstart: Get started using GPT-35-Turbo and GPT-4 with Azure OpenAI Service](https://learn.microsoft.com/en-us/azure/ai-services/openai/chatgpt-quickstart?tabs=command-line%2Cpython-new\u0026pivots=programming-language-javascript)\n\n## To run:\n- Set local Environment variables (see **Quickstart** link above for more details)\n```\nAZURE_OPENAI_ENDPOINT\nAZURE_OPENAI_API_KEY\nAZURE_OPENAI_DEPLOYMENT_NAME\n```\n![image.png](/img/genai-playwright-demo01.png)\n\n- Clone this repo to your local machine\n- Open the repo project in VSCode, open new Terminal Window\n- Run `npm install` command to install dependancies\n- Run `npm i --save-dev @playwright/test` command to install latest version of Playwright\n- Run project with the command: `node PlaywrightTestGenAI.js`\n- View Console for execution log, wait for completion, it may take a few seconds (up to a minute)\n- Playwright test will launch automatically\n- Once completed, view Playwright test results by running the command: `npx playwright show-report`\n\nGood luck! 🚀 🤞\n\n## Notes:\n- During the execution new test file will be generated i.e. `genai-test-2404231521.spec.js`\n- Any previously generated files starting with **genai-test** will be backed up in `/tests-bkp` folder\n- Each run generates new test file and backs up the previous file to `/tests-bkp` folder\n\n## ZeroStep Demo\n- Register Account and Obtain ZeroStep API Key (token) at https://zerostep.com/\n- Set `$ export ZEROSTEP_TOKEN=\"\u003cyour token here\u003e\"` or save in System Environment Variables\n- Run ZeroStep based test via the command `npm test ZeroStep-test.spec.js`\n- Once completed, view Playwright test results by running the command: `npx playwright show-report`","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqaa-demo%2Fgenai-playwright-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fqaa-demo%2Fgenai-playwright-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqaa-demo%2Fgenai-playwright-demo/lists"}