简体   繁体   English

Xcode UI测试流程

[英]Xcode UI Testing Processes

I'm new to UI Testing and am struggling to find any documentation. 我不熟悉UI测试,正在努力寻找任何文档。 Could anyone explain the relationship between the different processes that are running while conducting UI testing? 谁能解释在进行UI测试时正在运行的不同进程之间的关系? From what I have researched, there is one process running the target application, and another running the test code. 根据我的研究,有一个进程在运行目标应用程序,另一个进程在运行测试代码。 How do the two interact? 两者如何相互作用?

The process running the test code has access only to the UI hierarchy of the target application (unless you're doing sneaky signal passing) and cannot access or modify the data or app logic. 运行测试代码的进程只能访问目标应用程序的UI层次结构(除非您正在进行暗中传递信号),并且不能访问或修改数据或应用程序逻辑。 The UI hierarchy is called using titles, labels, accessibilityIdentifiers, or accessibilityLabels somewhat interchangeably with a CSS-like selector syntax. UI层次结构使用标题,标签,accessibilityIdentifiers或accessibilityLabel与类似于CSS的选择器语法互换使用。

For documentation, there isn't really any of substance from Apple; 对于文档来说,Apple实际上没有任何实质内容。 I'd recommend taking a look at Joe Masilotti's "UI Testing in XCode 7": http://masilotti.com/ui-testing-xcode-7/ 我建议您看一下Joe Masilotti的“ XCode 7中的UI测试”: http ://masilotti.com/ui-testing-xcode-7/

I can't leave comments, but a note for when you are UI testing your app, if you have environment variables you will need to pass the environment variables set for your test into your app instance. 我不能留下任何评论,但要为您在UI测试应用程序时提供注释,如果您有环境变量,则需要将为测试设置的环境变量传递到应用程序实例中。 This one liner helped me out a lot. 这一班轮帮了我很多。

app.launchEnvironment = ProcessInfo.processInfo.environment

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

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