Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable scroll to end screenshot tests #2451

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,12 @@ import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.test.hasScrollToNodeAction
import androidx.compose.ui.test.performTouchInput
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.dp
import androidx.test.espresso.action.ViewActions.swipeUp
import androidx.wear.compose.material.ChipDefaults
import androidx.wear.compose.material.Icon
import androidx.wear.compose.material.MaterialTheme
Expand Down Expand Up @@ -105,11 +108,10 @@ class SectionedListTest : WearLegacyScreenTest() {
}
}

// TODO https://github.com/google/horologist/issues/2237
// composeRule.onNode(hasScrollToNodeAction())
// .performTouchInput { repeat(10) { swipeUp() } }
//
// captureScreenshot()
composeRule.onNode(hasScrollToNodeAction())
.performTouchInput { repeat(10) { swipeUp() } }

captureScreenshot()
}

@Test
Expand Down Expand Up @@ -151,11 +153,10 @@ class SectionedListTest : WearLegacyScreenTest() {
}
}

// TODO https://github.com/google/horologist/issues/2237
// composeRule.onNode(hasScrollToNodeAction())
// .performTouchInput { repeat(10) { swipeUp() } }
//
// captureScreenshot()
composeRule.onNode(hasScrollToNodeAction())
.performTouchInput { repeat(10) { swipeUp() } }

captureScreenshot()
}

@Test
Expand Down
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Damn, not working currently.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion datalayer/watch/api/current.api
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ package com.google.android.horologist.datalayer.watch {
method public suspend Object? markSetupNoLongerComplete(kotlin.coroutines.Continuation<? super kotlin.Unit>);
method @Deprecated public suspend Object? markTileAsInstalled(String tileName, kotlin.coroutines.Continuation<? super kotlin.Unit>);
method @Deprecated public suspend Object? markTileAsRemoved(String tileName, kotlin.coroutines.Continuation<? super kotlin.Unit>);
method @CheckResult public suspend Object? startCompanion(String nodeId, kotlin.coroutines.Continuation<? super error.NonExistentClass>);
method @CheckResult public suspend Object? startCompanion(String nodeId, kotlin.coroutines.Continuation<? super com.google.android.horologist.data.AppHelperResultCode>);
method public suspend Object? updateInstalledTiles(kotlin.coroutines.Continuation<? super kotlin.Unit>);
property public kotlinx.coroutines.flow.Flow<java.util.Set<com.google.android.gms.wearable.Node>> connectedAndInstalledNodes;
property public final kotlinx.coroutines.flow.Flow<com.google.android.horologist.data.SurfacesInfo> surfacesInfo;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@

package com.google.android.horologist.media.ui.screens.browse

import androidx.compose.ui.test.hasScrollToNodeAction
import androidx.compose.ui.test.performTouchInput
import androidx.test.espresso.action.ViewActions.swipeUp
import com.google.android.horologist.media.ui.state.model.PlaylistDownloadUiModel
import com.google.android.horologist.media.ui.state.model.PlaylistUiModel
import com.google.android.horologist.screenshots.rng.WearLegacyA11yTest
Expand Down Expand Up @@ -58,11 +61,10 @@ class PlaylistDownloadBrowseScreenA11yScreenshotTest : WearLegacyA11yTest() {
}
}

// TODO https://github.com/google/horologist/issues/2237
// composeRule.onNode(hasScrollToNodeAction())
// .performTouchInput { repeat(10) { swipeUp() } }
//
// captureScreenshot()
composeRule.onNode(hasScrollToNodeAction())
.performTouchInput { repeat(10) { swipeUp() } }

captureScreenshot()
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ import androidx.compose.runtime.Composable
import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.test.hasScrollToNodeAction
import androidx.compose.ui.test.performTouchInput
import androidx.compose.ui.text.style.TextAlign
import androidx.test.espresso.action.ViewActions.swipeUp
import androidx.wear.compose.material.Chip
import androidx.wear.compose.material.ChipDefaults
import androidx.wear.compose.material.Icon
Expand Down Expand Up @@ -110,11 +113,10 @@ class DialogTest(device: Device) : WearLegacyScreenSizeTest(
}
}

// TODO https://github.com/google/horologist/issues/2237
// composeRule.onNode(hasScrollToNodeAction())
// .performTouchInput { repeat(10) { swipeUp() } }
//
// captureScreenshot("_2")
composeRule.onNode(hasScrollToNodeAction())
.performTouchInput { repeat(10) { swipeUp() } }

