Created
September 4, 2021 18:07
-
-
Save rubenquadros/86898791d78e3b90b9dc8b8cab8e09c7 to your computer and use it in GitHub Desktop.
Testing game videos screen
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class GameVideoTest() { | |
@get:Rule val composeTestRule = createComposeRule() | |
@Test | |
fun vide_player_and_playlist_show_be_shown() { | |
composeTestRule.setContent { | |
ShowGameVideos( | |
gameVideos = | |
FakeGamesData.getFakeGameVideos() | |
) | |
} | |
// Video player should be shown | |
composeTestRule | |
.onNodeWithTag("VideoPlayer") | |
.assertIsDisplayed() | |
// Thubnail of video should be shown in playlist | |
composeTestRule | |
.onAllNodesWithContentDescription("Thumbnail") | |
.assertCountEquals(3) | |
// Play button should be shown for currently playing video in playlist | |
composeTestRule | |
.onNodeWithContentDescription("Playing") | |
.assertIsDisplayed() | |
// Now playing should be shown for currently playing video in playlist | |
composeTestRule | |
.onNodeWithText("Now Playing") | |
.assertIsDisplayed() | |
} | |
} | |
object FakeGamesData { | |
fun getFakeGameVideos(): GameVideosEntity { | |
// provide fake data | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment