From 43a20001d7500fcfad8633f3e34bcde1a0a66182 Mon Sep 17 00:00:00 2001 From: Andre Peixoto Date: Thu, 9 Jun 2022 16:49:36 +0100 Subject: [PATCH] Replace orientation values by strings, as supported by gcloud --- README.md | 5 +++-- .../cloud/FirebaseTestLabProcessCreator.kt | 2 +- .../appunite/firebasetestlabplugin/model/Device.kt | 2 +- .../firebasetestlabplugin/model/ScreenOrientation.kt | 12 ------------ sample/app/build.gradle | 5 +++-- 5 files changed, 8 insertions(+), 18 deletions(-) delete mode 100644 plugin/src/main/java/com/appunite/firebasetestlabplugin/model/ScreenOrientation.kt diff --git a/README.md b/README.md index fd763cd..8669c34 100644 --- a/README.md +++ b/README.md @@ -110,8 +110,9 @@ firebaseTestLab { // you can list all available via `gcloud firebase test android models list` for your device model androidApiLevels = [23] - // You can test app in landscape and portrait - // screenOrientations = [com.appunite.firebasetestlabplugin.model.ScreenOrientation.PORTRAIT, com.appunite.firebasetestlabplugin.model.ScreenOrientation.LANDSCAPE] + // You can test app in landscape, portrait and default + // More info in: https://cloud.google.com/sdk/gcloud/reference/firebase/test/android/run#--orientations + // screenOrientations = ["portrait", "landscape", "default"] // Choose language (default is `en`) // you can list all available via `gcloud firebase test android locales list` diff --git a/plugin/src/main/java/com/appunite/firebasetestlabplugin/cloud/FirebaseTestLabProcessCreator.kt b/plugin/src/main/java/com/appunite/firebasetestlabplugin/cloud/FirebaseTestLabProcessCreator.kt index 2342197..a9f84c7 100644 --- a/plugin/src/main/java/com/appunite/firebasetestlabplugin/cloud/FirebaseTestLabProcessCreator.kt +++ b/plugin/src/main/java/com/appunite/firebasetestlabplugin/cloud/FirebaseTestLabProcessCreator.kt @@ -63,7 +63,7 @@ object FirebaseTestLabProcessCreator { "--app=${processData.apk}", "--locales=${device.locales.joinArgs()}", "--os-version-ids=${device.androidApiLevels.joinArgs()}", - "--orientations=${device.screenOrientations.map { orientation -> orientation.gcloudName }.joinArgs()}") + "--orientations=${device.screenOrientations.joinArgs()}") .plus(when (processData.testType) { TestType.Robo -> sequenceOf("--type=robo") is TestType.Instrumentation -> sequenceOf("--type=instrumentation", "--test=${processData.testType.testApk}") diff --git a/plugin/src/main/java/com/appunite/firebasetestlabplugin/model/Device.kt b/plugin/src/main/java/com/appunite/firebasetestlabplugin/model/Device.kt index 8461351..ed38ca0 100644 --- a/plugin/src/main/java/com/appunite/firebasetestlabplugin/model/Device.kt +++ b/plugin/src/main/java/com/appunite/firebasetestlabplugin/model/Device.kt @@ -4,7 +4,7 @@ import java.io.Serializable class Device(val name: String) : Serializable { var locales: List = listOf("en") - var screenOrientations: List = listOf(ScreenOrientation.PORTRAIT) + var screenOrientations: List = listOf("portrait") var androidApiLevels: List = listOf() var deviceIds: List = listOf() var timeout: Long = 0 diff --git a/plugin/src/main/java/com/appunite/firebasetestlabplugin/model/ScreenOrientation.kt b/plugin/src/main/java/com/appunite/firebasetestlabplugin/model/ScreenOrientation.kt deleted file mode 100644 index 98334bb..0000000 --- a/plugin/src/main/java/com/appunite/firebasetestlabplugin/model/ScreenOrientation.kt +++ /dev/null @@ -1,12 +0,0 @@ -package com.appunite.firebasetestlabplugin.model - -enum class ScreenOrientation { - PORTRAIT { - override val gcloudName: String = "portrait" - }, - LANDSCAPE { - override val gcloudName: String = "landscape" - }; - - internal abstract val gcloudName: String -} diff --git a/sample/app/build.gradle b/sample/app/build.gradle index 80bc2db..4ec5feb 100644 --- a/sample/app/build.gradle +++ b/sample/app/build.gradle @@ -56,8 +56,9 @@ firebaseTestLab { // you can list all available via `gcloud firebase test android models list` for your device model androidApiLevels = [23] - // You can test app in landscape and portrait - // screenOrientations = [com.appunite.firebasetestlabplugin.model.ScreenOrientation.PORTRAIT, com.appunite.firebasetestlabplugin.model.ScreenOrientation.LANDSCAPE] + // You can test app in landscape, portrait and default + // More info in: https://cloud.google.com/sdk/gcloud/reference/firebase/test/android/run#--orientations + // screenOrientations = ["portrait", "landscape", "default"] // Choose language (default is `en`) // you can list all available via `gcloud firebase test android locales list`