captureScreenshot("_2")
}

@Test
Expand Down Expand Up @@ -160,11 +162,10 @@ class DialogTest(device: Device) : WearLegacyScreenSizeTest(
}
}

// TODO https://github.com/google/horologist/issues/2237
// composeRule.onNode(hasScrollToNodeAction())
// .performTouchInput { repeat(10) { swipeUp() } }
//
// captureScreenshot("_2")
composeRule.onNode(hasScrollToNodeAction())
.performTouchInput { repeat(10) { swipeUp() } }

captureScreenshot("_2")
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.test.hasScrollToNodeAction
import androidx.compose.ui.test.performTouchInput
import androidx.compose.ui.unit.dp
import androidx.test.espresso.action.ViewActions.swipeUp
import androidx.wear.compose.foundation.lazy.ScalingLazyListState
import androidx.wear.compose.material.AppCard
import androidx.wear.compose.material.Text
Expand Down Expand Up @@ -63,11 +66,10 @@ class ScalingLazyColumnDefaultsTest(device: Device) :
}
}

// TODO https://github.com/google/horologist/issues/2237
// composeRule.onNode(hasScrollToNodeAction())
// .performTouchInput { repeat(10) { swipeUp() } }
//
// captureScreenshot()
composeRule.onNode(hasScrollToNodeAction())
.performTouchInput { repeat(10) { swipeUp() } }

captureScreenshot()
}

@Test
Expand Down Expand Up @@ -114,11 +116,10 @@ class ScalingLazyColumnDefaultsTest(device: Device) :
}
}

// TODO https://github.com/google/horologist/issues/2237
// composeRule.onNode(hasScrollToNodeAction())
// .performTouchInput { repeat(10) { swipeUp() } }
//
// captureScreenshot()
composeRule.onNode(hasScrollToNodeAction())
.performTouchInput { repeat(10) { swipeUp() } }

captureScreenshot()
}

@Test
Expand All @@ -129,11 +130,10 @@ class ScalingLazyColumnDefaultsTest(device: Device) :
SampleChipMenu(columnState = columnState)
}

// TODO https://github.com/google/horologist/issues/2237
// composeRule.onNode(hasScrollToNodeAction())
// .performTouchInput { repeat(10) { swipeUp() } }
//
// captureScreenshot()
composeRule.onNode(hasScrollToNodeAction())
.performTouchInput { repeat(10) { swipeUp() } }

captureScreenshot()
}

@Composable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,69 +110,62 @@ class ScalingLazyColumnExamplesTest(device: Device) : WearLegacyScreenSizeTest(
runTest(capture = false) {
Bottom1Button()
}
// TODO https://github.com/google/horologist/issues/2237
// scrollToBottom()
// captureScreenshot()
scrollToBottom()
captureScreenshot()
}

@Test
fun bottom2Buttons() {
runTest(capture = false) {
Bottom2Buttons()
}
// TODO https://github.com/google/horologist/issues/2237
// scrollToBottom()
// captureScreenshot()
scrollToBottom()
captureScreenshot()
}

@Test
fun bottom3Buttons() {
runTest(capture = false) {
Bottom3Buttons()
}
// TODO https://github.com/google/horologist/issues/2237
// scrollToBottom()
// captureScreenshot()
scrollToBottom()
captureScreenshot()
}

@Test
fun bottomOtherChips() {
runTest(capture = false) {
BottomOtherChips()
}
// TODO https://github.com/google/horologist/issues/2237
// scrollToBottom()
// captureScreenshot()
scrollToBottom()
captureScreenshot()
}

@Test
fun bottomOtherCards() {
runTest(capture = false) {
BottomOtherCards()
}
// TODO https://github.com/google/horologist/issues/2237
// scrollToBottom()
// captureScreenshot()
scrollToBottom()
captureScreenshot()
}

@Test
fun bottomUnspecified() {
runTest(capture = false) {
BottomUnspecified()
}
// TODO https://github.com/google/horologist/issues/2237
// scrollToBottom()
// captureScreenshot()
scrollToBottom()
captureScreenshot()
}

@Test
fun bottomOtherText() {
runTest(capture = false) {
BottomOtherText()
}
// TODO https://github.com/google/horologist/issues/2237
// scrollToBottom()
// captureScreenshot()
scrollToBottom()
captureScreenshot()
}

private fun scrollToBottom() {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading