[Android] Fix the UI tests

Nicolas Pomepuy git at videolan.org
Tue Aug 10 05:47:08 UTC 2021


vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Mon Aug  9 09:19:39 2021 +0200| [16338a9aaf851c980744f28c96e73f75205deb12] | committer: Nicolas Pomepuy

Fix the UI tests

> https://code.videolan.org/videolan/vlc-android/commit/16338a9aaf851c980744f28c96e73f75205deb12
---

 .../java/org/videolan/vlc/PhoneScreenhotsInstrumentedTest.kt        | 2 +-
 .../androidTest/java/org/videolan/vlc/gui/PlaylistActivityUITest.kt | 6 +++---
 .../androidTest/java/org/videolan/vlc/gui/PlaylistFragmentUITest.kt | 6 +++---
 .../org/videolan/vlc/gui/preferences/PreferencesFragmentUITest.kt   | 2 +-
 4 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/application/app/src/androidTest/java/org/videolan/vlc/PhoneScreenhotsInstrumentedTest.kt b/application/app/src/androidTest/java/org/videolan/vlc/PhoneScreenhotsInstrumentedTest.kt
index f162abdd6..76a9fb8d7 100644
--- a/application/app/src/androidTest/java/org/videolan/vlc/PhoneScreenhotsInstrumentedTest.kt
+++ b/application/app/src/androidTest/java/org/videolan/vlc/PhoneScreenhotsInstrumentedTest.kt
@@ -104,7 +104,7 @@ class PhoneScreenhotsInstrumentedTest : BaseUITest() {
 
         val rvMatcher = withRecyclerView(R.id.video_grid)
         Log.d("Espresso", "2")
-        onView(rvMatcher.atPosition(3)).perform(click())
+        onView(rvMatcher.atPosition(2)).perform(click())
         Log.d("Espresso", "3")
 
         rotateLandscape()
diff --git a/application/app/src/androidTest/java/org/videolan/vlc/gui/PlaylistActivityUITest.kt b/application/app/src/androidTest/java/org/videolan/vlc/gui/PlaylistActivityUITest.kt
index 7d1409774..b810b16fe 100644
--- a/application/app/src/androidTest/java/org/videolan/vlc/gui/PlaylistActivityUITest.kt
+++ b/application/app/src/androidTest/java/org/videolan/vlc/gui/PlaylistActivityUITest.kt
@@ -36,9 +36,9 @@ class PlaylistActivityUITest: BaseUITest() {
         Thread.sleep(3 * 1000)
 
         val ml = Medialibrary.getInstance()
-        val pl = ml.createPlaylist("test")
-        pl.append(ml.getPagedVideos(Medialibrary.SORT_DEFAULT, false, 5, 0).map { it.id })
-        pl.append(ml.getPagedAudio(Medialibrary.SORT_DEFAULT, false, 5, 0).map { it.id })
+        val pl = ml.createPlaylist("test", true)
+        pl.append(ml.getPagedVideos(Medialibrary.SORT_DEFAULT, false, true, 5, 0).map { it.id })
+        pl.append(ml.getPagedAudio(Medialibrary.SORT_DEFAULT, false, true, 5, 0).map { it.id })
 
         val intent = Intent().apply {
             putExtra(AudioBrowserFragment.TAG_ITEM, pl)
diff --git a/application/app/src/androidTest/java/org/videolan/vlc/gui/PlaylistFragmentUITest.kt b/application/app/src/androidTest/java/org/videolan/vlc/gui/PlaylistFragmentUITest.kt
index fa53fbdec..c8d61b207 100644
--- a/application/app/src/androidTest/java/org/videolan/vlc/gui/PlaylistFragmentUITest.kt
+++ b/application/app/src/androidTest/java/org/videolan/vlc/gui/PlaylistFragmentUITest.kt
@@ -52,9 +52,9 @@ class PlaylistFragmentUITest: BaseUITest() {
 
     private fun createDummyPlaylist() {
         val ml = Medialibrary.getInstance()
-        val pl = ml.createPlaylist(DUMMY_PLAYLIST)
-        pl.append(ml.getPagedVideos(Medialibrary.SORT_DEFAULT, false, 5, 0).map { it.id })
-        pl.append(ml.getPagedAudio(Medialibrary.SORT_DEFAULT, false, 5, 0).map { it.id })
+        val pl = ml.createPlaylist(DUMMY_PLAYLIST, true)
+        pl.append(ml.getPagedVideos(Medialibrary.SORT_DEFAULT, false, true, 5, 0).map { it.id })
+        pl.append(ml.getPagedAudio(Medialibrary.SORT_DEFAULT, false, true, 5, 0).map { it.id })
     }
 
     @Test
diff --git a/application/app/src/androidTest/java/org/videolan/vlc/gui/preferences/PreferencesFragmentUITest.kt b/application/app/src/androidTest/java/org/videolan/vlc/gui/preferences/PreferencesFragmentUITest.kt
index 4d299cac8..f0fe998ae 100644
--- a/application/app/src/androidTest/java/org/videolan/vlc/gui/preferences/PreferencesFragmentUITest.kt
+++ b/application/app/src/androidTest/java/org/videolan/vlc/gui/preferences/PreferencesFragmentUITest.kt
@@ -91,6 +91,6 @@ class PreferencesFragmentUITest: BasePreferenceUITest() {
     companion object {
         val MAP_PIP_MODE = mapOf("0" to R.string.stop, "1" to R.string.play_as_audio_background, "2" to R.string.play_pip_title)
         val MAP_HARDWARE_ACCEL = mapOf("-1" to R.string.automatic, "0" to R.string.hardware_acceleration_disabled, "1" to R.string.hardware_acceleration_decoding, "2" to R.string.hardware_acceleration_full)
-        val MAP_ORIENTATION = mapOf("99" to R.string.screen_orientation_sensor, "100" to R.string.screen_orientation_start_lock, "101" to R.string.screen_orientation_landscape, "102" to R.string.screen_orientation_portrait)
+        val MAP_ORIENTATION = mapOf("99" to R.string.screen_orientation_sensor, "101" to R.string.screen_orientation_landscape, "102" to R.string.screen_orientation_portrait)
     }
 }
\ No newline at end of file



More information about the Android mailing list