У меня есть набор тестовых случаев пользовательского интерфейса в моем проекте. Если я запускаю тестовый пример в эмуляторе (созданный из Android Studio) или устройства через команду Gradlew или конфигурацию Android Studio Run, все тестовые примеры передаются. < /P>
Если я запускаю один и тот же тестовый пример в Эмулятор (созданный из инструментов командной строки), фоновые тестовые случаи сбой. < /p>
Команда используется для создания эмулятора < /p>
cd $ANDROID_HOME/tools/bin
echo no | avdmanager create avd --force --name pixel_test_device --abi arm64-v8a --device pixel_7 --package 'system-images;android-34;google_apis_playstore;arm64-v8a'
< /code>
Команда для запуска тестового примера из папки проекта < /p>
./gradlew :app:connectedDebugAndroidTest
< /code>
config.ini Файл эмулятора, созданный выше < /p>
AvdId=pixel_test_device
PlayStore.enabled=true
abi.type=arm64-v8a
avd.ini.displayname=pixel test device
avd.ini.encoding=UTF-8
disk.dataPartition.size= 6G
fastboot.chosenSnapshotFile=
fastboot.forceChosenSnapshotBoot=no
fastboot.forceColdBoot=no
fastboot.forceFastBoot=yes
hw.accelerometer=yes
hw.arc=false
hw.audioInput=yes
hw.battery=yes
hw.camera.back=virtualscene
hw.camera.front=emulated
hw.cpu.arch=arm64
hw.cpu.ncore=4
hw.dPad=no
hw.device.hash2=MD5:3db3250dab5d0d93b29353040181c7e9
hw.device.manufacturer=Google
hw.device.name=pixel_7
hw.gps=yes
hw.gpu.enabled=yes
hw.gpu.mode=auto
hw.initialOrientation=portrait
hw.keyboard=yes
hw.lcd.density=420
hw.lcd.height=2400
hw.lcd.width=1080
hw.mainKeys=no
hw.ramSize=1536
hw.sdCard=yes
hw.sensors.orientation=yes
hw.sensors.proximity=yes
hw.trackBall=no
image.sysdir.1=system-images/android-34/google_apis_playstore/arm64-v8a/
runtime.network.latency=none
runtime.network.speed=full
sdcard.size=0 TB
showDeviceFrame=yes
skin.dynamic=yes
skin.name = 1080x2400
skin.path = _no_skin
skin.path.backup = ###################
tag.display=Google Play
tag.displaynames=Google Play
tag.id=google_apis_playstore
tag.ids=google_apis_playstore
vm.heapSize=228
< /code>
Ошибки
Я получаю ниже ошибки для исходных тестовых случаев. < /p>
androidx.test.espresso.NoActivityResumedException: No activities in stage RESUMED. Did you forget to launch the activity. (test.getActivity() or similar)?
at dalvik.system.VMStack.getThreadStackTrace(Native Method)
< /code>
org.awaitility.core.ConditionTimeoutException: Assertion condition '(view is an instance of android.view.ViewGroup and has descendant matching an instance of android.widget.TextView and view.getText() with or without transformation to match: is "Track 1")' doesn't match the selected view.
Expected: (view is an instance of android.view.ViewGroup and has descendant matching an instance of android.widget.TextView and view.getText() with or without transformation to match: is "Track 1")
Got: no descendant matching an instance of android.widget.TextView and view.getText() with or without transformation to match: is "Track 1" was found
View Details: LibraryItemsRecyclerView{id=2131362513, res-name=library_items_recycler_view, visibility=VISIBLE, width=1080, height=1892, has-focus=false, has-focusable=true, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=true, is-layout-requested=false, is-selected=false, layout-params=android.widget.FrameLayout$LayoutParams@YYYYYY, tag=null, root-is-layout-requested=false, has-input-connection=false, x=0.0, y=0.0, child-count=3}
within 5 seconds.
at org.awaitility.core.ConditionAwaiter.await(ConditionAwaiter.java:167)
at org.awaitility.core.AssertionCondition.await(AssertionCondition.java:119)
at org.awaitility.core.AssertionCondition.await(AssertionCondition.java:31)
at org.awaitility.core.ConditionFactory.until(ConditionFactory.java:1006)
< /code>
Only background related test cases are failing.
I think I missed something in emulator config set up from command-line tools, can you please help me in resolving the issue?
I tried comparing the config.ani file of emulator created from command-line tools with emulator created from android studio. But couldn't find any difference.
Also tried to run the failing test case separately instead of running all together, but still it fails.
Подробнее здесь: https://stackoverflow.com/questions/794 ... ng-in-emul
Тестовые примеры автоматизации Android UI, специфичные для фоновой задачи, сбои в эмуляторе, созданном инструментами ком ⇐ Android
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение
-
-
Как создать тестовые примеры дыма для приложения Java с помощью командной строки
Anonymous » » в форуме JAVA - 0 Ответы
- 33 Просмотры
-
Последнее сообщение Anonymous
-