2017-06-01 60 views
0

我通过CocoaPods将EarlGrey添加到了我的iOS项目中。我创建了新的目标,如下所述:https://github.com/google/EarlGrey/blob/master/docs/install-and-run.mdiOS Earl Gray - 选择缺少参数

我的问题是,这个指令后,简单EarlGrey迅速测试误解释,它会导致生成错误Build error in PoC.swift

有没有人遇到过这样的问题?有什么我可以解决它吗?

因为我是iOS/EarlGrey的新手,所以我可以在任何可以添加到这个问题的东西上提出建议,使其更加具体。

RuntimeError - Test target group not found! 
/Users/karolgil/.rvm/gems/ruby-2.1.10/gems/earlgrey-1.9.3/lib/earlgrey/configure_earlgrey.rb:371:in `copy_swift_files' 
/Users/karolgil/.rvm/gems/ruby-2.1.10/gems/earlgrey-1.9.3/lib/earlgrey/extensions/analyzer_extensions.rb:25:in `block (2 levels) in analyze' 
/Users/karolgil/.rvm/gems/ruby-2.1.10/gems/earlgrey-1.9.3/lib/earlgrey/extensions/analyzer_extensions.rb:24:in `each' 
/Users/karolgil/.rvm/gems/ruby-2.1.10/gems/earlgrey-1.9.3/lib/earlgrey/extensions/analyzer_extensions.rb:24:in `block in analyze' 
/Users/karolgil/.rvm/gems/ruby-2.1.10/gems/earlgrey-1.9.3/lib/earlgrey/extensions/analyzer_extensions.rb:23:in `each' 
/Users/karolgil/.rvm/gems/ruby-2.1.10/gems/earlgrey-1.9.3/lib/earlgrey/extensions/analyzer_extensions.rb:23:in `analyze' 
/Users/karolgil/.rvm/gems/ruby-2.1.10/gems/cocoapods-1.2.1/lib/cocoapods/installer.rb:236:in `analyze' 
/Users/karolgil/.rvm/gems/ruby-2.1.10/gems/cocoapods-1.2.1/lib/cocoapods/installer.rb:150:in `block in resolve_dependencies' 
/Users/karolgil/.rvm/gems/ruby-2.1.10/gems/cocoapods-1.2.1/lib/cocoapods/user_interface.rb:64:in `section' 
/Users/karolgil/.rvm/gems/ruby-2.1.10/gems/cocoapods-1.2.1/lib/cocoapods/installer.rb:149:in `resolve_dependencies' 
/Users/karolgil/.rvm/gems/ruby-2.1.10/gems/cocoapods-1.2.1/lib/cocoapods/installer.rb:110:in `install!' 
/Users/karolgil/.rvm/gems/ruby-2.1.10/gems/cocoapods-1.2.1/lib/cocoapods/command/install.rb:41:in `run' 
/Users/karolgil/.rvm/gems/ruby-2.1.10/gems/claide-1.0.1/lib/claide/command.rb:334:in `run' 
/Users/karolgil/.rvm/gems/ruby-2.1.10/gems/cocoapods-1.2.1/lib/cocoapods/command.rb:52:in `run' 
/Users/karolgil/.rvm/gems/ruby-2.1.10/gems/cocoapods-1.2.1/bin/pod:55:in `<top (required)>' 
/Users/karolgil/.rvm/gems/ruby-2.1.10/bin/pod:23:in `load' 
/Users/karolgil/.rvm/gems/ruby-2.1.10/bin/pod:23:in `<main>' 
+0

您是否正在导入EarlGrey.swift? –

+0

我该如何检查?我像导入截图一样导入,使用'import EarlGrey'和Im不知道任何其他选项。 –

+0

您的语法是正确的。 select(elementWithMatcher :)代码来自EarlGrey.swift,它是在EarlGrey之上添加的Swift包装器,以获得更好的API兼容性。你可以检查你的来源,EarlGrey.swift是它的一部分吗? –

回答

2

看起来你还没有添加EarlGrey.swift,应该添加到您的测试目标:

意见后编辑

在下面的错误做gem install earlgreypod install命令后的结果自动安装earlgrey.gem并使用Pod来管理您的项目。另外请确保您已安装最新的earlgrey宝石。

Carthage。或者手动下载this file

+0

林接受这个答案,因为问题实际上是缺少EarlGrey.swift文件。重新运行'gem install earlgrey'和'pod install'后,测试成功运行了该应用程序。 –