Skip to main content
Version: 2.0.0-alpha01

Migrate to Testify 2.0

dev.testify replaces the original classes in the com.shopify.testify namespace. Only the package and Maven artifact names changed; class, method, and field names did not change.

Prerequisites

Before you migrate, bring your app up to date. We recommend updating your project to use the final version of the Shopify plugin: version 1.2.0-alpha01. Testify 2.0 is based off of this version.

tip

We recommend working in a separate branch when migrating. Also try to avoid refactoring your code while performing the migration.

  1. Create a new working git branch for your project.

    ex. git checkout -b upgrade-to-testify-2.0

  2. In your build.gradle, ensure you are currently using the 1.2.0-alpha01 version of Testify. Check that the classpath entry for Testify is set to com.shopify.testify:plugin:1.2.0-alpha01. If not, update to version 1.2.0-alpha01, resync your gralde project, and fix any build errors in your project.

  3. Update to Testify 2.0.0-alpha01. In your root build.gradle file, change the classpath entry for Testify to dev.testify:plugin:2.0.0-alpha01. Resync your gradle configuration.

  4. Perform a global find & replace in your entire project. Replace all instances of com.shopify.testify with dev.testify.

  5. Build your project and run your tests.

Once these steps are complete, you can commit your changes to your working branch, have your changes reviewed, and merge them to your main development branch.

Mappings

Artifact Mappings

The following table lists the current mappings from old Shopify library artifacts to dev.testify.

Old build artifactTestify 2.0 build artifact
com.shopify.testify:plugindev.testify:plugin
com.shopify.testify:testifydev.testify:testify
com.shopify.testify:testify-composedev.testify:testify-compose

Class Mappings

The following table lists the current mappings from the old Shopify library packages to the new dev.testify packages.

Old Shopify classNew class
com.shopify.testify.ComposableScreenshotRuledev.testify.ComposableScreenshotRule
com.shopify.testify.ComposableTestActivitydev.testify.ComposableTestActivity
com.shopify.testify.internal.DeviceStringFormatterdev.testify.internal.DeviceStringFormatter
com.shopify.testify.internal.exception.ActivityMustImplementResourceOverrideExceptiondev.testify.internal.exception.ActivityMustImplementResourceOverrideException
com.shopify.testify.internal.exception.ActivityNotRegisteredExceptiondev.testify.internal.exception.ActivityNotRegisteredException
com.shopify.testify.internal.exception.AssertSameMustBeLastExceptiondev.testify.internal.exception.AssertSameMustBeLastException
com.shopify.testify.internal.exception.MissingAssertSameExceptiondev.testify.internal.exception.MissingAssertSameException
com.shopify.testify.internal.exception.MissingScreenshotInstrumentationAnnotationExceptiondev.testify.internal.exception.MissingScreenshotInstrumentationAnnotationException
com.shopify.testify.internal.exception.NoScreenshotsOnUiThreadExceptiondev.testify.internal.exception.NoScreenshotsOnUiThreadException
com.shopify.testify.internal.exception.RootViewNotFoundExceptiondev.testify.internal.exception.RootViewNotFoundException
com.shopify.testify.internal.exception.ScreenshotBaselineNotDefinedExceptiondev.testify.internal.exception.ScreenshotBaselineNotDefinedException
com.shopify.testify.internal.exception.ScreenshotDirectoryNotFoundExceptiondev.testify.internal.exception.ScreenshotDirectoryNotFoundException
com.shopify.testify.internal.exception.ScreenshotIsDifferentExceptiondev.testify.internal.exception.ScreenshotIsDifferentException
com.shopify.testify.internal.exception.TestMustLaunchActivityExceptiondev.testify.internal.exception.TestMustLaunchActivityException
com.shopify.testify.internal.exception.TestMustWrapContextExceptiondev.testify.internal.exception.TestMustWrapContextException
com.shopify.testify.internal.exception.UnexpectedOrientationExceptiondev.testify.internal.exception.UnexpectedOrientationException
com.shopify.testify.internal.exception.ViewModificationExceptiondev.testify.internal.exception.ViewModificationException
com.shopify.testify.internal.helpers.WrappedFontScaledev.testify.internal.helpers.WrappedFontScale
com.shopify.testify.internal.helpers.WrappedLocaledev.testify.internal.helpers.WrappedLocale
com.shopify.testify.internal.modification.HideCursorViewModificationdev.testify.internal.modification.HideCursorViewModification
com.shopify.testify.internal.modification.HidePasswordViewModificationdev.testify.internal.modification.HidePasswordViewModification
com.shopify.testify.internal.modification.HideScrollbarsViewModificationdev.testify.internal.modification.HideScrollbarsViewModification
com.shopify.testify.internal.modification.HideTextSuggestionsViewModificationdev.testify.internal.modification.HideTextSuggestionsViewModification
com.shopify.testify.internal.modification.ReplacementCharSequencedev.testify.internal.modification.ReplacementCharSequence
com.shopify.testify.internal.modification.SoftwareRenderViewModificationdev.testify.internal.modification.SoftwareRenderViewModification
com.shopify.testify.internal.modification.ViewModificationdev.testify.internal.modification.ViewModification
com.shopify.testify.internal.processor.compare.SameAsComparedev.testify.internal.processor.compare.SameAsCompare
com.shopify.testify.internal.processor.diff.HighContrastDiffdev.testify.internal.processor.diff.HighContrastDiff
com.shopify.testify.internal.processor.ParallelPixelProcessordev.testify.internal.processor.ParallelPixelProcessor
com.shopify.testify.internal.processor.ParallelPixelProcessor.TransformResultdev.testify.internal.processor.ParallelPixelProcessor.TransformResult
com.shopify.testify.ScreenshotRuledev.testify.ScreenshotRule
com.shopify.testify.ScreenshotUtilitydev.testify.ScreenshotUtility
com.shopify.testify.TestActivitydev.testify.TestActivity

