How to create CI pipeline for automation testing with YAML in Azure DevOps

Piyathida San-aoun
2 min readApr 13, 2021

Continuous integration (CI) and continuous delivery (CD) process almost software company has this process and I don't need to explain what is CI/CI!!

I work as Automate QA Engineer and need to share the experience because this position besides coding skills and testing skills, should know the processing pipeline and can handle it as well. If you can run automate test only your on matching, It’s unuseful.

YAML build definitions can be added to a project. Azure DevOps also provides default templates and simplifies the process of defining build and release tasks.

How to add a YAML build definition?

  1. Navigate to your team project on Azure DevOps
  2. Navigate to Pipelines.
  3. Click New pipeline. We will use the wizard to automatically create the YAML definition based on our project.
  4. Select the Azure Repos Git
  5. Select the ASP.NET template as the starting point for your pipeline.
  6. Click Save and run to confirm the commit.

- How to create Task Visual Studio Test task?

  1. Navigate to Pipelines then select your pipeline and click View
  2. On the right side, you will see Task and search Visual Studio Test
  3. Config the detail require fields

3.1 displayName: ‘Run Integration Tests’

( Test assembly: Use this option to specify one or more test assemblies that contain your tests. You can optionally specify a filter criterion to select only specific tests. )

3.2 testAssemblyVer2: **\*Project.Api.IntegrationTest.dll

( Run tests from the specified files )

3.3 testFiltercriteria: ‘Category=IntegrationTest’

( Additional criteria to filter tests from Test assemblies )

3.4 configuration: ‘$(BuildConfiguration)’

( Build configuration against which the tests should be reported. If you have defined a variable for configuration in your build task, use that here. )

It’s easy to create a test task on Pipeline with yml.

From my experience, found complicate problems not about set task tests. It’s about the problem on couldn’t trust the certificate. when we set up a test run on could Agent then Failed. Next content I will share how I fixed this issue.

Thank you to view my content. I hope will useful to everyone interested CI pipeline.

--

--