- Respect Gradle console mode. See https://docs.gradle.org/current/userguide/command_line_interface.html#sec:command_line_customizing_log_format for more information.
- #231 - Replace Plugin-Local with Composite Build
- #226 - Testify will now throw a
LowMemoryException
when attempts to allocate anIntBuffer
fail. This can help users diagnose AVD configuration problems and reports on the state of the device.
- #224 - Upgrade to Kotlin 1.9.24 and Compose to 2024.05.00
- Fix several warnings
- Upgrade dependencies on sample apps
- Warning: The January '24 update to Compose introduces changes to the default font padding which impacts any Compose-base tests that use text. https://android-developers.googleblog.com/2024/01/whats-new-in-jetpack-compose-january-24-release.html
- #219 - Upgrade to Gradle 8.6 and AGP 8.4.1
- Define namespace in build.gradle for library projects
- jvmTarget, sourceCompatibility and targetCompatibility set to Java 17
- Replace sourcesJar task with android publishing closure
- #212 - Bug fixes and performance improvements for the ParallelPixelProcessor
- Add parallelThreads extension property to the Gradle plugin. This allows for customization of the number of worker threads to be used by the ParallelProcessor. Set limits on the thread pool to a minimum of 1 and a maximum of 4.
- Refactor the ParallelPixelProcessor and introduce a new configuration class to wrap the thread configuration variables and the CoroutineDispatcher configuration.
- Several small improvements to the FuzzyCompare method to perform fewer allocations inside the analyze function
- Upgrade UiAutomator dependency to 2.3.0 https://developer.android.com/jetpack/androidx/releases/test-uiautomator
- Recycle the bitmaps in the finalize block of assertSame()
- Add several new tests and enhancements to the existing ParallelProcessor tests
- Upgrade the compile SDK for the samples to 34
- #208 - Redefine plugin artifact to work with gradle plugin DSL
- #201 - Added ScreenshotScenarioRule which works in conjunction with Android's ActivityScenario.
- Added tests demonstrating the usage of ScreenshotScenarioRule.
- Major overhaul of all documentation to include alternative instructions for using ScreenshotScenarioRule.
- #198 Fixes #79: Testify incompatible with gradle configuration cache
- The Testify Gradle Plugin now supports Gradle Configuration Cache.
- Gradle Plugin now uses Junit5 tests.
- #196 - Flix Library sample added
- #192 - Flix Sample now uses Hilt instead of Koin for dependency injection
- #191 - Added additional method documentation.
Released without additional changes from 2.0.0-rc03.
- Refactor ComposableScreenshotRule.setCaptureMethod() to call the configure() method.
- Added a Dialog sample to test as a demonstration of how to capture dialog boxes and also as a regression test for the bug with
setCaptureMethod()
- Fixed a bug in ComposableScreenshotRule.setCaptureMethod() where it was incorrectly ignoring the passed in captureMethod argument.
ScreenshotRule.getScreenshotInstrumentationAnnotation()
is now a top-level function.Collection<Annotation>.getAnnotation()
renamed toCollection<Annotation>.findAnnotation()
.- Package for
getScreenshotAnnotationName()
changed fromdev.testify.internal.extensions
todev.testify.annotation
. ScreenshotRule.initializeView()
is now a top-level function.EspressoHelper
now extendsScreenshotLifecycle
andbeforeScreenshot()
has been replaced withafterInitializeView()
- Moved
dev.testify.internal.assertExpectedDevice
todev.testify.core.assertExpectedDevice
- Moved
dev.testify.internal.Configurable
todev.testify.core.Configurable
- Moved
dev.testify.internal.DEFAULT_FOLDER_FORMAT
todev.testify.core.DEFAULT_FOLDER_FORMAT
- Moved
dev.testify.internal.DEFAULT_NAME_FORMAT
todev.testify.core.DEFAULT_NAME_FORMAT
- Moved
dev.testify.internal.DeviceStringFormatter
todev.testify.core.DeviceStringFormatter
- Moved
dev.testify.internal.exception.ActivityMustImplementResourceOverrideException
todev.testify.core.exception.ActivityMustImplementResourceOverrideException
- Moved
dev.testify.internal.exception.ActivityNotRegisteredException
todev.testify.core.exception.ActivityNotRegisteredException
- Moved
dev.testify.internal.exception.AssertSameMustBeLastException
todev.testify.core.exception.AssertSameMustBeLastException
- Moved
dev.testify.internal.exception.FailedToCaptureBitmapException
todev.testify.core.exception.FailedToCaptureBitmapException
- Moved
dev.testify.internal.exception.FinalizeDestinationException
todev.testify.core.exception.FinalizeDestinationException
- Moved
dev.testify.internal.exception.MissingAssertSameException
todev.testify.core.exception.MissingAssertSameException
- Moved
dev.testify.internal.exception.MissingScreenshotInstrumentationAnnotationException
todev.testify.core.exception.MissingScreenshotInstrumentationAnnotationException
- Moved
dev.testify.internal.exception.NoScreenshotsOnUiThreadException
todev.testify.core.exception.NoScreenshotsOnUiThreadException
- Moved
dev.testify.internal.exception.RootViewNotFoundException
todev.testify.core.exception.RootViewNotFoundException
- Moved
dev.testify.internal.exception.ScreenshotBaselineNotDefinedException
todev.testify.core.exception.ScreenshotBaselineNotDefinedException
- Moved
dev.testify.internal.exception.ScreenshotIsDifferentException
todev.testify.core.exception.ScreenshotIsDifferentException
- Moved
dev.testify.internal.exception.ScreenshotTestIgnoredException
todev.testify.core.exception.ScreenshotTestIgnoredException
- Moved
dev.testify.internal.exception.TestifyException
todev.testify.core.exception.TestifyException
- Moved
dev.testify.internal.exception.TestMustWrapContextException
todev.testify.core.exception.TestMustWrapContextException
- Moved
dev.testify.internal.exception.UnexpectedDeviceException
todev.testify.core.exception.UnexpectedDeviceException
- Moved
dev.testify.internal.exception.UnexpectedOrientationException
todev.testify.core.exception.UnexpectedOrientationException
- Moved
dev.testify.internal.exception.ViewModificationException
todev.testify.core.exception.ViewModificationException
- Moved
dev.testify.internal.ExclusionRectProvider
todev.testify.core.ExclusionRectProvider
- Moved
dev.testify.internal.formatDeviceString
todev.testify.core.formatDeviceString
- Moved
dev.testify.internal.getDeviceDescription
todev.testify.core.getDeviceDescription
- Moved
dev.testify.internal.getDeviceDimensions
todev.testify.core.getDeviceDimensions
- Moved
dev.testify.internal.logic.AssertionState
todev.testify.core.logic.AssertionState
- Moved
dev.testify.internal.logic.assertSame
todev.testify.core.logic.assertSame
- Moved
dev.testify.internal.logic.compareBitmaps
todev.testify.core.logic.compareBitmaps
- Moved
dev.testify.internal.logic.ScreenshotLifecycleHost
todev.testify.core.logic.ScreenshotLifecycleHost
- Moved
dev.testify.internal.logic.ScreenshotLifecycleObserver
todev.testify.core.logic.ScreenshotLifecycleObserver
- Moved
dev.testify.internal.logic.takeScreenshot
todev.testify.core.logic.takeScreenshot
- Moved
dev.testify.internal.processor._executorDispatcher
todev.testify.core.processor._executorDispatcher
- Moved
dev.testify.internal.processor.capture.canvasCapture
todev.testify.core.processor.capture.canvasCapture
- Moved
dev.testify.internal.processor.capture.createBitmapFromDrawingCache
todev.testify.core.processor.capture.createBitmapFromDrawingCache
- Moved
dev.testify.internal.processor.capture.pixelCopyCapture
todev.testify.core.processor.capture.pixelCopyCapture
- Moved
dev.testify.internal.processor.capture.PixelCopyCaptureKt;
todev.testify.core.processor.capture.PixelCopyCaptureKt;
- Moved
dev.testify.internal.processor.compare.colorspace.calculateDeltaE
todev.testify.core.processor.compare.colorspace.calculateDeltaE
- Moved
dev.testify.internal.processor.compare.FuzzyCompare
todev.testify.core.processor.compare.FuzzyCompare
- Moved
dev.testify.internal.processor.compare.sameAsCompare
todev.testify.core.processor.compare.sameAsCompare
- Moved
dev.testify.internal.processor.createBitmap
todev.testify.core.processor.createBitmap
- Moved
dev.testify.internal.processor.diff.HighContrastDiff
todev.testify.core.processor.diff.HighContrastDiff
- Moved
dev.testify.internal.processor.maxNumberOfChunkThreads
todev.testify.core.processor.maxNumberOfChunkThreads
- Moved
dev.testify.internal.processor.ParallelPixelProcessor
todev.testify.core.processor.ParallelPixelProcessor
- Moved
dev.testify.internal.ScreenshotRuleCompatibilityMethods
todev.testify.core.ScreenshotRuleCompatibilityMethods
- Moved
dev.testify.internal.TestifyConfiguration
todev.testify.core.TestifyConfiguration
- Moved
dev.testify.internal.TestName
todev.testify.core.TestName
isRunningOnUiThread()
added as a top-level function.outputFileName()
added as an extension method forContext
.- Interface
AssertionState
- Interface
ScreenshotLifecycleHost
assertSame()
is now available as a top-level function, decoupled fromScreenshotRule
open fun ScreenshotRule.generateHighContrastDiff(baselineBitmap: Bitmap, currentBitmap: Bitmap)
has been removed. Useclass HighContrastDiff
directly.ScreenshotRule.applyViewModifications()
has been removed. UseTestifyConfiguration.applyViewModificationsMainThread()
instead.
- #175: Output from Gradle Managed Devices now named according to Testify naming strategy
ScreenshotRule.getRootView()
is now an extension functionfun Activity.findRootView(@IdRes rootViewId: Int): ViewGroup
ScreenshotRule.setCaptureMethod()
is deprecated. Usevar captureMethod: CaptureMethod?
onTestifyConfiguration
to set the capture method.ScreenshotRule.setCompareMethod()
is deprecated. Usevar compareMethod: CompareMethod?
onTestifyConfiguration
to set the compare method.ScreenshotRule.compareBitmaps()
is now a top-level function.ScreenshotRule.takeScreenshot()
is now a top-level function.
- #163: Do not throw UnexpectedDeviceException if an expected baseline exists
- Added initial support of Gradle managed devices
- Android Gradle Plugin to 7.4.1
- Android Material
material
to 1.9.0 - AndroidX
activity-compose
to 1.7.1 - AndroidX
appcompat
to 1.6.1 - AndroidX
core
to 1.10.0 - AndroidX
lifecycle-runtime-ktx
to 2.6.1 - AndroidX Test
espresso-accessibility
,espresso-core
,espresso-contrib
to 3.5.1 - AndroidX Test
junit
to 1.1.5 - AndroidX Test
monitor
to 1.6.1 - AndroidX Test
rules
to 1.5.0 - AndroidX Test
runner
to 1.5.2 - Compile SDK to 33
- Dokka to 1.8.10
- Jetpack Compose
compose.ui
,core
,material
to 1.4.3 - Jetpack Compose Compile to 1.4.7
- Kotlin to 1.8.21
com.android.application
to 7.4.2com.android.library
to 7.4.2
- Internal file management is now abstracted through the new
Destination
interface. This interface allows for extensibility and customization of the file handling. It is backwards compatible with the existing SDCard and app data/data directory options.
- Fix #81:
reportShow
andreportPull
now support Gradle 7+. - Exceptions now correctly report the gradle module name of the source of the error.
- Reporter now supports skipped or ignored tests.
- Added
enableReporter
parameter toComposableScreenshotRule
constructor
- FlixSample now using Espresso IdlingResource to eliminate screenshot test race condition.
Sample
has been renamed toLegacySample
and moved to theSamples/Legacy
directory.
- Add multi-user support to the Gradle Plugin.
- Use
-Puser=<number>
to override the default user. - Added unit tests to the
:Plugin
project.
- Fixed #120 - can set a custom capture method when using ComposableScreenshotRule
@IgnoreScreenshot
annotation added- An annotation used to ignore screenshots tests. Test will be reported as Skipped.
- Should be used as a more versatile replacement for the
orientationToIgnore
argument on@ScreenshotInstrumentation
ScreenshotRule.assertSame()
will now throw anUnexpectedDeviceException
if a baseline exists with a different device description than that of the currently running device. This can be helpful to catch cases where you may be running a test against the wrong emulator. You can add add-Pdevice=N
to any Testify Gradle command to target a specific device.
orientationToIgnore
argument on@ScreenshotInstrumentation
has been removed- Use
@IgnoreScreenshot
instead
- Use
- Library tests now use mockk.
- Class
DeviceIdentifier.DeviceStringFormatter
has been migrated to a top-level class,DeviceStringFormatter
DeviceIdentifier.getDeviceDimensions
has been replaced byfun getDeviceDimensions(context: Context): Pair<Int, Int>
DeviceIdentifier.getDescription
has been replaced byfun getDeviceDescription(context: Context): String
DeviceIdentifier.formatDeviceString
has been replaced byfun formatDeviceString(formatter: DeviceStringFormatter, format: String): String
OutputFileUtility.doesOutputFileExist
has been replaced byfun doesOutputFileExist(context: Context, filename: String): Boolean
OutputFileUtility.getFileRelativeToRoot
has been replaced byfun getFileRelativeToRoot(subpath: String, fileName: String, extension: String): String
OutputFileUtility.getOutputDirectoryPath
has been replaced byfun getOutputDirectoryPath(context: Context): File
OutputFileUtility.getOutputFilePath
has been replaced byfun getOutputFilePath(context: Context, fileName: String, extension: String = PNG_EXTENSION): String
OutputFileUtility.getPathRelativeToRoot
has been replaced byfun getPathRelativeToRoot(subpath: String): String
OutputFileUtility.useSdCard
has been replaced byfun useSdCard(arguments: Bundle): Boolean
ScreenshotUtility.assureScreenshotDirectory
has been replaced byfun assureScreenshotDirectory(context: Context): Boolean
ScreenshotUtility.createBitmapFromActivity
has been replaced byfun createBitmapFromActivity(activity: Activity, fileName: String, captureMethod: CaptureMethod, screenshotView: View? = activity.window.decorView): Bitmap?
ScreenshotUtility.loadBaselineBitmapForComparison
has been replaced byfun loadBaselineBitmapForComparison(context: Context, testName: String): Bitmap?
ScreenshotUtility.loadBitmapFromAsset
has been replaced byfun loadBitmapFromAsset(context: Context, filePath: String): Bitmap?
ScreenshotUtility.loadBitmapFromFile
has been replaced byfun loadBitmapFromFile(outputPath: String, preferredBitmapOptions: BitmapFactory.Options): Bitmap?
ScreenshotUtility.preferredBitmapOptions
has been replaced byval preferredBitmapOptions: BitmapFactory.Options
ScreenshotUtility.saveBitmapToFile
has been replaced byfun saveBitmapToFile(context: Context, bitmap: Bitmap?, outputFilePath: String): Boolean
- Added
screenshotAnnotation
setting to the Testify gradle extension, allowing customization of the instrumentation annotation used to identify screenshot tests. This makes the @ScreenshotInstrumentation annotation optional.
- Removed
verifyImageMagick
andremoveDiffImages
tasks
- kotlin to 1.7.21
- kotlin-gradle-plugin to 1.7.21
- kotlinx-coroutines-android to 1.6.4
- kotlin-stdlib-jdk8 to 1.7.21
- Android Gradle Plugin to 7.3.1
- Gradle wrapper to 7.4
- androidx.compose.ui to 1.4.0-alpha02
- androidx.compose.material to 1.4.0-alpha02
- androidx.compose.compiler to 1.4.0-alpha02
- Upgrade Sample target & compile SDK to 33
Capture the entire device screen, including system UI, dialogs and menus.
Combine visual regression testing with accessibility checks to further improve the quality and expand the reach of your application.
-
ComposableScreenshotRule
now has an additional constructor argument,composeTestRule
. This provides you with a default instance ofComposeTestRule
or allows you to provide your own instance. With thiscomposeTestRule
instance, you can now use theComposeTestRule
semantics to interact with the UI hierarchy prior to taking screenshots.@get:Rule val rule = ComposableScreenshotRule(composeTestRule = createAndroidComposeRule(ComposableTestActivity::class.java)) @ScreenshotInstrumentation @Test fun default() { rule .setCompose { var text by remember { mutableStateOf("") } TextField( value = text, onValueChange = { text = it }, modifier = Modifier.testTag("field") ) } .setComposeActions { composeTestRule -> composeTestRule.onNodeWithTag("field").performTextInput("testify") } .assertSame() }
ComposableTestActivity
now supports resource wrapping. This means that Testify can configure the font scale and locale for tests. Compose screenshot tests will now respect thelocale
andfontScale
configuration parameters. Usage:rule .setCompose { Text("Example") } .setLocale(Locale.FRANCE) .setFontScale(2.0f)
Capture the entire device screen, including system UI, dialogs and menus.
Combine visual regression testing with accessibility checks to further improve the quality and expand the reach of your application.
This version is provided as an easier migration path to the Testify 2.0 libraries.
2.0.0-alpha01 is functionally identical to 1.2.0-alpha01 but all classes have been updated to use
the new dev.testify
namespace.
If you update all of your code to reference dev.testify
instead of com.shopify.testify
you will
be better positioned to adopt the new Testify 2.0 API.
Please the the Migration Guide
- Bump Testify core version to 1.2.0-alpha01
- kotlin upgraded from 1.4.31 to 1.5.31
- androidx.appcompat:appcompat from 1.2.0 to 1.3.1
- androidx.test.espresso from 3.3.0 to 3.4.0
- androidx.test.ext:junit from 1.1.2 to 1.1.3
- androidx.test:rules and androidx.test:runner from 1.3.0 to 1.4.0
- kotlinx-coroutines from 1.4.3 to 1.5.1
- com.google.android.material from 1.3.0 to 1.4.0
- mockito from 3.3.3 to 4.0.0
- mockito-android from 3.3.3 to 4.0.0
- kotlin upgraded from 1.4.31 to 1.5.31
- Support for Jetpack Compose 1.0.5
- ComposeActivity
- ComposeActivityScreenshotTest
- compileSdkVersion from 29 to 31
- targetSdkVersion from 29 to 31
Library and plugin released without additional changes.
-
Shopify/android-testify#228 , Shopify/android-testify#215 Account for uneven processing chunk sizes. As Testify processes, it divides the images into chunks for faster, parallel processing. A bug in the original code assumed that each processing chunk would be equally sized. This caused an out-of-bounds exception in any case where the number of pixels in the image could not be evenly divided.
-
Shopify/android-testify#216 You can now use
ScreenshotRule.setExactness()
in conjunction withScreenshotRule.defineExclusionRects()
. You can now define both an exclusion area and an exactness threshold.
- Method
ScreenshotRule.getExactness():Float?
added.
-
Method
ScreenshotRule.setExactness(exactness: Float?): ScreenshotRule<T>
now accepts a nullable value. -
TestifyFeatures.GenerateDiffs
now visualizes exclusion regions and the exactness tolerance. When enabled, GenerateDiffs will write a companion image for your screenshot test which can help you more easily identify which areas of your test have triggered the screenshot failure. Diff files are only generated for failing tests. The generated file will be created in the same directory as your baseline images. Diff files can be pulled from the device using:screenshotPull
.- Black pixels are identical between the baseline and test image
- Grey pixels have been excluded from the comparison
- Yellow pixels are different, but within the Exactness threshold
- Red pixels are different
-
Method
DeviceIdentifier.getDeviceDimensions(context: Context): Pair<Int, Int>
is now public.
- Several internal changes to support Gradle 7.
- Fix Shopify/android-testify#225 Apply annotations to task properties for up-to-date checks. Adds missing annotations on public properties in Tasks to assist with up-to-date checks. Missing annotations are now errors in Gradle 7.0+.
- Fix Shopify/android-testify#234
Using the Testify plugin with AGP 7+ would generate the error "Cannot query the value of
property 'applicationId' because configuration of project ':app' has not completed yet". Fixed by
catching the error and providing a sensible default. In the case where the test packaged ID is
incorrectly inferred, the user can specify
testify { testPackageId "my.custom.package.test" }
in their build.gradle to override the inferred value.
- Renamed the
rootViewId
setter onScreenshotTestRule
for better Java interoperability. It has been renamed tosetRootViewIdResource
.
- Fix "ParallelPixelProcessor.kt:90 - java.lang.IndexOutOfBoundsException: index=315250 out of bounds (limit=315250)" Shopify/android-testify#215
- AGP from 4.2.0-beta6 to 4.2.0
- Remove kotlin-android-extensions from Sample and replace with viewBinding
- Optional constructor argument enableReporter added to ScreenshotRule. Allows you to specify whether to run the reporter for this test rule.
- TestifyFeatures now support multiple named strings.
- PixelCopyCapture can be enabled using either "testify-experimental-capture" or " testify-pixelcopy-capture" in the AndroidManifest
- FuzzyCompare (setExactness) is now multi-threaded and significantly faster.
- ScreenshotRule constructor argument activityClass is now
protected
- ScreenshotRule constructor argument rootViewId is now
protected
- ScreenshotRule constructor argument launchActivity is now
protected
- ScreenshotRule.testNameComponents is now
public
- ScreenshotRule.fullyQualifiedTestPath is now
public
- ScreenshotRule.getRootView is now
public
- ScreenshotRule.instrumentationPrintln is now
public
- ScreenshotRule.isRecordMode is now
public
- ScreenshotRule.getModuleName is now
public
- ScreenshotRule.beforeActivityLaunched() is now annotated with
@CallSuper
- ScreenshotRule.afterActivityLaunched() is now annotated with
@CallSuper
- Added
TestifyFeatures.GenerateDiffs
. When enabled, will output a.diff.png
alongside existing baseline images. These images are high-contrast images where each difference, regardless of how minor, are indicated in red against a black background. See thegenerateDiffs
test inScreenshotRuleExampleTests
for an example. Diff images will be pulled from the device when runningscreenshotPull
. - ScreenshotRule now supports the generation of YAML test reports.
- Added
Reporter
feature flag to TestifyFeatures. Allows you to enable test reporting. - Added method
ScreenshotRule.beforeAssertSame()
. This method is invoked immediately before assertSame and before the activity is launched. - Added method
ScreenshotRule.beforeInitializeView(activity: Activity)
. This method is invoked prior to any view modifications and prior to layout inflation. - Added method
ScreenshotRule.afterInitializeView(activity: Activity)
. This method is invoked after layout inflation and all view modifications have been applied. - Added method
ScreenshotRule.beforeScreenshot(activity: Activity)
. This method is invoked immediately before the screenshot is taken. - Added method
ScreenshotRule.afterScreenshot(activity: Activity, currentBitmap: Bitmap?)
. This method is invoked immediately after the screenshot has been taken. - Added method
ScreenshotRule.applyViewModifications(parentView: ViewGroup)
. This method is called on the parent view to make runtime modifications to the view properties or layout.
- Compile and Target SDK from 29 to 30
- AGP from 4.1.0 to 4.2.0-beta6
- Gradle from 6.5 to 6.7.1
- Kotlin from 1.3.72 to 1.4.31
- AppCompat from 1.1.0 to 1.2.0
- Espresso from 3.2.0 to 3.3.0
- JUnit from 1.1.1 to 1.1.2
- Test Rules from 1.2.0 to 1.3.0
- Test Runner from 1.1.1 to 1.3.0
- Added task
reportShow
to print the test result report to the console. - Added task
reportPull
to copy the report file from the device and wait for it to be committed to disk.
- Material from 1.1.0 to 1.3.0
- MockitoKotlin from 2.1.0 to 2.2.0
- ScreenshotUtility is now public
- ScreenshotBaselineNotDefinedException now reports the expected device key
- Public method getRootViewId() has been added to ScreenshotRule
- Increase the timeout values on orientation change. Addresses
various
Failed to apply requested rotation
andActivity did not resume
errors when invokingsetOrientation
.
- Android Gradle Plugin to 4.1.0
- Gradle Wrapper to 6.5
- Access task names lazily via names property. We were previously accessing task names in a way
which resulted in early configuration of tasks resulting in Gradle failing to sync on the latest
versions of Gradle and Android Gradle Plugin when custom lint checks were used in a project.
Likely related to https://issuetracker.google.com/issues/67482030#comment2.
Use the
TaskContainer.names
which doesn't cause all tasks to be resolved immediately.
- Update Sample application to use a Pixel 3a API 30 baseline emulator.
- Replace Travis CI with GitHub Actions. https://github.com/Shopify/android-testify/actions
-
Fix Shopify/android-testify#138 Introduce the
setFocusTarget
method onScreenshotRule
which allows for keyboard focus to be placed on an explicit View. -
Fix Shopify/android-testify#165 Increase the timeout on the ActivityLifecycleMonitor to 5 seconds to allow for the rotation to complete. Deregister the lifecycle callback.
-
Fix Shopify/android-testify#166 Replace the existing FuzzyCompare algorithm with CIEDE2000. Calculate the colour difference value between two colours in lab space. The CIELAB color space (also known as CIE L* a* b* or sometimes abbreviated as simply "Lab" color space) is a color space defined by the International Commission on Illumination (CIE) in 1976. It expresses color as three values: L* for the lightness from black (0) to white (100), a* from green (−) to red (+), and b* from blue (−) to yellow (+). CIELAB was designed so that the same amount of numerical change in these values corresponds to roughly the same amount of visually perceived change. The CIE calls their distance metric ΔE * ab where delta is a Greek letter often used to denote difference, and E stands for Empfindung; German for "sensation". If deltaE < 1 then the difference can't recognized by human eyes.
- The gradle plugin has moved to
Plugins/Gradle
- Add defineExclusionRects method to ScreenshotRule. You can now use defineExclusionRects to exclude regions from a bitmap comparison.
- Android Gradle Plugin to 4.0.0
- AndroidX Junit to 1.1.1
- AndroidX Test Rules to 1.2.0
- Kotlin to 1.3.72
- Mockito to 3.3.3
- Added
autoImplementLibrary
member to thetestify
extension. Defaults totrue
. When set tofalse
, prevents the Plugin from automatically adding a LibraryandroidTestImplementation
dependency to your project. This is useful for local debugging or if you require a different version of the library and plugin.
- Fixed issue #153 - Orientation change will now be reliably applied regardless of how many times
you invoke
setOrientation
in a single test class.
- Fixed issue #151. Plugin correctly displays Locale string with an underscore, not a dash.
e.g.
en_US
, noten-US
- Fixed issue #148. Can now correctly override both enabled and disabled features using an AndroidManifest meta-data tag.
Breaking changes introduced. Bumped Testify to 1.0.0-beta1
⚠️ Screenshot images now are written to subdirectories under thescreenshot
directory on device. Screenshot paths on device now include the full device key and such are properly defined to fully represent the device configuration used to generate the images. This can be a breaking change if you use custom scripting to pull/access screenshot images from the emulator.⚠️ The emulator locale is now encoded into the device key by default. Previously, only the language was encoded in the key. You can disable this behavior using theLocale
(testify-experimental-locale
) feature. This change will require you to rename your baseline image directory to include the full locale path.- TestifyFeatures Enable or disable some features at runtime via manifest entry or in code.
- ScreenshotRule.withExperimentalFeatureEnabled
Used in conjunction with
TestifyFeatures
, you can selectively enable an experimental feature on the test rule. Features are reset afterassertSame
is called. - TestifyLayout can now accept a layout resource name or a layout resource ID. This is useful for library projects where resource IDs are not stable.
- Two new bitmap capture algorithms have been added. You can now select between PixelCopy, Canvas
and DrawingCache capture methods.
These can be enabled with by passing either CanvasCapture or PixelCopyCapture
to
withExperimentalFeatureEnabled
, or by enablingtestify-canvas-capture
ortestify-experimental-capture
in your manifest.
- Fully support changing locale during testing on API 19+
- Correctly access external files directory on API 28+
- Correctly detect the locale on API 22
SoftwareRenderViewModification
now qualifies all views, not justImageView
- setFontScale now works correctly on API 21+
- Add
TestActivity
to androidTest configuration of Library for testing - Update Library baseline test images to support
en_US
locale - Add tests for
Experimental PixelCopy
API - Update
DeviceIdentifierTest
to work with locale (not language) - Add tests for
TestifyFeatures
- Gradle from 4.10.2 to 6.2.1
- Android Gradle Plugin from 3.3.2 to 3.6.1
- ktlint from 0.29.0 to 0.36.0
- Compile and Target SDK from 28 to 29
- AndroidX ConstraintLayout from 2.0.0-alpha3 to 2.0.0-beta4
- AndroidX AppCompat from 1.0.0 to 1.1.0
- AndroidX Core Ktx from 1.0.1 to 1.1.0
- AndroidX Test Core from 2.0.0-rc01 to 2.1.0
- AndroidX Test Espresso from 3.1.0 to 3.2.0
- Dokka from 0.9.18 to 0.10.0
- Kotlin from 1.3.21 to 1.3.70
- Mockito2 from 2.23.0 to 2.28.2
- Travis CI now downloads and installs Android SDK 29
- Split Bintray gradle script to separate file
- Kotlin stdlib8 from stdlib7
⚠️ Breaking Change Thetestify {}
gradle extension been restructured. Testify no longer requires thetestify
extension to be defined in your project. This is particularly valuable for Android library projects as Testify can now correctly infer most settings automatically. Most settings can now be inferred. Testify now supports multiple flavor dimensions and product flavors.testContextId
has been deleted and is no longer needed.applicationIdSuffix
has been deleted. Its value can now be inferred.installTask
has been added. You can specify which task to run to install your APK. This is automatically inferred, but you may wish to override the default value.installAndroidTestTask
has been added. You can specify which task to run to install the Android Instrumentation test package. This is automatically inferred, but you may wish to override the default value. You can view the inferred extension values by running./gradlew testifySettings
- Added
verbose
logging support. Add-Pverbose=true
to your gradle commands to enable verbose logging. e.g../gradlew Sample:screenshotTest -Pverbose=true
- The device key is now based off the emulator locale, not language. (e.g.
en_US
instead of justen
) - Testify plugin no longer requires
adb root
access.screenshotPull
andscreenshotClear
can now work on any device or Google Play emulator image.
screenshotClear
will now properly delete files when running from a Windows client.- Screenshots are now copied to the correct baseline directory when captured on a landscape emulator.
- Screenshots are now copied to the correct baseline directory regardless of emulator locale.
- Testify now more accurately detects the appropriate
install
task for your project. Testify relies on this to correctly insall your APK for testing and can now infer more project types correctly. - Correctly set and get the locale language and region on API 22.
- Correctly support overridden display density.
- JVM tests now log status to console.
- Update to kotlin stdlib8 from stdlib7.
- Update compile SDK from 28 to 29
- Update target SDK from 28 to 29
- Extend MaterialComponents theme instead of AppCompat theme
- Re-record baseline using locale key
https://github.com/Shopify/android-testify/commit/3a5b617cf9a1f13e31830cfbcb009393c90e3b37
Initial public release 🎉