Book Image

Automated Testing in Microsoft Dynamics 365 Business Central - Second Edition

Book Image

Automated Testing in Microsoft Dynamics 365 Business Central - Second Edition

Overview of this book

Dynamics 365 Business Central is a cloud-based SaaS ERP proposition from Microsoft. With development practices becoming more formal, implementing changes or new features is not as simple as it used to be back when Dynamics 365 Business Central was called Navigator, Navision Financials, or Microsoft Business Solutions-Navision, and the call for test automation is increasing. This book will show you how to leverage the testing tools available in Dynamics 365 Business Central to perform automated testing. Starting with a quick introduction to automated testing and test-driven development (TDD), you'll get an overview of test automation in Dynamics 365 Business Central. You'll then learn how to design and build automated tests and explore methods to progress from requirements to application and testing code. Next, you'll find out how you can incorporate your own as well as Microsoft tests into your development practice. With the addition of three new chapters, this second edition covers in detail how to construct complex scenarios, write testable code, and test processes with incoming and outgoing calls. By the end of this book, you'll be able to write your own automated tests for Microsoft Business Central.
Table of Contents (22 chapters)
Section 1: Automated Testing – A General Overview
Section 2:Automated Testing in Microsoft Dynamics 365 Business Central
Section 3:Designing and Building Automated Tests for Microsoft Dynamics 365 Business Central
Section 4:Integrating Automated Tests in Your Daily Development Practice
Section 5:Advanced Topics
Section 6:Appendix

Test example 3 – a first UI test

The field Lookup Value Code has been implemented on the Customer table and tested. But, of course, to allow users to manage it, it needs to be made accessible in the UI. Consequently, it needs to be placed on the Customer Card.

Customer wish

The next stage of the customer wish is very close to the previous part defined by [SCENARIO #0001]. The main difference is that we now want to access a customer by means of the UI element Customer Card. By mimicking end users, our scenario describes creating a new Customer Card (see second GIVEN). Have a look:

[FEATURE] LookupValue UT Customer
[SCENARIO #0003] Assign lookup value on customer card
[GIVEN] Lookup value
[GIVEN] Customer card
[WHEN] Set lookup value on customer card
[THEN] Customer has lookup value code field populated

Test code

Consecutively, let's step through our 4-steps recipe.

Create a test codeunit

Again, sharing the same FEATURE tag values as in our previous tests...