Getting to know mock testing in Test Engine
I will take a step back before diving into this topic to present the type of activities we can do in the preview version of Test Engine, available at the time of writing. Test Engine is based on Playwright (https://playwright.dev/), a library that provides cross-browser automation. It allows you to execute your tests, interact with elements, navigate to screens, or simulate API calls in your apps, as Power Apps runs on any browser as a web app. Test Engine uses Playwright to monitor and modify network traffic. Any request that Power Apps makes can be modified.
Let’s imagine your app called GPT from Azure OpenAI Service to generate a summary of a text. You don’t want to call the service every time in your tests, so in Test Engine, you will create a mock for the service. In Figure 11.9, you can follow what is going on under the hood:
Figure 11.9 – The Test Engine flow to intercept network calls...