Skip to content

Commit 40d3e57

Browse files
authored
Merge pull request #266 from ndtp/2025-08-updates
Testify 4.0.0 - Major dependency updates
2 parents 16017b6 + 229a8b7 commit 40d3e57

File tree

104 files changed

+569
-334
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

104 files changed

+569
-334
lines changed

.editorconfig

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
[*.{kt,kts}]
2-
disabled_rules=import-ordering
2+
ktlint_standard_trailing-comma-on-call-site = disabled
3+
ktlint_standard_trailing-comma-on-declaration-site = disabled
34
indent_size=4
45
insert_final_newline=true
56
max_line_length=120
67
trim_trailing_whitespace=true
78
end_of_line=lf
89
ij_kotlin_name_count_to_use_star_import = 2147483647
910
ij_kotlin_name_count_to_use_star_import_for_members = 2147483647
11+

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
## 4.0.0
2+
3+
- https://github.com/ndtp/android-testify/pull/266 Updated to Kotlin 2.2
4+
- https://github.com/ndtp/android-testify/pull/266 Major version updates to all core dependencies. This will require the following changes to your projects:
5+
- Compose 2025.08.01 updates require:
6+
- kotlinCompilerExtensionVersion --> 1.9.0
7+
- androidx.compose.material:material --> 1.9.0
8+
- androidx.compose.ui:ui-tooling-preview -> 1.9.0
9+
- androidx.compose.ui:ui --> 1.9.0
10+
- Java 21 requires you to update your app to use Java 21
11+
- Compile 35+ requires you to target 35+
12+
- Minimum SDK raised to 26
13+
14+
---
15+
116
# Testify Change Log
217

318
## 3.2.3

Ext/Accessibility/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ For more information about _Accessibility Checking_, please see https://develope
1818

1919
```groovy
2020
plugins {
21-
id("dev.testify") version "3.2.3" apply false
21+
id("dev.testify") version "4.0.0" apply false
2222
}
2323
```
2424

