According to the business requirements described in Chapter 5, Developing a Customized Solution for Dynamics 365 Business Central, the user must be "able to create a default customer category and assign this default value to a customer automatically."
This perfectly illustrates the use of a test page using the following scenario:
- [FEATURE] Customer Category UI
- [SCENARIO #0007] Assign default category to customer from customer card
- [GIVEN] A non-blocked default customer category
- [GIVEN] A customer with customer category not equal to default customer category
- [WHEN] Select Assign Default Category action on customer card
- [THEN] Customer has default customer category
It should be noted that we have UI in the [FEATURE] tag, which denotes that the feature is tested by making use of the UI. Preferably, test automation is about creating so-called headless tests; that is, tests that do not make use of the UI, as UI tests are 5 to 10 times slower than headless tests and non-UI tests. This is demonstrated by Luc in his book with the following screenshot, which compares a similar headless test and a UI test:
The average execution duration for UI tests is 1.35 s, while the headless average is almost seven times faster: 0.20 s.