在 Jenkins 上运行完整管道时,无法在 Android 第三代模拟器上通过 Appium 启动 uiautomator2

问题描述 投票:0回答:1

在我的管道脚本中,我使用此命令在第 3 方模拟器上启动 Android UI 自动化。

".\\gradlew cucumber -Pargs=\"-rerun ${rerun_times} -enable-report ${enable_report} -timezone GMT+08:00 -suite ${running_scope}\" -b android\\build.gradle && exit %%ERRORLEVEL%%"

此命令将调用几个 Gradle 任务: enter image description here

我的完整管道有几个阶段,看起来像: enter image description here

我把上面的命令放在最后一个阶段 - 启动AT,我没有看到前面4个阶段有任何东西会影响AT运行 enter image description here

我的问题是: 当我在管道项目 1 上运行完整脚本时,我可以看到 Appium Settings apk 在屏幕上闪烁(这通常意味着 Appium 服务器已启动),然后什么也没有发生,这是日志 enter image description here

我尝试分离命令并在管道项目2中单独运行它 enter image description here

我可以看到我的调试应用程序在 Appium 设置 apk 闪烁后成功运行,这是我期望的日志 enter image description here

有人可以帮忙吗,我这个月才开始使用 Jenkins pipeline,我真的很困惑。

android jenkins-pipeline appium ui-automation android-uiautomator
1个回答
0
投票

我分解了脚本中的每个阶段,并用 Gradle 命令重新组合它们,最后我证明了我的观点,即前面的 4 个阶段与最后一个阶段无关,并且我找到了问题的根源。 导致我问题的原因是我在环境块中设置的环境变量 HTTP_PROXY,我不知道 Appium 在调用 uiautomator2 时将使用什么,我仍然不知道,这只是我的猜测。

© www.soinside.com 2019 - 2024. All rights reserved.