[Android] Adapt the fastline screenshot task to the new UI

Nicolas Pomepuy git at videolan.org
Mon Jul 25 08:51:52 UTC 2022


vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Tue Jul 19 12:49:12 2022 +0200| [b3a45b4e8fd31c2d7166175a92c55889c86038e1] | committer: Duncan McNamara

Adapt the fastline screenshot task to the new UI

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

 .../org/videolan/vlc/PhoneScreenhotsInstrumentedTest.kt    | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 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 3d9a417b4..36f181de1 100644
--- a/application/app/src/androidTest/java/org/videolan/vlc/PhoneScreenhotsInstrumentedTest.kt
+++ b/application/app/src/androidTest/java/org/videolan/vlc/PhoneScreenhotsInstrumentedTest.kt
@@ -25,6 +25,7 @@
 package org.videolan.vlc
 
 import android.content.Intent
+import android.content.pm.ActivityInfo
 import android.os.SystemClock
 import android.util.Log
 import androidx.test.espresso.Espresso.onView
@@ -41,6 +42,7 @@ import org.junit.Test
 import org.videolan.resources.EXTRA_TARGET
 import org.videolan.tools.Settings
 import org.videolan.vlc.gui.MainActivity
+import org.videolan.vlc.gui.helpers.UiTools.isTablet
 import org.videolan.vlc.util.DpadHelper.pressHome
 import org.videolan.vlc.util.DpadHelper.pressPip
 import org.videolan.vlc.util.DpadHelper.pressStop
@@ -73,12 +75,12 @@ class PhoneScreenhotsInstrumentedTest : BaseUITest() {
         SystemClock.sleep(500)
         ScreenshotUtil.takeScreenshot(3, "audio_list")
         onView(withId(R.id.sliding_tabs)).perform(TabsMatcher(2))
+        SystemClock.sleep(500)
         waitUntilLoaded { activity.findViewById(R.id.audio_list) }
 
         onView(withId(R.id.ml_menu_last_playlist)).perform(click())
-        onView(isRoot()).perform(waitId(R.id.header, 5000))
-//        ScreenshotUtil.takeScreenshot(7,"audio_player_collapsed")
-        onView(withId(R.id.header)).perform(click())
+        onView(isRoot()).perform(waitId(R.id.audio_media_switcher, 5000))
+        onView(withId(R.id.audio_media_switcher)).perform(click())
         SystemClock.sleep(300)
         ScreenshotUtil.takeScreenshot(6,"audio_player_playlist")
         onView(withId(R.id.playlist_switch)).perform(click())
@@ -120,7 +122,8 @@ class PhoneScreenhotsInstrumentedTest : BaseUITest() {
         onView(withRecyclerView(R.id.options_list).atPositionOnView(4, R.id.option_title)).perform(click())
 //        ScreenshotUtil.takeScreenshot(9,"video_player_equalizer")
         pressBack()
-        pressPip()
+        onView(withId(R.id.player_overlay_adv_function)).perform(ForceClickAction())
+        onView(withRecyclerView(R.id.options_list).atPositionOnView(6, R.id.option_title)).perform(click())
         pressHome()
         pressPip()
         ScreenshotUtil.takeScreenshot(8,"pip")
@@ -150,5 +153,8 @@ class PhoneScreenhotsInstrumentedTest : BaseUITest() {
         }
         activityTestRule.launchActivity(intent)
         activity = activityTestRule.activity
+        if (activity.isTablet()) {
+            activity.requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE
+        }
     }
 }



More information about the Android mailing list