简体   繁体   English

iOS测试和UITests混淆

[英]iOS Tests and UITests Confusion

When I create an iOS AppTests and AppUITests target, i see some difference. 创建iOS AppTests和AppUITests目标时,我看到了一些区别。

  • AppTest target setting has an extra option "Allow testing host application APIs", But AppUITests target has no such option. AppTest目标设置还有一个附加选项“允许测试主机应用程序API”,但是AppUITests目标没有这样的选项。 So what does it do and why they are different? 那么,它有什么作用,又为何与众不同?

测验 UITests

  • AppTests target does not ask for any provisioning profile, but AppUITests targets give error if provisioning profile is not set. AppTests目标不要求提供任何配置文件,但是如果未设置配置文件,则AppUITests目标会给出错误。 I know "Automatically manage Signing" might fix this issue. 我知道“自动管理签名”可能会解决此问题。 But i don't want to allow Xcode to upload some bundles, certs & profiles into my Server on its own (to be clear whats going on). 但我不想让Xcode自行将某些捆绑包,证书和配置文件上传到我的服务器中(以明确发生的情况)。 I need to know why its asking for AppUITest but not for AppTest. 我需要知道为什么它要求AppUITest而不是AppTest。 Is it because UITests need real device installation? 是因为UITests需要真正的设备安装?

测验 UITests

How can I get rid of this extra bundle id, profile management hassle for AppUITests target? 我该如何摆脱AppUITests目标的额外捆绑包ID和配置文件管理的麻烦?

Guidance will be appreciated. 指导将不胜感激。

From last few days I am also searching such type of things . 从最近的几天开始,我也在搜索这类东西。 There are two type of testing 有两种类型的测试

  1. Unit testing 单元测试
  2. UI testing UI测试

Most probably you already awared from this two types. 您很可能已经从这两种类型中意识到了。

For your first point see below image provide by WWDC Video , 关于第一点,请参见下图, WWDC Video提供,

在此处输入图片说明

Unit test use Host App that means your app coding during the testing time. 单元测试使用Host App ,这意味着您在测试期间对应用进行编码。 But UI testing UI test bundle is loaded into Target app which is different from the Host app. 但是UI测试UI测试包已加载到Target应用程序中 ,与Host应用程序不同。

As I done R&D here 当我在这里进行研发时

  • Testtests is for unit test file and, Testtests用于单元测试文件,并且
  • TestUItests is for UI test. TestUItests用于UI测试。

For 2nd point I don't have idea because I never tried this. 对于第二点,我没有主意,因为我从未尝试过。

If you got some better result then me Please update me too. 如果您有更好的结果,那我也请更新我。 Thanks. 谢谢。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM