0

我的XCode项目的测试计划中有一些配置,默认情况下,执行UI测试会执行所有配置,但是对于某些需求我需要根据CI上的某些条件排除一两个,我发现我可以指定什么方案或要执行的测试计划,但是有没有办法从命令行指定要包含或排除的测试计划配置?谢谢!

4

1 回答 1

0

您可以像这样传递配置:

$> xcodebuild test -workspace <path> 
                   -scheme <name> 
                   -destination <specifier>
                   -testPlan <name>
                   -only-test-configuration <configuration1> 
                   -only-test-configuration <configuration2>
                   ...

或者跳过这样的配置:

$> xcodebuild test -workspace <path> 
                   -scheme <name> 
                   -destination <specifier>
                   -testPlan <name>
                   -skip-test-configuration <configuration1> 
                   -skip-test-configuration <configuration2>
                   ...

帮助页面中的相关行:

$> xcodebuild -help
Usage: xcodebuild ...
Options:
    -workspace NAME                    build the workspace NAME
    -scheme NAME                       build the scheme NAME
    -destination DESTINATIONSPECIFIER  use the destination described by DESTINATIONSPECIFIER (a comma-separated set of key=value pairs describing the destination to use)
    -testPlan                          specifies the name of the test plan associated with the scheme to use for testing
    -only-test-configuration           constrains testing by specifying test configurations to include, and excluding other test configurations
    -skip-test-configuration           constrains testing by specifying test configurations to exclude, but including other test configurations
    ...
于 2021-10-22T08:58:07.960 回答