Skip to content

Commit 9d62a12

Browse files
committed
refactor: Stabilize and multiplatform UI tests
This commit refactors the UI testing infrastructure to improve stability and enable multiplatform testing. It introduces a new `ui:test` module for common UI test logic and stabilizes tests by using idling resources. ### Key Changes - **New `ui:test` Module** - A new Gradle module, `ui:test`, has been created to house multiplatform UI tests. - Existing UI test cases (`CrudTestCase`, `SettingPasswordTestCase`, etc.) and screen objects have been moved from `ui/test-jvm` to `ui:test/src/commonMain` to enable them to run on all platforms (Android, iOS, Desktop, and Web). - `ui:test-jvm` now contains only JVM-specific utilities, such as the bridge between `ComposeContentTestRule` and the multiplatform `ComposeUiTest`. - **UI Test Stabilization with Idling Resources** - Introduced `CountingIdlingRes`, a new utility in `core/domain` to track the state of long-running asynchronous operations in ViewModels. - ViewModels now increment/decrement this counter during operations like database access or encryption changes. - A `ComposeCountingIdlingResource` has been added to `ui/test-jvm` to integrate with the Compose test framework, making tests wait for async operations to complete, thus preventing flakiness. - **Test Tagging and Navigation** - Added explicit test tags to UI components in security dialogs (`EnterPasswordDialog`, `ConfirmPasswordDialog`, `ChangePasswordDialog`) and the `SignInScreen` for more reliable test node selection. - Improved the `RouterImpl` by setting `launchSingleTop = true` for all navigation actions to prevent duplicate screen instances. - Added abstract navigation tests (`AbstractNavigationTest`) for Android and Desktop to verify router behavior. - **Dependency and Version Updates** - Upgraded Kotlin to version `2.3.0` and updated various other dependencies like `androidx.activityCompose` and `androidx.paging`. - Bumped the application version to `8.4.9` for Android, iOS, and Desktop. - Added a `CHANGELOG.md` file to document project changes. - **Minor Refinements** - Removed the `android_ui_test_job` dependency on `build_job` in the GitHub Actions workflow. - Cleaned up and improved formatting in `.podspec` files. - Added a "Save" string resource used in password dialogs.
1 parent e10ad80 commit 9d62a12

File tree

96 files changed

+2823
-1080
lines changed

Some content is hidden

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

96 files changed

+2823
-1080
lines changed

.github/workflows/kmp.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ jobs:
5050
5151
android_ui_test_job:
5252
name: Android UI-tests on emulator
53-
needs: build_job
5453
runs-on: ubuntu-latest
5554
continue-on-error: true
5655
strategy:

AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
### Project Structure & Module Organization
1111
- Core: `core/domain`, `core/presentation`, `core/data/db-sqldelight` (default), `core/data/db-room` (optional), `core/test`.
12-
- UI: `ui/shared` (common Compose code and resources), `ui/test-jvm` (JVM Compose UI test utilities).
12+
- UI: `ui/shared` (common Compose code and resources), `ui/test` (multiplatform Compose UI tests), `ui/test-jvm` (JVM-specific UI test utilities).
1313
- Apps: `app/android`, `app/desktop`, `app/web`, `app/ios-kit` (CocoaPods framework), `app/iosApp` (Xcode project).
1414
- Tooling: `build-logic` (Gradle conventions), `thirdparty` (vendored modules), `gradle/libs.versions.toml` (versions).
1515
- Switch DB module via `gradle.properties` key `CORE_DATA_DB_MODULE`.

0 commit comments

Comments
 (0)