tvOS UI test network logs
When an end-to-end tvOS UI test prepares data or verifies results through your backend, the cause of a failure is often that request rather than the Apple TV interface. AppeliumTests captures HTTP requests made by your UI test process and places them on the same timeline as the test actions and the failure.
Each entry contains structured request and response information like:
- Headers
- Payload
- Duration
- Status codes
Automatic network requests capturing
By default, logging is automatically enabled for all network requests which use URLSession.shared, URLSessionConfiguration.default and URLSessionConfiguration.ephemeral configuration.
If you wish to enable network logging for any other/custom session configuration you can simply call:
AppeliumTests.enableLogging(for: mySessionConfiguration)
Manual request logging
In case you are not using the standard URLSession or you want to capture the requests that are not automatically captured, Appelium provides you with APIs that will allow you to manually log HTTP requests:
1 2 3 4 5 6 7 8 9 10 11 12 | |
or in case of an error:
AppeliumTests.logRequestError(token: token, error: error)