genai playwright demo
1.0.0
Generate Playwright Tests ? using Azure OpenAI
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.
Configure User Prompt: Define the user prompt to generate test steps.
Send Request: Send the request to Azure OpenAI's GPT-4 model using the prompts to generate Playwright test code.
Parse Response: Parse the response and save it as a Playwright test.
Trigger Test Execution: Execute the test as a regular Playwright test.
View Results: View the Playwright execution results using the npx playwright show-report
command as usual.
gpt-35-turbo
or the gpt-4
models deployed/tests/
foldernpm test
commandnpx playwright show-report
commandQuickstart: Get started using GPT-35-Turbo and GPT-4 with Azure OpenAI Service
AZURE_OPENAI_ENDPOINT
AZURE_OPENAI_API_KEY
AZURE_OPENAI_DEPLOYMENT_NAME
npm install
command to install dependanciesnpm i --save-dev @playwright/test
command to install latest version of Playwrightnode PlaywrightTestGenAI.js
npx playwright show-report
Good luck! ?
genai-test-2404231521.spec.js
/tests-bkp
folder/tests-bkp
folder$ export ZEROSTEP_TOKEN="<your token here>"
or save in System Environment Variablesnpm test ZeroStep-test.spec.js
npx playwright show-report