Creating a test case from a task recording
This part of the test is to test the user interface interactions. This is done by creating a task recording from within Dynamics 365 for Operations and importing it into a project in Visual Studio.
We will test the service order creation logic by creating a task recording.
Getting ready
This continues from the previous recipes.
How to do it...
To create a unit test for the vehicle service order's form, follow these steps:
- We must start from the main Dynamics 365 for Operations window; otherwise, the generated code may fail.
- Once at the main menu, click on the settings icon (the cog) and choose
Task recorder
. - Click on
Create recording
in theTask recorder
sidebar. - Enter
ConWHSServiceOrderTest
in theRecording name
field, and a description of what we expect to happen. This will become the class name. - Click on
Start
. - Navigate to the form to test, in our case,
Vehicle service orders
. - Create a new service order, and add two lines. The sidebar will record each interaction...