Xcode 使用bwoken和tuneupJS实现UIAutomation

Xcode 使用bwoken和tuneupJS实现UIAutomation,xcode,testing,instruments,ui-automation,ios-ui-automation,Xcode,Testing,Instruments,Ui Automation,Ios Ui Automation,我正在尝试使用bwoken和tuneupJS设置UIAutomation。除了安装版本2.1.0rc.2以消除Xcode 6中的模板路径更改之外,我遵循了列出的安装步骤。因此,我的文件如下所示: # A sample Gemfile source "https://rubygems.org" # gem "rails" gem 'bwoken', '2.1.0.rc.2' gem 'cocoapods' 我编写了一个简单的测试,只是为了看看在运行控制台时是否能从控制台获得任何信息: #imp

我正在尝试使用bwoken和tuneupJS设置UIAutomation。除了安装版本2.1.0rc.2以消除Xcode 6中的模板路径更改之外,我遵循了列出的安装步骤。因此,我的文件如下所示:

# 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
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()[“搜索按钮”]点击 2014-11-17 16:08:01+0000调试:target.frontMostApp().mainWindow().buttons()[“保存”].tap()) 2014-11-17 16:08:01+0000调试:target.frontMostApp().mainWindow().buttons()[“搜索按钮”]点击 2014-11-17 16:08:03+0000调试:target.frontMostApp().mainWindow().buttons()[7].tap() 2014-11-17 16:08:03+0000调试:target.frontMostApp().mainWindow().buttons()[“搜索按钮”]点击 2014-11-17 16:08:04+0000调试:target.frontMostApp().mainWindow().buttons()[“保存”].tap()) 2014-11-17 16:08:04+0000通过:示例测试

    仪器跟踪完成(持续时间:7.199495s

    输出:/Users/me/Documents/Project/MyApp/instrumentscli8.trace)


    我在报告中发现了类似的问题

    您需要做的是通过执行以下操作查找可用设备:

    instruments -s
    
    这将打印与以下类似的可用设备列表:

    Known Devices:
    Jakub’s MacBook Pro [FFBE27F6-3076-59B7-B14F-40E92F1366FD]
    iPad (7.1.2) [07056cc29131036c74d215ba52a9be605dc9e64a]
    Resizable iPad (8.1 Simulator) [26038DBD-791C-421E-99F4-9153CA726A2F]
    Resizable iPhone (8.1 Simulator) [31B2F0AE-3547-4189-A561-CD2088F6C645]
    iPad 2 (8.1 Simulator) [683233C4-EC2B-48A3-826B-10EF62A875CD]
    iPad Air (8.1 Simulator) [6358A6F5-2FD0-4377-BD32-0A2C3329276D]
    iPad Retina (8.1 Simulator) [224533ED-94DA-46CC-B1DB-1781A1C80710]
    iPhone 4s (8.1 Simulator) [D114BC7E-A913-4063-A349-C119BAFC06DA]
    iPhone 5 (8.1 Simulator) [7AF6D6F4-C6BC-4A47-B83C-3A4B43ABE0DD]
    iPhone 5s (8.1 Simulator) [BE82D607-466A-43E5-863D-6A05F217C117]
    iPhone 6 (8.1 Simulator) [D183FF05-3023-4FB5-BEA0-290EA881040A]
    iPhone 6 Plus (8.1 Simulator) [0AFCC9AB-7C59-48C7-9BFB-FBF4865B7A63]
    
    请注意,MacBookPro是第一款产品,据称这是这里的根本问题。现在,您可以通过拨打以下电话来解决此问题:

    bwoken test --device D183FF05-3023-4FB5-BEA0-290EA881040A
    
    我希望这对某人有帮助