ndtp / android-testify

Add screenshots to your Android tests
Other
101 stars 5 forks source link

148: Refactor output path into Destination #162

Closed DanielJette closed 1 year ago

DanielJette commented 1 year ago

What does this change accomplish?

Prerequisite for #148

How have you achieved it?

This PR introduces two core changes:

  1. File manipulation is now abstracted through the new Destination interface. This allows Testify to implement various alternative file output locations. The existing data/data and sdcard output destinations have been ported to the new interface. This allows for future destinations to be easily supported in the future. This change is backwards compatible.
  2. The Testify Gradle Plugin can now write to AndroidManifest placeholder values in the target application. This means that custom attributes defined in build.gradle are now visible to the Library code. So, advanced configuration options can now be set in the build.gradle file and used by any Library code. In this PR, I have used this feature to pass the useSdCard configuration option to the Library and also to pass the current Gradle module name.

📔 In addition, a small refactoring to ErrorCause was made to support the two new exceptions added

Scope of Impact and Testing instructions

Notice

Warning This change must keep main in a shippable state; it may be shipped without further notice.

AndroidTestifyBot commented 1 year ago

:white_check_mark: Success! - Legacy Sample screenshot test results

View build for commit 4b075659c77c0afa9689a6b1f0f1d971c7e9996a
AndroidTestifyBot commented 1 year ago

:white_check_mark: Success! - Flix Sample screenshot test results

View build for commit 4b075659c77c0afa9689a6b1f0f1d971c7e9996a