Common testing scenarios
Test mobile apps with Appetize and Playwright. This guide covers common scenarios like biometric validation, network request interception, and deep link testing, as well as working with hardware featu
Last updated
Test mobile apps with Appetize and Playwright. This guide covers common scenarios like biometric validation, network request interception, and deep link testing, as well as working with hardware featu
Last updated
This document assumes you have already set up an Appetize Playwright project. If not, we recommend reading the .
In this section, we'll cover several scenarios you might encounter, and how to solve them, while writing end-to-end integration tests using Appetize and Playwright. These use cases include hardware-related features like biometry validation, event listeners like intercepting network requests, and specific app functionality like testing deep links.
Developing localization testing can be a challenging and complex scenario to set up. These tests are relevant since some functionalities apply to specific areas.
The and documentation pages provides an example of how to implement it using our JS SDK. Sometimes you may wan't to change the location and language for all test cases, pass the configuration as an option of the method from playwright to achieve it.
Analytics in mobile development allow us to understand how the application is being used or the effectiveness of a new feature. The validation of analytics events is a common scenario to test that can get complicated as your application grows.
Independent state for each one of the test scripts is critical to have reliable runs. The best way to guarantee no trace left of any data related to the installed application from previous runs is to re-install the application after each test. Declare in the tests this behavior by utilizing the method inside the from Playwright.
Deep Links and Universal/App Links play a critical role in mobile application functionality. To open and test any URL that your application supports in a test script, use the method to trigger a Deep Link or the configuration property to invoke it at launch and validate that the expected view is visible after handling the link. For more information, visit the section from the documentation.
allow to automatically trust incoming Deep Links that the application can handle.
Network assertions allows to seamlessly validate an analytic event has been triggered, using the from our docs we can adapt the code to validate that a request with an specific url contains the event in the body.
Face ID, Touch ID, or any other biometrics validation is one of the critical features that mobile applications must test. A typical approach to test these features would be to have a service class for biometrics validation/enrollment and mock the result inside your tests with dependency injection. This approach can become complex to maintain as your application grows and does not offer full test coverage. Use the method to mock a biometrics match result without requiring additional setup.
Ensuring consistency in the UI of the application can be challenging. An example of this is branded/flavored UI components, where validating that each one of the components looks as expected and there was no regression is vital. To solve this with Appetize do and validate the UI.
We recommend using maxDiffPixelRatio option instead of maxDiffPixels to avoid flaky tests. For more information on the options available visit the documentation.