[英]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.