I've created a simple pipeline in Azure Devops to run Playwright tests and explicitly coded one of the 2 tests to fail. When this happens during the pipeline execution, the pipeline seems to hang and I'm guessing will eventually timeout (after 30min, I cancelled). However when I execute tests that succeed, the pipeline exits successfully. Below is my yaml pipeline. Does anyone know why this might happen - have I missed something here?
[Edit]: I added the line below to my playwright.config.ts file and the task now fails like I expect. The default Playwright config opens the html report on any failures. There are a bunch of reporters you can use with Playwright, so take a look at what suits you (https://playwright.dev/docs/test-reporters).
reporter: [ ['html', { open: 'never' }] ],
trigger:
- master
- test
- dev
pool:
vmImage: macos-latest
jobs:
- job: Build
displayName: Build stage
steps:
- task: NodeTool@0
inputs:
versionSpec: '16.x'
displayName: 'Install Node.js'
- script: |
npm ci
displayName: 'Install dependencies'
- script: |
npx playwright install --with-deps
displayName: 'Install Playwright'
- script: |
npm run test-unit-smoke
displayName: 'Run unit tests'
