【发布时间】:2015-01-14 13:20:20
【问题描述】:
我正在尝试使用 bwoken 和 tuneupJS 设置我的 UIAutomation。我按照here 列出的安装步骤操作,除了我安装了 2.1.0rc.2 版本以摆脱 Xcode 6 中的模板路径更改。因此我的 Gemfile 看起来像这样:
# A sample Gemfile
source "https://rubygems.org"
# gem "rails"
gem 'bwoken', '2.1.0.rc.2'
gem 'cocoapods'
我编写了一个简单的测试,只是为了看看我在运行它时是否在控制台中得到任何东西:
#import "../../../../Pods/tuneup_js/tuneup.js"
test("Example test", function(target, app) {
var searchButton = target.frontMostApp().mainWindow().buttons()["Search Button"];
assertTrue(searchButton.isValid(), "Search Button should be available on the screen");
searchButton.tap();
var saveSearchButton = target.frontMostApp().mainWindow().buttons()["Save"];
assertTrue(saveSearchButton.isValid(), "Save Button should be available on the screen");
saveSearchButton.tap();
searchButton.tap();
// tap on the background
target.frontMostApp().mainWindow().buttons()[7].tap();
searchButton.tap();
saveSearchButton.tap();
});
这是我回来的:
Building......................................................................
Build Successful!
iphone FirstScript.js
ipad FirstScript.js
FirstScript.js 是我粘贴的测试脚本。这看起来不对,我假设我应该得到更详细的输出,就像 bwoken github 页面上示例中的输出一样。所以问题是:我在这里遗漏了什么,我哪里出错了,所以我的测试没有执行?
我在玩bwoken的时候还发现了一些其他的问题:
- 当我尝试使用 --verbose 标志时,唯一发生的事情是 构建,没有输出表明任何测试已开始。
- 当我使用 --skip-build 标志时,它似乎没有任何效果,工作区仍在构建中
- 我错过了一些关于#github 指令的文档,即如何导入使用#github 获得的文件?它们在哪里下载?
编辑: 我尝试直接使用 Instruments 命令运行相同的命令,它似乎工作正常:
2014-11-17 16:08:00 +0000 开始:示例测试 2014-11-17 16:08:01 +0000 调试:target.frontMostApp().mainWindow().buttons()["Search Button"].tap() 2014-11-17 16:08:01 +0000 调试:target.frontMostApp().mainWindow().buttons()["Save"].tap() 2014-11-17 16:08:01 +0000 调试:target.frontMostApp().mainWindow().buttons()["Search Button"].tap() 2014-11-17 16:08:03 +0000 调试:target.frontMostApp().mainWindow().buttons()[7].tap() 2014-11-17 16:08:03 +0000 调试:target.frontMostApp().mainWindow().buttons()["Search Button"].tap() 2014-11-17 16:08:04 +0000 调试:target.frontMostApp().mainWindow().buttons()["Save"].tap() 2014-11-17 16:08:04 +0000 通过:示例测试
仪器跟踪完成(持续时间:7.199495 秒;
输出:/Users/me/Documents/Project/MyApp/instrumentscli8.trace)
【问题讨论】:
标签: xcode testing instruments ui-automation ios-ui-automation