diff --git a/YChartsLib/src/androidTest/java/co/yml/charts/barchart/StackedBarChartTest.kt b/YChartsLib/src/androidTest/java/co/yml/charts/barchart/StackedBarChartTest.kt index 1bda15c1..a26a9e99 100644 --- a/YChartsLib/src/androidTest/java/co/yml/charts/barchart/StackedBarChartTest.kt +++ b/YChartsLib/src/androidTest/java/co/yml/charts/barchart/StackedBarChartTest.kt @@ -4,9 +4,8 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color import androidx.compose.ui.test.assertCountEquals import androidx.compose.ui.test.assertIsDisplayed -import androidx.compose.ui.test.hasAnyChild -import androidx.compose.ui.test.hasClickAction import androidx.compose.ui.test.junit4.createComposeRule +import androidx.compose.ui.test.onAllNodesWithTag import androidx.compose.ui.test.onChildren import androidx.compose.ui.test.onFirst import androidx.compose.ui.test.onNodeWithTag @@ -130,9 +129,7 @@ class StackedBarChartTest { @Test fun assertIfStackedBarClicked() { startStackedBarChart() - - composeTestRule.onNode(hasAnyChild(hasClickAction()), useUnmergedTree = true) - .onChildren() + composeTestRule.onAllNodesWithTag("chart_canvas", useUnmergedTree = true) .onFirst() .performClick() } diff --git a/YChartsLib/src/androidTest/java/co/yml/charts/wavechart/WaveChartTest.kt b/YChartsLib/src/androidTest/java/co/yml/charts/wavechart/WaveChartTest.kt index dee190c9..bf5411f1 100644 --- a/YChartsLib/src/androidTest/java/co/yml/charts/wavechart/WaveChartTest.kt +++ b/YChartsLib/src/androidTest/java/co/yml/charts/wavechart/WaveChartTest.kt @@ -7,6 +7,8 @@ import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.drawscope.Stroke import androidx.compose.ui.test.assertIsDisplayed import androidx.compose.ui.test.junit4.createComposeRule +import androidx.compose.ui.test.onAllNodesWithTag +import androidx.compose.ui.test.onFirst import androidx.compose.ui.test.onNodeWithTag import androidx.compose.ui.unit.dp import co.yml.charts.axis.AxisData @@ -102,7 +104,9 @@ class WaveChartTest { composeTestRule.setContent { WaveChart(modifier = Modifier, waveChartData = data) } - composeTestRule.onNodeWithTag("scrollable_container").assertIsDisplayed() + composeTestRule.onAllNodesWithTag(testTag = "scrollable_container", useUnmergedTree = true) + .onFirst() + .assertIsDisplayed() } @Test