StreamVault is a TV-first free IPTV player for Android TV built with Kotlin, Jetpack Compose, Room, Hilt, and Media3.
Kotlin iptv-player
test(system): stabilize presentation semantics
David Nashash35ff4f035d2f
diff --git a/feature/system/src/androidTest/java/com/streamvault/feature/system/presentation/downloads/DownloadsPresentationTest.kt b/feature/system/src/androidTest/java/com/streamvault/feature/system/presentation/downloads/DownloadsPresentationTest.ktindex 5aa3661a..15daaf7a 100644--- a/feature/system/src/androidTest/java/com/streamvault/feature/system/presentation/downloads/DownloadsPresentationTest.kt+++ b/feature/system/src/androidTest/java/com/streamvault/feature/system/presentation/downloads/DownloadsPresentationTest.kt@@ -82,7 +82,7 @@ class DownloadsPresentationTest {composeRule.onNodeWithText("50%").assertIsDisplayed()composeRule.onNodeWithText("Failed").assertIsDisplayed()composeRule.onNodeWithText("Resume").performClick()- composeRule.onNodeWithText("Delete").performClick()+ composeRule.onAllNodesWithText("Delete")[1].performClick()assertThat(resumedId).isEqualTo("failed")assertThat(deletedId).isEqualTo("failed")diff --git a/feature/system/src/androidTest/java/com/streamvault/feature/system/presentation/plugins/PluginsPresentationTest.kt b/feature/system/src/androidTest/java/com/streamvault/feature/system/presentation/plugins/PluginsPresentationTest.ktindex 34841390..638305fb 100644--- a/feature/system/src/androidTest/java/com/streamvault/feature/system/presentation/plugins/PluginsPresentationTest.kt+++ b/feature/system/src/androidTest/java/com/streamvault/feature/system/presentation/plugins/PluginsPresentationTest.kt@@ -4,8 +4,11 @@ import androidx.compose.foundation.layout.Columnimport androidx.compose.foundation.layout.fillMaxSizeimport androidx.compose.ui.test.assertIsDisplayedimport androidx.compose.ui.test.junit4.createComposeRule+import androidx.compose.ui.test.hasClickAction+import androidx.compose.ui.test.hasTextimport androidx.compose.ui.test.onNodeWithText-import androidx.compose.ui.test.performClick+import androidx.compose.ui.test.performSemanticsAction+import androidx.compose.ui.semantics.SemanticsActionsimport androidx.test.ext.junit.runners.AndroidJUnit4import com.google.common.truth.Truth.assertThatimport com.streamvault.core.ui.theme.StreamVaultTheme@@ -50,9 +53,12 @@ class PluginsPresentationTest {composeRule.onNodeWithText("No compatible StreamVault plugins are installed.").assertIsDisplayed()- composeRule.onNodeWithText("Install URL").performClick()- composeRule.onNodeWithText("Install file").performClick()- composeRule.onNodeWithText("Refresh").performClick()+ composeRule.onNode(hasText("Install URL") and hasClickAction())+ .performSemanticsAction(SemanticsActions.OnClick)+ composeRule.onNode(hasText("Install file") and hasClickAction())+ .performSemanticsAction(SemanticsActions.OnClick)+ composeRule.onNode(hasText("Refresh") and hasClickAction())+ .performSemanticsAction(SemanticsActions.OnClick)assertThat(installUrlClicks).isEqualTo(1)assertThat(installFileClicks).isEqualTo(1)@@ -84,7 +90,8 @@ class PluginsPresentationTest {composeRule.onNodeWithText("Example plugin").assertIsDisplayed()composeRule.onNodeWithText("Disabled").assertIsDisplayed()- composeRule.onNodeWithText("Configure").performClick()+ composeRule.onNode(hasText("Configure") and hasClickAction())+ .performSemanticsAction(SemanticsActions.OnClick)assertThat(configured).isTrue()assertThat(enabled).isNull()@@ -123,7 +130,7 @@ class PluginsPresentationTest {put("server", "")put("enabled", false)},- draftValues = mapOf("server" to "", "enabled" to "false"),+ draftValues = mapOf("server" to "", "enabled" to "true"),validationErrors = mapOf("server" to "Server is required"),)@@ -146,7 +153,8 @@ class PluginsPresentationTest {.assertIsDisplayed()composeRule.onNodeWithText("Server is required").assertIsDisplayed()composeRule.onNodeWithText("Enabled").assertIsDisplayed()- composeRule.onNodeWithText("Save").performClick()+ composeRule.onNode(hasText("Save") and hasClickAction())+ .performSemanticsAction(SemanticsActions.OnClick)assertThat(saves).isEqualTo(1)}diff --git a/feature/system/src/androidTest/java/com/streamvault/feature/system/presentation/welcome/WelcomePresentationTest.kt b/feature/system/src/androidTest/java/com/streamvault/feature/system/presentation/welcome/WelcomePresentationTest.ktindex 6335b872..284c6769 100644--- a/feature/system/src/androidTest/java/com/streamvault/feature/system/presentation/welcome/WelcomePresentationTest.kt+++ b/feature/system/src/androidTest/java/com/streamvault/feature/system/presentation/welcome/WelcomePresentationTest.kt@@ -1,9 +1,13 @@package com.streamvault.feature.system.presentation.welcomeimport androidx.compose.ui.test.assertIsDisplayed+import androidx.compose.ui.test.hasClickAction+import androidx.compose.ui.test.hasTextimport androidx.compose.ui.test.junit4.createComposeRuleimport androidx.compose.ui.test.onNodeWithTextimport androidx.compose.ui.test.performClick+import androidx.compose.ui.test.performSemanticsAction+import androidx.compose.ui.semantics.SemanticsActionsimport androidx.test.ext.junit.runners.AndroidJUnit4import com.google.common.truth.Truth.assertThatimport com.streamvault.core.ui.theme.StreamVaultTheme@@ -34,11 +38,17 @@ class WelcomePresentationTest {}}- composeRule.onNodeWithText("Setup Provider").assertIsDisplayed().performClick()- composeRule.onNodeWithText("Set up later").assertIsDisplayed().performClick()+ composeRule.onNode(hasText("Setup Provider") and hasClickAction())+ .performSemanticsAction(SemanticsActions.OnClick)+ composeRule.runOnIdle {+ assertThat(setupClicks).isEqualTo(1)+ }+ composeRule.onNode(hasText("Set up later") and hasClickAction())+ .performSemanticsAction(SemanticsActions.OnClick)- assertThat(setupClicks).isEqualTo(1)- assertThat(homeClicks).isEqualTo(1)+ composeRule.runOnIdle {+ assertThat(homeClicks).isEqualTo(1)+ }}@Test