This repository has been archived by the owner on Nov 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 733
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement compose preview screenshot testing for module screen, updat…
…e base screenshot
- Loading branch information
1 parent
f2c3795
commit 6ba89bf
Showing
286 changed files
with
1,289 additions
and
1,000 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: Screenshots tests | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
jobs: | ||
sceenshot_test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout GIT | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Java SDK | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: 'adopt' | ||
java-version: '18' | ||
|
||
- name: Enable Gradle Wrapper caching (optimization) | ||
uses: actions/cache@v4 | ||
with: | ||
path: | | ||
~/.gradle/caches | ||
~/.gradle/wrapper | ||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | ||
restore-keys: | | ||
${{ runner.os }}-gradle- | ||
- name: Run Compose preview screenshot tests | ||
run: ./gradlew :shared:ui:testing:validateDebugScreenshotTest | ||
|
||
- name: Upload build reports | ||
uses: actions/upload-artifact@v4 | ||
if: always() | ||
with: | ||
name: my-artifact | ||
path: shared/ui/testing/build/reports |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
object BuildConfigConstants { | ||
const val IMAGE_DIFFERENCE_THRESHOLD = 0.013f | ||
} |
13 changes: 13 additions & 0 deletions
13
buildSrc/src/main/kotlin/ivy.compose.preview.testing.gradle.kts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
plugins { | ||
id("ivy.compose") | ||
/* | ||
Will refactor code for import plugin for compose preview screenshot testing | ||
when compose.screenshot has a stable version - | ||
remove android.experimental.enableScreenshotTest | ||
*/ | ||
// id("com.android.compose.screenshot") | ||
} | ||
|
||
android { | ||
experimentalProperties["android.experimental.enableScreenshotTest"] = true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+99.1 KB
...countTabPreviewTestKt/PreviewAccountsTabCompactModeDark_da39a3ee_da39a3ee_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+31.7 KB
...eviewTestKt/PreviewAccountsTabCompactModeDark_nexus_one_c37ad86f_da39a3ee_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+97.6 KB
...ountTabPreviewTestKt/PreviewAccountsTabCompactModeLight_da39a3ee_da39a3ee_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+31.1 KB
...viewTestKt/PreviewAccountsTabCompactModeLight_nexus_one_c37ad86f_da39a3ee_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+137 KB
...eference/AccountTabPreviewTestKt/PreviewAccountsTabDark_da39a3ee_da39a3ee_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+34.7 KB
...ccountTabPreviewTestKt/PreviewAccountsTabDark_nexus_one_c37ad86f_da39a3ee_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+135 KB
...ference/AccountTabPreviewTestKt/PreviewAccountsTabLight_da39a3ee_da39a3ee_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+34.3 KB
...countTabPreviewTestKt/PreviewAccountsTabLight_nexus_one_c37ad86f_da39a3ee_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
screen/accounts/src/screenshotTestDebug/kotlin/AccountTabPreviewTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
@file:Suppress("UnusedPrivateMember") | ||
|
||
import androidx.compose.runtime.Composable | ||
import com.ivy.accounts.AccountsTabUICompactModeTest | ||
import com.ivy.accounts.AccountsTabUITest | ||
import com.ivy.ui.annotation.IvyPreviews | ||
|
||
@IvyPreviews | ||
@Composable | ||
private fun PreviewAccountsTabLight() { | ||
AccountsTabUITest(dark = false) | ||
} | ||
|
||
@IvyPreviews | ||
@Composable | ||
private fun PreviewAccountsTabDark() { | ||
AccountsTabUITest(dark = true) | ||
} | ||
|
||
@IvyPreviews | ||
@Composable | ||
private fun PreviewAccountsTabCompactModeDark() { | ||
AccountsTabUICompactModeTest(dark = true) | ||
} | ||
|
||
@IvyPreviews | ||
@Composable | ||
private fun PreviewAccountsTabCompactModeLight() { | ||
AccountsTabUICompactModeTest(dark = false) | ||
} |
28 changes: 0 additions & 28 deletions
28
screen/accounts/src/test/java/com/ivy/accounts/AccountsTabPaparazziTest.kt
This file was deleted.
Oops, something went wrong.
Binary file removed
BIN
-46.2 KB
...ounts_AccountsTabPaparazziTest_snapshot accountTab compact composable[Dark].png
Binary file not shown.
Binary file removed
BIN
-45.4 KB
...unts_AccountsTabPaparazziTest_snapshot accountTab compact composable[Light].png
Binary file not shown.
Binary file removed
BIN
-67.4 KB
....ivy.accounts_AccountsTabPaparazziTest_snapshot accountTab composable[Dark].png
Binary file not shown.
Binary file removed
BIN
-66.1 KB
...ivy.accounts_AccountsTabPaparazziTest_snapshot accountTab composable[Light].png
Binary file not shown.
Binary file removed
BIN
-67.4 KB
...ts_AccountsTabPaparazziTest_snapshot accountTab nonCompact composable[Dark].png
Binary file not shown.
Binary file removed
BIN
-66.1 KB
...s_AccountsTabPaparazziTest_snapshot accountTab nonCompact composable[Light].png
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,20 @@ | ||
plugins { | ||
id("ivy.feature") | ||
id("com.android.compose.screenshot") | ||
} | ||
|
||
android { | ||
namespace = "com.ivy.attributions" | ||
testOptions { | ||
screenshotTests { | ||
imageDifferenceThreshold = BuildConfigConstants.IMAGE_DIFFERENCE_THRESHOLD | ||
} | ||
} | ||
} | ||
|
||
dependencies { | ||
implementation(projects.shared.base) | ||
implementation(projects.shared.domain) | ||
implementation(projects.shared.ui.core) | ||
implementation(projects.shared.ui.navigation) | ||
|
||
testImplementation(projects.shared.ui.testing) | ||
} |
Binary file added
BIN
+55.7 KB
...rence/AttributionScreenPreviewTestKt/AttributionsUIDark_da39a3ee_da39a3ee_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+24.5 KB
...ibutionScreenPreviewTestKt/AttributionsUIDark_nexus_one_c37ad86f_da39a3ee_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+55.4 KB
...ence/AttributionScreenPreviewTestKt/AttributionsUILight_da39a3ee_da39a3ee_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+24.4 KB
...butionScreenPreviewTestKt/AttributionsUILight_nexus_one_c37ad86f_da39a3ee_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
screen/attributions/src/screenshotTestDebug/kotlin/AttributionScreenPreviewTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
@file:Suppress("UnusedPrivateMember") | ||
|
||
import androidx.compose.runtime.Composable | ||
import com.ivy.attributions.AttributionScreenUiTest | ||
import com.ivy.ui.annotation.IvyPreviews | ||
|
||
@IvyPreviews | ||
@Composable | ||
private fun AttributionsUILight() { | ||
AttributionScreenUiTest(isDark = false) | ||
} | ||
|
||
@IvyPreviews | ||
@Composable | ||
private fun AttributionsUIDark() { | ||
AttributionScreenUiTest(isDark = true) | ||
} |
Oops, something went wrong.