@@ -29,7 +29,7 @@ Ensure that `mavenCentral()` is available to both `pluginManagement` and `depend
2929
**Application build.gradle**
3030
```groovy
3131
dependencies {
32-
androidTestImplementation "dev.testify:testify-accessibility:3.2.3"
32+
androidTestImplementation "dev.testify:testify-accessibility:4.0.0"
3333
}
3434
```
3535

Ext/Accessibility/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ plugins {
22
id 'com.android.library'
33
id 'kotlin-android'
44
id 'org.jetbrains.dokka'
5+
id 'maven-publish'
6+
id 'signing'
57
}
68

79
ext {
@@ -92,5 +94,3 @@ android {
9294
afterEvaluate {
9395
apply from: "../../publish.build.gradle"
9496
}
95-
96-
apply from: '../../ktlint.gradle'

Ext/Accessibility/src/main/java/dev/testify/accessibility/internal/CheckResults.kt

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,18 @@ internal class CheckResults(other: List<CheckResult>) : ArrayList<CheckResult>(o
5656
return if (this.any { it.type == type }) " * $type:\n${this.prettyPrint(type)}" else ""
5757
}
5858

59-
private fun List<CheckResult>.prettyPrint(filter: String): String {
60-
return if (this.isEmpty())
61-
" * - [NONE]"
62-
else
63-
filter { it.type == filter }.joinToString(separator = "\n * -", prefix = " * -") {
64-
"${it.check}: [${it.elementClass}/${it.resourceName}] - ${it.message}"
65-
}
66-
}
59+
private fun List<CheckResult>.prettyPrint(filter: String) =
60+
prettyPrintEmpty().takeIf { isEmpty() } ?: prettyPrintNotEmpty(filter)
61+
62+
private fun prettyPrintEmpty() = " * - [NONE]"
63+
64+
private fun List<CheckResult>.prettyPrintNotEmpty(filter: String) = filter { it.type == filter }
65+
.joinToString(
66+
separator = "\n * -",
67+
prefix = " * -"
68+
) {
69+
"${it.check}: [${it.elementClass}/${it.resourceName}] - ${it.message}"
70+
}
6771

6872
companion object {
6973
fun fromJson(json: Reader): CheckResults {

Ext/Compose/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Easily create screenshot tests for `@Composable` functions.
1212

1313
```groovy
1414
plugins {
15-
id("dev.testify") version "3.2.3" apply false
15+
id("dev.testify") version "4.0.0" apply false
1616
}
1717
```
1818

@@ -24,7 +24,7 @@ Ensure that `mavenCentral()` is available to both `pluginManagement` and `depend
2424
**Application build.gradle**
2525
```groovy
2626
dependencies {
27-
androidTestImplementation "dev.testify:testify-compose:3.2.3"
27+
androidTestImplementation "dev.testify:testify-compose:4.0.0"
2828
androidTestImplementation "androidx.test:rules:1.5.0"
2929
androidTestImplementation "androidx.compose.ui:ui-test-junit4:1.4.3"
3030
}

Ext/Compose/build.gradle

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
1+
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
2+
13
plugins {
24
id 'com.android.library'
35
id 'kotlin-android'
46
id 'org.jetbrains.dokka'
7+
id 'maven-publish'
8+
id 'signing'
9+
alias(libs.plugins.compose.compiler)
510
}
611

712
ext {
@@ -66,15 +71,16 @@ android {
6671
compose true
6772
}
6873

69-
kotlinOptions {
70-
jvmTarget = '17'
74+
kotlin {
75+
compilerOptions {
76+
allWarningsAsErrors.set(true)
77+
jvmTarget.set(JvmTarget.JVM_21)
78+
freeCompilerArgs.addAll("-Xcontext-parameters")
79+
}
7180
}
7281
compileOptions {
73-
sourceCompatibility JavaVersion.VERSION_17
74-
targetCompatibility JavaVersion.VERSION_17
75-
}
76-
composeOptions {
77-
kotlinCompilerExtensionVersion "1.5.14"
82+
sourceCompatibility JavaVersion.VERSION_21
83+
targetCompatibility JavaVersion.VERSION_21
7884
}
7985

8086
dependencies {
@@ -106,5 +112,3 @@ android {
106112
afterEvaluate {
107113
apply from: "../../publish.build.gradle"
108114
}
109-
110-
apply from: '../../ktlint.gradle'

Ext/Compose/src/main/java/dev/testify/ComposableScreenshotRule.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,11 +185,12 @@ open class ComposableScreenshotRule(
185185
*/
186186
override fun beforeScreenshot(activity: Activity) {
187187
val targetView = activity.findRootView(rootViewId).getChildAt(0)
188-
if (targetView.width == 0 && targetView.height == 0)
188+
if (targetView.width == 0 && targetView.height == 0) {
189189
throw IllegalStateException(
190190
"Target view has 0 size. " +
191191
"Verify if you have provided a ComposeTestRule instance to ComposableScreenshotRule."
192192
)
193+
}
193194

194195
super.beforeScreenshot(activity)
195196
}

Ext/Compose/src/main/java/dev/testify/compose/exception/ComposeContainerNotFoundException.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* The MIT License (MIT)
33
*
44
* Copyright (c) 2024 ndtp
5-
*
5+
*
66
* Permission is hereby granted, free of charge, to any person obtaining a copy
77
* of this software and associated documentation files (the "Software"), to deal
88
* in the Software without restriction, including without limitation the rights

Ext/Compose/src/main/java/dev/testify/compose/scenario/ComposableScreenshotScenarioRule.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* The MIT License (MIT)
33
*
44
* Copyright (c) 2024 ndtp
5-
*
5+
*
66
* Permission is hereby granted, free of charge, to any person obtaining a copy
77
* of this software and associated documentation files (the "Software"), to deal
88
* in the Software without restriction, including without limitation the rights
@@ -206,12 +206,12 @@ open class ComposableScreenshotScenarioRule(
206206
*/
207207
override fun beforeScreenshot(activity: Activity) {
208208
val targetView = activity.findRootView(rootViewId).getChildAt(0)
209-
if (targetView.width == 0 && targetView.height == 0)
209+
if (targetView.width == 0 && targetView.height == 0) {
210210
throw IllegalStateException(
211-
"Target view has 0 size. " +
211+
"Target view has 0 size." +
212212
"Verify if you have provided a ComposeTestRule instance to ComposableScreenshotRule."
213213
)
214-
214+
}
215215
super.beforeScreenshot(activity)
216216
}
217217

0 commit comments

Comments
 (0)