Annotation Mappings

The following table lists the current mappings from the old Shopify library packages to the new dev.testify packages.

Old Shopify annotationNew annotation
com.shopify.testify.annotation.BitmapComparisonExactnessdev.testify.annotation.BitmapComparisonExactness
com.shopify.testify.annotation.ScreenshotInstrumentationdev.testify.annotation.ScreenshotInstrumentation
com.shopify.testify.annotation.TestifyLayoutdev.testify.annotation.TestifyLayout

Enum Mappings

The following table lists the current mappings from the old Shopify library packages to the new dev.testify packages.

Old Shopify enumNew enum
com.shopify.testify.report.ErrorCausedev.testify.report.ErrorCause
com.shopify.testify.report.ErrorCause.ACTIVITY_OVERRIDEdev.testify.report.ErrorCause.ACTIVITY_OVERRIDE
com.shopify.testify.report.ErrorCause.ASSERT_LASTdev.testify.report.ErrorCause.ASSERT_LAST
com.shopify.testify.report.ErrorCause.DIFFERENTdev.testify.report.ErrorCause.DIFFERENT
com.shopify.testify.report.ErrorCause.LAUNCH_ACTIVITYdev.testify.report.ErrorCause.LAUNCH_ACTIVITY
com.shopify.testify.report.ErrorCause.NO_ACTIVITYdev.testify.report.ErrorCause.NO_ACTIVITY
com.shopify.testify.report.ErrorCause.NO_ANNOTATIONdev.testify.report.ErrorCause.NO_ANNOTATION
com.shopify.testify.report.ErrorCause.NO_ASSERTdev.testify.report.ErrorCause.NO_ASSERT
com.shopify.testify.report.ErrorCause.NO_BASELINEdev.testify.report.ErrorCause.NO_BASELINE
com.shopify.testify.report.ErrorCause.NO_DIRECTORYdev.testify.report.ErrorCause.NO_DIRECTORY
com.shopify.testify.report.ErrorCause.NO_ROOT_VIEWdev.testify.report.ErrorCause.NO_ROOT_VIEW
com.shopify.testify.report.ErrorCause.UI_THREADdev.testify.report.ErrorCause.UI_THREAD
com.shopify.testify.report.ErrorCause.UNEXPECTED_ORIENTATIONdev.testify.report.ErrorCause.UNEXPECTED_ORIENTATION
com.shopify.testify.report.ErrorCause.UNKNOWNdev.testify.report.ErrorCause.UNKNOWN
com.shopify.testify.report.ErrorCause.VIEW_MODIFICATIONdev.testify.report.ErrorCause.VIEW_MODIFICATION
com.shopify.testify.report.ErrorCause.WRAP_CONTEXTdev.testify.report.ErrorCause.WRAP_CONTEXT
com.shopify.testify.report.TestStatusdev.testify.report.TestStatus
com.shopify.testify.report.TestStatus.FAILdev.testify.report.TestStatus.FAIL
com.shopify.testify.report.TestStatus.PASSdev.testify.report.TestStatus.PASS
com.shopify.testify.TestifyFeaturesdev.testify.TestifyFeatures
com.shopify.testify.TestifyFeatures.CanvasCapturedev.testify.TestifyFeatures.CanvasCapture
com.shopify.testify.TestifyFeatures.GenerateDiffsdev.testify.TestifyFeatures.GenerateDiffs
com.shopify.testify.TestifyFeatures.Localedev.testify.TestifyFeatures.Locale
com.shopify.testify.TestifyFeatures.PixelCopyCapturedev.testify.TestifyFeatures.PixelCopyCapture
com.shopify.testify.TestifyFeatures.Reporterdev.testify.TestifyFeatures.Reporter

Function Mappings

The following table lists the current mappings from the old Shopify library packages to the new dev.testify packages.

Old Shopify top-level functionNew top-level function
com.shopify.testify.internal.disposeCompositiondev.testify.internal.disposeComposition
com.shopify.testify.internal.processor.capture.createBitmapFromCanvasdev.testify.internal.processor.capture.createBitmapFromCanvas
com.shopify.testify.internal.processor.capture.createBitmapFromDrawingCachedev.testify.internal.processor.capture.createBitmapFromDrawingCache
com.shopify.testify.internal.processor.capture.createBitmapUsingPixelCopydev.testify.internal.processor.capture.createBitmapUsingPixelCopy
com.shopify.testify.internal.processor.compare.colorspace.calculateDeltaEdev.testify.internal.processor.compare.colorspace.calculateDeltaE
com.shopify.testify.internal.processor.createBitmapdev.testify.internal.processor.createBitmap