Successfully overwrote file: /home/Messier82/projects/service-book/app/src/androidTest/java/com/yorvana/regression/vault/VaultRealOsRegressionTest.kt. Here is the updated code: ... import androidx.compose.ui.test.performClick import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.platform.app.InstrumentationRegistry import androidx.test.uiautomator.UiDevice import com.google.common.truth.Truth.assertThat import com.yorvana.MainActivity import com.yorvana.R import com.yorvana.testsupport.SystemPicker import com.yorvana.testsupport.VaultFixture import com.yorvana.testsupport.awaitText import com.yorvana.testsupport.installVaultFixture import com.yorvana.testsupport.killAndRelaunch import com.yorvana.testsupport.resetYorvanaState import com.yorvana.testsupport.tiers.RegressionFull import com.yorvana.ui.TestTags import org.junit.After import org.junit.Before import org.junit.Rule import org.junit.Test import org.junit.runner.RunWith ... private val device = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation()) @Before fun setUp() { composeRule.resetYorvanaState() } @After fun tearDown() { composeRule.resetYorvanaState() } @Test fun rD01_freshSetup_realSafFolderPicker_completesSetup() { val folderName = "Yorvana R-D01 ${System.currentTimeMillis()}" composeRule.onNodeWithText(composeRule.activity.getString(R.string.setup_pick_folder)).performClick() com.yorvana.testsupport.SystemPicker .createAndPickFolder(device, folderName) composeRule.awaitText(composeRule.activity.getString(R.string.setup_complete)) composeRule.onNodeWithText(composeRule.activity.getString(R.string.setup_complete)).performClick() composeRule.awaitText(composeRule.activity.getString(R.string.my_garage), timeoutMillis = 30_000) } @Test fun rD02_preExistingVaultFixture_loadsVehicles() { val vault = VaultFixture.createLocal("r-d02-${System.currentTimeMillis()}") ... } @Test fun rD03_revokedVaultPermission_doesNotCrashList() { val vault = VaultFixture.createLocal("r-d03-${System.currentTimeMillis()}") vault.seedSampleVault(vehicleName = "Revoked Car") composeRule.installVaultFixture(vault) if (vault.uri.scheme != "file") { composeRule.activity.contentResolver.releasePersistableUriPermission( vault.uri, android.content.Intent.FLAG_GRANT_READ_URI_PERMISSION or android.content.Intent.FLAG_GRANT_WRITE_URI_PERMISSION, ) } composeRule.killAndRelaunch() composeRule.awaitText(composeRule.activity.getString(R.string.my_garage), timeoutMillis = 40_000) } @Test fun rD04_malformedVehicleJson_skipsVehicleWithoutCrashingList() { val vault = VaultFixture.createLocal("r-d04-${System.currentTimeMillis()}") vault.seedSampleVault(vehicleName = "Good Car", vehicleId = "good-id") vault.writeMalformedVehicle("bad-id") composeRule.installVaultFixture(vault) composeRule.awaitText("Good Car", timeoutMillis = 40_000) } @Test fun rS02_movePath_copiesBytesDeletesSourceAndReopensNewVault() { val source = VaultFixture.createLocal("r-s02-source-${System.currentTimeMillis()}") ... pickNewVaultFromSettings("Yorvana R-S02 Move ${System.currentTimeMillis()}") composeRule.onNodeWithTag(TestTags.SETTINGS_VAULT_MOVE_ACTION).performClick() composeRule.onNodeWithTag(TestTags.SETTINGS_VAULT_MOVE_PROGRESS).assertExists() composeRule.awaitText(composeRule.activity.getString(R.string.settings_vault_changed_success), substring = true) composeRule.onNodeWithText(composeRule.activity.getString(R.string.action_ok)).performClick() val destination = VaultFixture.active() destination.assertSnapshotEquals(sourceSnapshot) assertThat(source.isEmpty()).isTrue() composeRule.killAndRelaunch() ... val sourceSnapshot = source.snapshot() composeRule.installVaultFixture(source) pickNewVaultFromSettings("Yorvana R-S02 Fresh ${System.currentTimeMillis()}") composeRule.onNodeWithTag(TestTags.SETTINGS_VAULT_FRESH_ACTION).performClick() composeRule.awaitText(composeRule.activity.getString(R.string.settings_vault_changed_success), substring = true) composeRule.onNodeWithText(composeRule.activity.getString(R.string.action_ok)).performClick() source.assertSnapshotEquals(sourceSnapshot) assertThat(VaultFixture.active().isEmpty()).isTrue() composeRule.killAndRelaunch() } @Test fun rS02_abortAfterCopyStarts_keepsSourceAndPointerUnchanged() { val source = VaultFixture.createLocal("r-s02-abort-source-${System.currentTimeMillis()}") source.seedSampleVault(vehicleName = "Abort Source Car") val sourceSnapshot = source.snapshot() composeRule.installVaultFixture(source) val folderName = "Yorvana R-S02 Abort ${System.currentTimeMillis()}" openVaultSettings() composeRule.onNodeWithTag(TestTags.SETTINGS_VAULT_CHANGE_BUTTON).performClick() com.yorvana.testsupport.SystemPicker .createAndPickFolder(device, folderName) composeRule.awaitText(composeRule.activity.getString(R.string.settings_vault_move_title), timeoutMillis = 40_000) device.pressBack() source.assertSnapshotEquals(sourceSnapshot) assertThat(VaultFixture.active().uri).isEqualTo(source.uri) } private fun openVaultSettings() { composeRule.onNodeWithTag(TestTags.SETTINGS_BUTTON).performClick() composeRule.awaitText(composeRule.activity.getString(R.string.settings_title)) } private fun pickNewVaultFromSettings(folderName: String) { openVaultSettings() composeRule.onNodeWithTag(TestTags.SETTINGS_VAULT_CHANGE_BUTTON).performClick() com.yorvana.testsupport.SystemPicker .createAndPickFolder(device, folderName) composeRule.awaitText(composeRule.activity.getString(R.string.settings_vault_move_title), timeoutMillis = 40_000) } ...