Search code examples
azureazure-devopsdeploymentautomationbuild

Cypress automation project in Azure dev ops


New to Automation- I have created a automation cypress project in my local. I pushed the project to Azure dev ops and created a pipeline for that. The test cases are running successfully. My question is Dev team wants to trigger those test cases before deploying the build. How to achieve that? Anybody can help, thanks a lot!!


Solution

  • My question is Dev team wants to trigger those test cases before
    deploying the build? How to achieve that?

    You can make use of Stages to trigger your Cypress tests in the Dev stage first and then start the next deployment in your Build stage manually. You can start the deployment in any stage or across stages manually one after another or automatically in one run.

    I created one sample cypress task in my Azure Pipelines like below:-

    enter image description here

    Now, I ran the pipeline in a Dev stage first like below and then at Build, You can trigger these pipelines together automatically or one by one manually, Dev team can run this pipeline before triggering it in the Build stage:-

    enter image description here

    Save this release pipeline and Trigger the required build stage manually with the below option:-

    enter image description here

    Here, you can select both your Dev and Build stage to trigger manually by yourself. With the above option Dev will run automatically and Build should be run manually like below:-

    enter image description here

    After the Dev stage is triggered the Build stage can be triggered manually like below:-

    enter image description here

    enter image description here

    Reference:-

    Stages in Azure Pipelines - Azure Pipelines | Microsoft Learn

    Cypress in Azure DevOps Pipeline | Azure DevOps Pipeline | azure pipeline cypress | cypress test case azure | Medium