DEPRECATED: This Azure DevOps extension is no longer maintained. An alternative solution is to use the Publish Test Result task
which now supports file attachments.
Get more insight on your UI test failure with screenshots.
You can get the task from the Visual Studio MarketPlace.
- Capture your screenshot on test failure using the following path
automatedTestStorage/automatedTestName
(see json response example)- Currently only support
.png
images
- Currently only support
- The task must be placed after the PublishTestResult task in your pipeline
- If you enabled Fail build on test failure on PublishTestResult task preceding PublishTestResultScreenshot, you will need to also enable the Continue on error to make sure PublishTestResultScreenshot is not skipped.
Version 0.1.x is compatible with:
- Azure DevOps Service Cloud
- Test type: JUnit
- Microsoft-hosted agents: macOS 10.14 & 10.13, ubuntu16.04, win2019
NOTE that emulators are currently only available on macOS agents, so for Android UI Testing you will be limited to 10.14 or 10.13, but the task is not dependent on macOS agents.
Required
organization
: specify your organizationName (can be found from devops instance url http://dev.azure.com/{yourOrg})
Optional
screenshotFolder
: you can change where the task looks for screenshot, defaults to "./app/build/reports/androidTests/connected/screenshots/failures/"
- task: Genetec.publish-test-result-screenshot.pipeline-extension.PublishTestResultScreenshot@0
displayName: 'Publish test result screenshot'
inputs:
organization: {yourOrganizationName}
screenshotFolder: {yourCustomPath}
This task uses azure-devops-node-api which, under the hood, uses the Azure DevOps REST Api.
Succeeded
- All the screenshots were successfully uploadedSucceededWithIssues
(2 self explained possibles messages)- Some/All screenshots upload failed AND/OR
- Some/All screenshots files were missing
Skipped
- No test failures were foundError
- Usually related to authentification, connection, networkError etc.
You will need to install nvm, and npm with node to run this project.
- Install nvm
- Install node (npm is bundled)
nvm install node
nvm use node
- Install Typescript
npm install typescript -g
I used the latest version but just make sure that all commands return a version number.
nvm --version
npm --version
node --version
git clone [email protected]:Genetec/azure-devops-extension-publishtestresultscreenshot.git
- Uncomment the header of index.ts and set input values
// **********************************************************************************
// ************************* FOR LOCAL USE ******************************************
// process.env.ENDPOINT_AUTH_PARAMETER_SYSTEMVSSCONNECTION_ACCESSTOKEN = ""
// process.env.SYSTEM_TEAMPROJECT = ""
// process.env.INPUT_ORGANIZATION = ""
// process.env.INPUT_SCREENSHOTFOLDER = ""
// process.env.BUILD_BUILDID = ""
// **********************************************************************************
- Assign your access token to
ENDPOINT_AUTH_PARAMETER_SYSTEMVSSCONNECTION_ACCESSTOKEN
cd PublishTestResultScreenshotV0
npm install
tsc
node index.js
Before submitting your PR, make sure to test your changes on your DevOps instance using the following command:
tfx build tasks upload --overwrite --task-path "myPathToTheTask" --service-url "https://myOrg.visualstudio.com/DefaultCollection" --auth-type pat -t "xxx"
The PAT (personal access token) requires only the Manage Agent Pool permission.
Check Contribution Guide
Published under Apache 2.0 License