iosswiftxcuitestuitest

How to disable some test case in Test suit XCUI?


Currently I have issue that I can't disable some test case ( XCUI Test ).

I already try to disable case from schema, It worked when I test from xcode but when I run it from script it doesn't work.

My Script

/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'

After I run this script, It still run every test case in test suit. Have someone ever disable or skip test case by script ? ps. The reason That I have to use command because I've to work with CI, It need script.

My Schema that I disable test case


Solution

  • When running from the command line, the Xcode run/skip schema configuration is not used. You need to explicitly list what to test and what to skip.

    See How to use xcodebuild with -only-testing and -skip-testing flag? for more detail and discussion.