| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Playwright will download the browsers needed as well as create the following files.
npx playwright install
npx playwright test
npx playwright test --ui
npx playwright test --project=chromium
npx playwright test example
npx playwright test --debug
npx playwright codegen
We suggest that you begin by typing:
npx playwright test
Step1: Install Allure Report command-line tool
Step2: Install the Allure Playwright adapter.
Step3: Add below config in playwright.config.js file.
Step4: Run Playwright tests.
Step5: Generate Allure Report
There are 2 options, option1 is using yaml file & option2 is without using yaml file. let's see one by one
Step2: Click on Repos & Let's create new repository, Click on New reposiotry

Step4: Click on Clone button and get the URL. Go to your system then clone repository.
Step5: Add all the playwright framework folders inside cloned repository

Step7: Repository is ready now, let's create pipeline. Click on Pipelines->Create Pipeline
Step11: Copy below yaml content and paste it inside azure-pipelines.yml file.
trigger:
- main
pool:
vmImage: ubuntu-latest
steps:
- task: NodeTool@0
inputs:
versionSpec: '18'
displayName: 'Install Node.js'
- script: npm ci
displayName: 'npm ci'
- script: npx playwright install --with-deps
displayName: 'Install Playwright browsers'
- script: npx playwright test
displayName: 'Run Playwright tests'
env:
CI: 'true'
If you are running in self hosted agent replace pool commands
pool: name: AgentPoolName demands: - agent.name -equals AgentName
Step13: You will see job queued like this.
Step15: Now let's Upload playwright-report folder with Azure Pipelines & Report generation Firstly update azure-pipelines.yml file
trigger:
- main
pool:
vmImage: ubuntu-latest
steps:
- task: NodeTool@0
inputs:
versionSpec: '18'
displayName: 'Install Node.js'
- script: npm ci
displayName: 'npm ci'
- script: npx playwright install --with-deps
displayName: 'Install Playwright browsers'
- script: npx playwright test
displayName: 'Run Playwright tests'
env:
CI: 'true'
- task: PublishTestResults@2
displayName: 'Publish test results'
inputs:
searchFolder: 'test-results'
testResultsFormat: 'JUnit'
testResultsFiles: 'e2e-junit-results.xml'
mergeTestResults: true
failTaskOnFailedTests: true
testRunTitle: 'My End-To-End Tests'
condition: succeededOrFailed()
- task: PublishPipelineArtifact@1
inputs:
targetPath: playwright-report
artifact: playwright-report
publishLocation: 'pipeline'
condition: succeededOrFailed()

Option2 - Without using YAML File
Step1: Repeat step 1 to 6 above from Option1
Step5: Click on + icon, Search for Node and add Node.js tool installer

Step6: Select just now added task and add Node v16 becuase playwright supports for Node v14 and above
Step7: Click on + icon, Similary add Command line task,
Display name: Install Playwright & Dependencies
Script: npm install && npx playwright install

Click on Advanced-> Click on little icon(i) & select the Link. This will enable working directory for the task.

Step8: Add another task by clicking on + icon, search for npm & Add npm

Enter Display name, Select Command as custom & Enter Command and Arguments as run tests

Step9: Once everthing is completed now it is a time run script. Click on Save & queue.

Add commit message then click save & run.
| Back | FazBrowse Home | New Git URL |