从命令行

时间:2017-12-14 16:36:40

标签: ios unit-testing xctest xcode-ui-testing xcuitest

我使用XCUITest为我的iOS UI Automation设置了所有设置,我可以通过

运行单独的测试套件
xcodebuild test -project <path> -scheme <name> -destination <specifier> -only-testing:TestBundle/TestSuiteName

我也用过这个命令

xcodebuild test -workspace <path> -scheme <name> -destination <specifier> -only-testing:TestBundle/TestSuiteName/TestCase1 -only-testing:TestBundle/TestSuiteName/TestCase2

使用这个我运行这两个测试,但它们按字母顺序执行,而不是按我在命令中指定它们的顺序执行。

有没有办法可以决定我的测试用例执行顺序? 有没有办法可以通过comamnd线运行个人/可选择的测试用例?

我知道我们可以使用类似testInvocation的东西来实现我的问题的解决方案,但我无法理解如何。我正在使用swift。

有人可以帮助我...在此先感谢!!

1 个答案:

答案 0 :(得分:0)

无法做到这一点。当您运行单个命令时,xcTest框架会处理此问题,以便在banckend中按字母顺序运行测试用例。

如果您想以预定义的顺序运行测试用例那么您必须使用单独的命令,这非常耗时。

最好在测试套件中处理这个并相应地命名