EasyRepro is a UI (User Interface) Test Framework for Dynamics 365 and all Model-Driven Apps in the Power Platform. It is developed by Microsoft and an OpenSource project which is accessible both on GitHub and as a NuGet package.
After this article, you will know how to run those tests inside of your Azure DevOps pipeline.
In the GitHub repository, you can find a lot of sample Tests. We will use one of those as a demo test. Our demo test will log in to our environment and create a test contact. The following sequence shows how this will look like when you run it on your device. The same will happen on the build server in Azure, without you seeing it.
Creating the Pipeline
First of all, we have to create an empty pipeline. To do this you open “Pipelines” in the menu on the left and then press the “new pipeline” button. If you already have another pipeline it will be in the upper right corner otherwise it will be in the middle of the screen. In the next screen, you have to choose “use the classic editor”.
On the second screen, you can leave the defaults like they are.
On the third and last screen, you choose “empty Job” at the top of the page.
We have to add 5 Steps to our fresh pipeline.
First, we will add 2 NuGet Steps.
Installing the NuGet Tools
executing NuGet restore
To do so you press the “+” and search for “NuGet” in the appearing flyout. After that, you first add the step “NuGet tool installer” and secondly the step “NuGet”.
Thereafter we have to add 3 Visual Studio steps. This time you search for “visual” and add the following steps in this order:
Visual Studio build
Visual Studio test platform installer
Visual Studio Test
Now you should have the following steps in the shown order.
Out of our 5 Steps we only have to configure 2.
Config Build Step
In the build step, we have to define which solution we would like to build, which version and configuration to use.
We only want to build the EasyRepro Solution. In the demo case, we have to add the following in the “Source” field of the step because we do have a separate Solution for UI tests in the “EasyRepro” folder.
In the field “Visual Studio Version” you choose “Visual Studio 2017” out of the dropdown.
Finally, you should write “release” in the “Configuration” field.
Overall the configuration of the Build step should look like this.
Config Test step
The second step we have to configure is the “Visual Studio Test” step.
Here we have to specify the test files, the search folder, the containment of UI tests and the test platform to use.
In the field “Test files” you should add a pattern that specifies your test files. In the demo case, the following will suit our needs since we use the EasyRepro sample projects.
The “Search folder” should specify where the test runner can find the tests after they were built. This value also depends on your project structure, but the beginning should always we “$(System.DefaultWorkingDirectory)”. For our demo, I will add the following value.
Privacy & Cookies Policy
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Share this ArticleLike this article? Email it to a friend!