allure-framework / allure-kotlin

Allure integrations for test frameworks targeting Kotlin and Java with 1.6 source compatibility.
Apache License 2.0
57 stars 21 forks source link

[Android] Writing test into sdcard using TestStorage api #69

Closed kamilwawrzyczek closed 2 years ago

kamilwawrzyczek commented 2 years ago

Context

Currently test results are stored in app data folder and when tests are clearing app data between each test than old test results are also cleared. This PR is adding TestStorageResultsWriter that is using new TestStorage api from androidx.test.services. TestStorage is saving files into /sdcard/googletest so the results are not deleted when app data is cleared. TestStorage is marked as experimental API thats why I added new allure.results.useTestStorage property to enable this feature if needed. Additionally I made some improvements so the library users could easily override default TestResultWriter used by AllureAndroidLifecycle if needed (when I was working on this solution I needed to copy all runner code to just override TestResultWriter).

Checklist

CLAassistant commented 2 years ago

CLA assistant check
All committers have signed the CLA.

mohamedwasiq commented 1 year ago

This feature is not working for Emulators.