如何在测试服XCUI中禁用一些测试用例?

问题描述

当前,我遇到无法禁用某些测试用例(XCUI测试)的问题。

我已经尝试从模式中禁用大小写,当我从xcode测试时,它可以工作,但是当我从脚本中运行它时,它是行不通的。

我的脚本

/usr/bin/xcodebuild test-without-building -derivedDataPath "build" -workspace tako_ios_superapp.xcworkspace -scheme PlatformUITest -configuration Debug -UseModernBuildSystem=NO -destination "platform=iOS Simulator,name=Platform_Regression,OS=13.3" -resultBundlePath Platform '-only-testing:(my_app_target)/MY_Test_suit'

运行此脚本后,它仍将运行测试服中的每个测试用例。是否有人通过脚本禁用或跳过测试用例? ps。之所以必须使用命令是因为我必须使用CI,它需要脚本。

My Schema that I disable test case

解决方法

从命令行运行时,不使用Xcode运行/跳过模式配置。您需要明确列出要测试的内容和要跳过的内容。

有关更多详细信息和讨论,请参见How to use xcodebuild with -only-testing and -skip-testing flag?