DEV Community

Cinthia Barbosa da Silva
Cinthia Barbosa da Silva

Posted on

Integration Cypress with Azure DevOps: Publishing test videos in your Pipeline

Cypress is a front end test automation tool used for regression testing web applications. It is based in JavaScript and integrates seamlessly with many continuous integration tools, making it a great choice for automating tests.

I've been studying Cypress for a while now, especially it is integration with Azure DevOps. In this post, I will share how to publish videos from Cypress tests on Azure DevOps.

Let's go!🚀

First of all, make sure your tests are in a **Git repository (“Repos”) **in Azure DevOps.

Next, in your Cypress test code, you need to configure the settings in the "cypress.config.js" file as follows:

// cypress.config.js

module.exports = {
  video: true,
  videosFolder: 'cypress/videos'
};

Enter fullscreen mode Exit fullscreen mode

Now, navigate to Pipelines. If you already have a configured pipeline, locate it and click on Edit to make changes.

Image description

After that, in your pipeline editor within Azure DevOps, navigate to Tasks and use the search bar to find the task named "publish build artifacts".

Image description

Now, you'll configure the task:

  1. Set the Path to publish to specify where the artifact files will be stored in Azure.
  2. Specify the Artifact name to give a name to your artifact.
  3. Leave the Artifact publish location as default, normally set to "Azure Pipelines".

After configuring these settings, click on Add to add the task to your pipeline.

Image description

Now the configuration has been added to the azure-pipeline.yml file.

Image description
Once you have saved the azure-pipeline.yml file, initiate the test build by clicking on "Run Pipeline" in Azure DevOps. This action will start the CI/CD pipeline and execute the defined tasks, including a new configuration for video recording.

After running the test, navigate to the "Summary" and look for the information indicating "1 published artifact" and click on it.

Image description

This artifact contains the test recording.

Image description
By following these steps, you will use video recordings for better test analysis and debugging when necessary!

If you found this article helpful, please leave a comment.❤️

Top comments (0)