- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试使用 CLI 在模拟器中运行仪器测试(Espresso),以使用快速 channel /屏幕抓取生成我们的应用程序的屏幕截图。该应用程序基于 IONIC Cordova。
在 Android Studio 中执行我的 Espresso 测试时,它会记录:
Testing started at 16:34 ...
07/30 16:34:29: Launching MainActivityTest
$ adb push /Users/administrator/Jenkins/workspace/generatescreenshots/app/platforms/android/app/build/outputs/apk/debug/app-debug.apk /data/local/tmp/de.konzeptix.test.app
$ adb shell pm install -t -r "/data/local/tmp/de.konzeptix.test.app"
Success
$ adb push /Users/administrator/Jenkins/workspace/generatescreenshots/app/platforms/android/app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apk /data/local/tmp/de.konzeptix.test.app.test
$ adb shell pm install -t -r "/data/local/tmp/de.konzeptix.test.app.test"
Success
Running tests
$ adb shell am instrument -w -r -e debug false -e class 'de.konzeptix.test.app.test.MainActivityTest' de.konzeptix.test.app.test/android.support.test.runner.AndroidJUnitRunner
Client not ready yet..
Started running tests
Tests ran to completion.
00:03:06.842 +----------------------------+---------------------------------------------------------------------------------------+
00:03:06.843 | Detected Values from './fastlane/Screengrabfile' |
00:03:06.844 +----------------------------+---------------------------------------------------------------------------------------+
00:03:06.845 | app_package_name | de.konzeptix.test.app |
00:03:06.845 | tests_package_name | de.konzeptix.test.app.test |
00:03:06.846 | use_tests_in_classes | ["de.konzeptix.test.app.test.MainActivityTest.java"] |
00:03:06.847 | app_apk_path | ./platforms/android/app/build/outputs/apk/debug/app-debug.apk |
00:03:06.847 | tests_apk_path | ./platforms/android/app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apk |
00:03:06.848 | locales | ["de-DE"] |
00:03:06.849 | launch_arguments | ["'shot0 topsBtn'", " 'shot1 articlesBtn'", " 'shot2 eventsBtn'"] |
00:03:06.850 | device_type | phone |
00:03:06.850 | clear_previous_screenshots | true |
00:03:06.851 +----------------------------+---------------------------------------------------------------------------------------+
00:03:06.852
00:03:06.852
00:03:06.853 +-----------------------------+---------------------------------------------------------------------------------------+
00:03:06.854 | Summary for screengrab 2.99.1 |
00:03:06.869 +-----------------------------+---------------------------------------------------------------------------------------+
00:03:06.870 | android_home | /Users/administrator/Library/Android/sdk |
00:03:06.870 | locales | ["de-DE"] |
00:03:06.870 | clear_previous_screenshots | true |
00:03:06.870 | output_directory | fastlane/metadata/android |
00:03:06.871 | skip_open_summary | false |
00:03:06.871 | app_package_name | de.konzeptix.test.app |
00:03:06.871 | tests_package_name | de.konzeptix.test.app.test |
00:03:06.872 | use_tests_in_classes | ["de.konzeptix.test.app.test.MainActivityTest.java"] |
00:03:06.872 | launch_arguments | ["'shot0 topsBtn'", " 'shot1 articlesBtn'", " 'shot2 eventsBtn'"] |
00:03:06.872 | test_instrumentation_runner | android.support.test.runner.AndroidJUnitRunner |
00:03:06.872 | ending_locale | en-US |
00:03:06.873 | app_apk_path | ./platforms/android/app/build/outputs/apk/debug/app-debug.apk |
00:03:06.873 | tests_apk_path | ./platforms/android/app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apk |
00:03:06.873 | device_type | phone |
00:03:06.874 | exit_on_test_failure | true |
00:03:06.874 | reinstall_app | false |
00:03:06.874 +-----------------------------+---------------------------------------------------------------------------------------+
00:03:06.874
00:03:06.949 Clearing phoneScreenshots within fastlane/metadata/android
00:03:06.951 $ /Users/administrator/Library/Android/sdk/platform-tools/adb devices -l
00:03:06.960 ▸ List of devices attached
00:03:06.966 ▸ emulator-5554 device product:sdk_gphone_x86 model:Android_SDK_built_for_x86 device:generic_x86 transport_id:1
00:03:06.974 $ /Users/administrator/Library/Android/sdk/platform-tools/adb -s emulator-5554 shell echo \$EXTERNAL_STORAGE
00:03:06.981 ▸ /sdcard
00:03:06.988 Cleaning screenshots on device
00:03:07.000 ls: /sdcard/de.konzeptix.test.app/screengrab: No such file or directory
00:03:07.001 Exit status: 1
00:03:07.021 ls: /data/data/de.konzeptix.test.app/app_screengrab: Permission denied
00:03:07.022 Exit status: 1
00:03:07.025 Validating app APK
00:03:07.026 $ /Users/administrator/Library/Android/sdk/build-tools/28.0.1/aapt dump permissions ./platforms/android/app/build/outputs/apk/debug/app-debug.apk
00:03:07.032 ▸ package: de.konzeptix.test.app
00:03:07.036 ▸ uses-permission: name='android.permission.DISABLE_KEYGUARD'
00:03:07.040 ▸ uses-permission: name='android.permission.WAKE_LOCK'
00:03:07.045 ▸ uses-permission: name='android.permission.WRITE_EXTERNAL_STORAGE'
00:03:07.049 ▸ uses-permission: name='android.permission.READ_EXTERNAL_STORAGE'
00:03:07.052 ▸ uses-permission: name='android.permission.CHANGE_CONFIGURATION'
00:03:07.054 ▸ uses-permission: name='android.permission.INTERNET'
00:03:07.057 ▸ uses-permission: name='android.permission.ACCESS_NETWORK_STATE'
00:03:07.059 ▸ uses-permission: name='android.permission.READ_PHONE_STATE'
00:03:07.062 ▸ uses-permission: name='com.sec.android.provider.badge.permission.READ'
00:03:07.065 ▸ uses-permission: name='com.sec.android.provider.badge.permission.WRITE'
00:03:07.067 ▸ uses-permission: name='com.htc.launcher.permission.READ_SETTINGS'
00:03:07.070 ▸ uses-permission: name='com.htc.launcher.permission.UPDATE_SHORTCUT'
00:03:07.072 ▸ uses-permission: name='com.sonyericsson.home.permission.BROADCAST_BADGE'
00:03:07.075 ▸ uses-permission: name='com.anddoes.launcher.permission.UPDATE_COUNT'
00:03:07.077 ▸ uses-permission: name='com.majeur.launcher.permission.UPDATE_BADGE'
00:03:07.080 ▸ uses-permission: name='com.google.android.providers.gsf.permission.READ_GSERVICES'
00:03:07.081 ▸ uses-permission: name='com.google.android.finsky.permission.BIND_GET_INSTALL_REFERRER_SERVICE'
00:03:07.083 ▸ uses-permission: name='com.google.android.c2dm.permission.RECEIVE'
00:03:07.084 ▸ permission: de.konzeptix.test.app.permission.C2D_MESSAGE
00:03:07.086 ▸ uses-permission: name='de.konzeptix.test.app.permission.C2D_MESSAGE'
00:03:07.087 Installing app APK
00:03:07.088 $ /Users/administrator/Library/Android/sdk/platform-tools/adb -s emulator-5554 install -t -r ./platforms/android/app/build/outputs/apk/debug/app-debug.apk
00:03:07.447 ▸ Success
00:03:07.449 Installing tests APK
00:03:07.450 $ /Users/administrator/Library/Android/sdk/platform-tools/adb -s emulator-5554 install -t -r ./platforms/android/app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apk
00:03:08.115 ▸ Success
00:03:08.122 Granting the permission necessary to change locales on the device
00:03:08.124 $ /Users/administrator/Library/Android/sdk/platform-tools/adb -s emulator-5554 shell pm grant de.konzeptix.test.app android.permission.CHANGE_CONFIGURATION
00:03:08.302 $ /Users/administrator/Library/Android/sdk/platform-tools/adb -s emulator-5554 shell getprop ro.build.version.sdk
00:03:08.328 ▸ 28
00:03:08.349 Granting the permissions necessary to access device external storage
00:03:08.350 $ /Users/administrator/Library/Android/sdk/platform-tools/adb -s emulator-5554 shell pm grant de.konzeptix.test.app android.permission.WRITE_EXTERNAL_STORAGE
00:03:08.413 $ /Users/administrator/Library/Android/sdk/platform-tools/adb -s emulator-5554 shell pm grant de.konzeptix.test.app android.permission.READ_EXTERNAL_STORAGE
00:03:08.462 Running tests for locale: de-DE
00:03:08.464 $ /Users/administrator/Library/Android/sdk/platform-tools/adb -s emulator-5554 shell am instrument --no-window-animation -w \
00:03:08.467 -e testLocale de_DE \
00:03:08.468 -e endingLocale en_US \
00:03:08.468 -e class de.konzeptix.test.app.test.MainActivityTest.java \
00:03:08.468 -e 'shot0 topsBtn' -e 'shot1 articlesBtn' -e 'shot2 eventsBtn' \
00:03:08.469 de.konzeptix.test.app.test/android.support.test.runner.AndroidJUnitRunner
00:03:09.116 ▸ de.konzeptix.test.app.test.MainActivityTest.java:
00:03:09.123 ▸ Error in de.konzeptix.test.app.test.MainActivityTest.java:
00:03:09.130 ▸ java.lang.ClassNotFoundException: de.konzeptix.test.app.test.MainActivityTest.java
00:03:09.137 ▸ at java.lang.Class.classForName(Native Method)
00:03:09.143 ▸ at java.lang.Class.forName(Class.java:453)
00:03:09.150 ▸ at android.support.test.internal.runner.TestLoader.doCreateRunner(TestLoader.java:72)
00:03:09.157 ▸ at android.support.test.internal.runner.TestLoader.getRunnersFor(TestLoader.java:104)
00:03:09.164 ▸ at android.support.test.internal.runner.TestRequestBuilder.build(TestRequestBuilder.java:789)
00:03:09.172 ▸ at android.support.test.runner.AndroidJUnitRunner.buildRequest(AndroidJUnitRunner.java:539)
00:03:09.179 ▸ at android.support.test.runner.AndroidJUnitRunner.onStart(AndroidJUnitRunner.java:382)
00:03:09.186 ▸ at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:2145)
00:03:09.193 ▸ Caused by: java.lang.ClassNotFoundException: Didn't find class "de.konzeptix.test.app.test.MainActivityTest.java" on path: DexPathList[[zip file "/system/framework/android.test.runner.jar", zip file "/system/framework/android.test.mock.jar", zip file "/system/framework/org.apache.http.legacy.boot.jar", zip file "/data/app/de.konzeptix.test.app.test-uaWS_ap-9oK2KRdJOAlBJg==/base.apk", zip file "/data/app/de.konzeptix.test.app-BROFUx3GSnQkL4K7pknnyw==/base.apk"],nativeLibraryDirectories=[/data/app/de.konzeptix.test.app.test-uaWS_ap-9oK2KRdJOAlBJg==/lib/x86, /data/app/de.konzeptix.test.app-BROFUx3GSnQkL4K7pknnyw==/lib/x86, /data/app/de.konzeptix.test.app.test-uaWS_ap-9oK2KRdJOAlBJg==/base.apk!/lib/x86, /data/app/de.konzeptix.test.app-BROFUx3GSnQkL4K7pknnyw==/base.apk!/lib/x86, /system/lib]]
00:03:09.207 ▸ at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134)
00:03:09.211 ▸ at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
00:03:09.214 ▸ at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
00:03:09.216 ▸ ... 8 more
00:03:09.274 ▸ Time: 0.014
00:03:09.281 ▸ There was 1 failure:
00:03:09.287 ▸ 1) de.konzeptix.test.app.test.MainActivityTest.java
00:03:09.294 ▸ java.lang.ClassNotFoundException: de.konzeptix.test.app.test.MainActivityTest.java
00:03:09.301 ▸ at java.lang.Class.classForName(Native Method)
00:03:09.309 ▸ at java.lang.Class.forName(Class.java:453)
00:03:09.315 ▸ at android.support.test.internal.runner.TestLoader.doCreateRunner(TestLoader.java:72)
00:03:09.322 ▸ at android.support.test.internal.runner.TestLoader.getRunnersFor(TestLoader.java:104)
00:03:09.330 ▸ at android.support.test.internal.runner.TestRequestBuilder.build(TestRequestBuilder.java:789)
00:03:09.334 ▸ at android.support.test.runner.AndroidJUnitRunner.buildRequest(AndroidJUnitRunner.java:539)
00:03:09.338 ▸ at android.support.test.runner.AndroidJUnitRunner.onStart(AndroidJUnitRunner.java:382)
00:03:09.342 ▸ at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:2145)
00:03:09.346 ▸ Caused by: java.lang.ClassNotFoundException: Didn't find class "de.konzeptix.test.app.test.MainActivityTest.java" on path: DexPathList[[zip file "/system/framework/android.test.runner.jar", zip file "/system/framework/android.test.mock.jar", zip file "/system/framework/org.apache.http.legacy.boot.jar", zip file "/data/app/de.konzeptix.test.app.test-uaWS_ap-9oK2KRdJOAlBJg==/base.apk", zip file "/data/app/de.konzeptix.test.app-BROFUx3GSnQkL4K7pknnyw==/base.apk"],nativeLibraryDirectories=[/data/app/de.konzeptix.test.app.test-uaWS_ap-9oK2KRdJOAlBJg==/lib/x86, /data/app/de.konzeptix.test.app-BROFUx3GSnQkL4K7pknnyw==/lib/x86, /data/app/de.konzeptix.test.app.test-uaWS_ap-9oK2KRdJOAlBJg==/base.apk!/lib/x86, /data/app/de.konzeptix.test.app-BROFUx3GSnQkL4K7pknnyw==/base.apk!/lib/x86, /system/lib]]
00:03:09.354 ▸ at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134)
00:03:09.358 ▸ at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
00:03:09.361 ▸ at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
00:03:09.361 ▸ ... 8 more
00:03:09.363 ▸ FAILURES!!!
00:03:09.364 ▸ Tests run: 1, Failures: 1
最佳答案
由于 faSTLane screengrab 将这两个应用程序安装到设备上,我无法清楚地看到安装和运行仪器测试的 Android Studio 过程有任何重大差异,我尝试使用 faSTLane screengrab use_tests_in_packages 的另一个选项而不是 use_tests_in_class,它转换为cli调用
$ /Users/administrator/Library/Android/sdk/platform-tools/adb -s emulator-5554 shell am instrument --no-window-animation -w \
-e testLocale de_DE \
-e endingLocale en_US \
-e package de.konzeptix.test.app.test \
-e shot0 topsBtn -e shot1 articlesBtn -e shot2 eventsBtn -e shot3 galleriesBtn -e shot4 productsBtn -e shot5 faqBtn -e shot6 companyBtn -e shot7 contactsBtn \
de.konzeptix.test.app.test/android.support.test.runner.AndroidJUnitRunner
关于gradle - java.lang.ClassNotFoundException : Didn't find class “xxx.xxx.MainActivityTest.java” on path: DexPathList,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51596743/
这是我的作业 What does echo PATH $PATH \$PATH do? 我不知道它是如何工作的。 echo PATH打印“路径” $PATH创建一个“PATH”变量......也许?
我想弄清楚两者之间的区别 路径=路径+[节点1] 路径+=[节点1] path.append(node1) 我得到的是 path = path + [node1] 的正确路径,但不是其他两个。 def
我使用 Robot 框架在 Ride 中创建了一个测试用例。运行时出现错误。 我更新了python的路径。我更新了库和 Ride。我换了文件夹还是不行 *** Settings *** Documen
我尝试使用额外的功能自定义 pathlib.Path()。特别是,我真的很喜欢使用上下文管理器作为移入和移出目录的方法。我一直在使用它,但我似乎在让 Path() 与自定义上下文管理器一起工作时遇到错
编辑:基于 Ulf Rompe 的评论,重要的是使用“1”而不是“0”,否则您将破坏 sys.path . 我已经做 python 很长一段时间了(一年多),我总是很困惑为什么人们建议你使用 sys.
我有兴趣这样做的原因是因为我的路径中有一部分将保持不变,但我希望将其与其所有父部分一起删除。 所以如果我们说, some/unknown/path/foo/bar/baz 我想回去 bar/baz 但
在几个 SO 的问题中,有这些行可以访问代码的父目录,例如os.path.join(os.path.dirname(__file__)) returns nothing和 os.path.join(o
我已经在我的 Linux 中安装了 anaconda 来导入 python 包。 安装 anaconda 后,我无法在 python 中使用 anaconda,经过一番搜索后我发现输入此命令我能够使用
哪个更好用,为什么?我的意思是这两个命令在哪些方面不同以及如何不同?性能、可读性…… new FileInfo(path).Name 或 Path.GetFileName(path) 最佳答案 因为您
这不适用于某些设备。 在三星设备中,他们不允许使用下载管理器下载文件。 我已经在 list 中定义了权限并获得了运行时权限。 DownloadManager downloadManager = (Do
我想知道在这个例子中使用 Paths.get() 和 Path.resolve 有什么区别: public static void main(String[] args) { Path p1
目前我正在开发一个转换由 Inkscape 创建的 svg-paths 的应用程序。现在我不清楚关于绝对和相对路径组合的路径规范。规范是否说明了同时包含相对和绝对坐标的路径定义? 特别是关于绝对贝塞尔
我正在编写脚本,我需要在用户的 $PATH 上查找命令并获取该命令的完整路径。问题是我不知道用户的登录 shell 是什么,或者他们的 do 文件中可能有什么奇怪的东西。我将 bourne shell
Metalsmith 的文档对 path() 函数没有太多解释:#path(paths...): Resolve any amount of paths... relative to the work
我知道我可以通过 regedit 更改我的 wine PATH,但实际上我只需要为一次运行更改 PATH。 例如,我的软件名为frontend.exe,这取决于example/mylib.dll,我需
因此,绝对路径是一种到达某个文件或位置的方法,描述了它的完整路径、完整路径,并且它依赖于操作系统(Windows 和 Linux 的绝对路径,例如,不同)。另一方面,相对路径是从当前位置 ..(两个点
我对编程有点陌生(不是真的,但我仍在学习 - 我们不是吗?)。虽然我了解 Java 和 Python,并且了解 C、C++、JS、C#、HTML、CSS 等(并且我可以在终端中很好地导航),但我不熟悉
我对编程有点陌生(不是真的,但我仍在学习 - 我们不是吗?)。虽然我了解 Java 和 Python,并且了解 C、C++、JS、C#、HTML、CSS 等(并且我可以在终端中很好地导航),但我不熟悉
这个问题不太可能对任何 future 的访客有帮助;它只与一个较小的地理区域、一个特定的时间点或一个非常狭窄的情况相关,通常不适用于全世界的互联网受众。如需帮助使此问题更广泛适用,visit the
使用环境变量(如 PATH)作为 $PATH 或 ${PATH} 有什么区别? 最佳答案 在大多数情况下没有区别。唯一重要的是你是否想在扩展后包含尾随文本。例如,假设您的 PATH 包含字符串 FOO
我是一名优秀的程序员,十分优秀!