- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我已经使用 calabash-android 开发了一个测试。一切都按应有的方式运行。现在我想在 Jenkins 中运行场景。
1) 我应该在 Jenkins 中安装哪个插件?
2) 如何运行测试?目前我使用的命令是: calabash-android run ,我没有实现其他方式。
3) 我必须在服务器中额外安装什么?
最佳答案
Android Emulator plugin
.您需要一个虚拟设备来运行您的测试。Rake
和RVM
插件here .您需要在 jenkins
中安装 ruby
,以便使用 calabash-android
gem 运行您的测试。jenkins
中创建shell 脚本
并安装Bundler
.将 gemfile
添加到您的工作区并指定所需的 gem。在我们的例子中,我们需要 calabash-android
gem:
# A sample Gemfile
source "https://rubygems.org"
# gem "rails"
gem "calabash-android", "0.5.12"
使用 shell 脚本在 jenkins
中运行 bundle install
。它将安装 calabash-android
gem。
从包含4th 步骤的gemfile
的文件夹运行您的测试。此时你应该在 jenkins
中安装了 bundler
和 calabash-android
。
bundle exec calabash-android run "PATH_TO_APK"ADB_DEVICE_ARG=${ANDROID_AVD_DEVICE}
${ANDROID_AVD_DEVICE}
- 模拟器名称,由 Android 模拟器插件
提供。
您可能还需要 Cucumber reports plugin
和 Cucumber test results plugin
.
更新:Jenkins
作业和 shell 脚本的屏幕截图。
calabash
文件夹位于Android
项目的根文件夹中。
Cucumber.yml
文件包含不同的 cucumber 相关设置。特别是该平台有特定的功能。并且可以使用参数 "-p android"
或 "-p ios"
选择平台。
.calabash_settings
包含有关在构建期间用于 .apk
签名的 keystore
的信息。 Calabash
需要相同的 keystore
用于 test_server
签名。
run_android_features 脚本:
cd ..
PARAMS="-p android"
while getopts ":rd:" OPTION; do
case $OPTION in
r)
PARAMS=$PARAMS" --format json -o cucumber.json"
;;
d)
PARAMS=$PARAMS" ADB_DEVICE_ARG=$OPTARG"
;;
[?]) echo "Usage: $0 [-r] [-d DEVICE_ID].\n -r: should create reports.\n DEVICE_ID: where to run tests."
exit 1;;
esac
done
# clear old files
rm -rf screenshot*
rm -rf test_servers
# resign apk
bundle exec calabash-android build "../app/build/outputs/apk/app-debug.apk"
# run tests
bundle exec calabash-android run "../app/build/outputs/apk/app-debug.apk" $PARAMS
关于android - 在 jenkins android 中集成 Calabash,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26482892/
我正在定义自定义葫芦步骤(在 iOS 和 Android 上使用),并且希望有选择地覆盖各种预定义步骤。一个例子是: Given /^I press the "([^\"]*)" button$/ d
有人可以发布一些帮助。我尝试了不同的配置,但无法从 Rubymine 中运行 Calabash Android 测试。虽然在终端上工作。 最佳答案 经过一些试验和错误,终于找到了解决方案。以下是您需要
如何在特定场景下更改 Hook 中的代码以重置(iOS)应用程序? 仅适用于标签提及为@reset 的场景 最佳答案 https://github.com/cucumber/cucumber/wiki
如何在 calabash-ios 和 calabash-android 中找到相关的 WebView 元素。我知道两者之间的语法略有不同,但问题是一样的。这是一个例子: 1) This query
如何使用 Calabash-Android 的 v0.5 旋转屏幕?因为先前包含在 rotation.rb 文件中的预定义旋转步骤已被删除。 最佳答案 我想分享将设备方向更改为所需的纵向或横向的命令:
我在 IOS 和 Android 的移动自动化中使用了 Appium。我想知道提供 Calabash 的优势,以及这两种工具生成的脚本是否有共同点? 我已经点击了这个链接:Appium VS Cala
尝试运行 ..-cal calabash-ios 项目的目标时出现链接错误。 错误是: `Ld /Users/balaiyan/Library/Developer/Xcode/Derived
我正在尝试获取 native 应用程序中切换开关的状态。 这是开关本身的查询,ON时: query "Switch id:'quadrant_buzz'" 及其结果 [ [0] {
我发现了 Calabash,将其与 cucumber 一起使用,但我遇到了问题。 我开始编写一些代码来测试我的基本应用: Scenario: I can see a button Test Butto
我刚开始使用 Calabash 并遇到了一个 ListView 。 对于每个 ListView 行,我想检查一些文本和 ImageView 是否存在。 但是我不确定如何遍历 ListView ? 有点
我很好奇它是如何获取 Android Activity 中的 UI 元素的 ID 并模拟不同的事件的? iOS 也是如此吗? 最佳答案 在内部,calabash 使用在手机上运行的检测后端。这个后端是
我在 auth.feature 文件中有一个场景: Scenario: Authorize Given I am on the Main View When I touch the "ServiceB
我已经使用 calabash 创建了跨平台测试。当我尝试测试我启动的 android 应用程序时: calabash-android run -p android 但是 calabash 试图在手机模
看起来像葫芦pre-defined steps不足以满足我的使用需求。 我的场景是这样的: - 如果用户第一次登录,我的应用程序会弹出一个包含 EditText 字段的 View ,要求用户输入昵称,
我的 android 应用程序项目以编程方式启动系统对话框以安装受信任的 CA 证书: Intent intent = KeyChain.createInstallIntent(); intent.p
我正在使用 Calabash 通过 UI 自动执行一些测试,但我遇到了一些问题。 我的步骤如下:Then I touch the "login" button . 当我运行 cucumber ,控制台
我正在使用 Calabash 实现 GUI 测试。在 The Cucumber Book需要强调的是,场景应该在本地设置测试数据本身,最好使用诸如 factory_girl 之类的库。 .这个问题是关
我是 Calabash 测试的新手,在尝试制作多语言应用程序时遇到了障碍。这是我的测试场景:- 我选择一个文本字段。- 使用一种语言输入字符串,然后使用另一种语言输入一些文本。 这里出现了障碍:当我尝
我正在尝试在 Windows 8 上运行 calabash-android。我已经安装了 Ruby 2.0.0 并添加了以下路径(系统变量): ANDROID_HOME = C:\Developmen
我正在为 Android 应用程序运行 calabash-android 测试。我需要将图像和视频附加到特定部分。我可以到达图库部分,然后无法从设备库中选择项目。有没有办法在我的测试目录中保留视频和图
我是一名优秀的程序员,十分优秀!