[英]run test classes using xctest framework from a class
我面临一个问题。 我想为我的应用程序做一个ui测试。
我写了六个测试类,其中包括我的测试用例。
我可以使用以下方式运行测试用例
"command U" or the clicking in the run button.
但是我不想这样。
我想使用我要使用的代码运行测试类
xctest because after complete my execution, i have to do another task.
任何人都可以举一个例子,我如何使用来自类文件的xctest codding运行我的测试类。
我不想使用shell脚本或詹金斯,我希望通过使用xctest框架。
使用xcodebuild运行测试xcodebuild命令行工具像Xcode IDE一样驱动测试。 使用操作测试运行xcodebuild,并使用-destination参数指定不同的目标。 例如,要在本地OS X“我的Mac 64位”上测试MyApp,请使用以下命令指定目标位置和体系结构:
> xcodebuild test -project MyAppProject.xcodeproj -scheme MyApp -destination 'platform=OS X,arch=x86_64'
如果插入了支持开发的设备,则可以按名称或ID对其进行调出。 例如,如果您要测试其代码的iPod touch名为“ Development iPod touch”,则可以使用以下命令:
> xcodebuild test -project MyAppProject.xcodeproj -scheme MyApp -destination 'platform=iOS,name=Development iPod touch'
测试也可以在模拟器中运行。 使用模拟器可以轻松地针对不同的外形尺寸,操作系统和操作系统版本。 可以通过名称或ID指定模拟器目标。 例如:
> xcodebuild test -project MyAppProject.xcodeproj -scheme MyApp -destination 'platform=Simulator,name=iPhone,OS=8.1'
如您所见,您的选择是运行脚本或发送简单的电子邮件。 有关配置操作的更多信息,请参见https://michele.io/the-project-file-part-2/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.