XCTest/XCUITest is the testing framework supplied by Apple. You can create unit tests and UI tests in your Xcode project. Please refer to Apple Developer Official Doc for detailed introduction.
WeTest launches your uploaded XCTest packages on target mobile devices in parallel. You may specify different versions to run your tests.
Please follow the steps below to prepare your XCTest/XCUITest script(.zip file) for uploading to WeTest and start your test!
Option1:
Please use following command line to build your project.
xcodebuild -project YOUR_PROJECT.xcodeproj \
-scheme YOUR_SCHEME \
-derivedDataPath DERIVED_DATA_OUTPUTPATH \
-sdk iphoneos build-for-testing
Option2:
In Xcode, Click Product -> Buld For -> Testing to build your project.
WeTest accepts a zip file as the script package. Please zip all test script files(.xctestrun files and Debug-iphoneos directory) and/or a config file (xctest_config.json) into one .zip file.
cd DerivedData/yourProject/Build/Products
zip -r TestsOnWeTest.zip Debug-iphoneos your_xctestrun_file.xctestrun
Sample zip contents(XCTest/XCUITest)
Debug-iphoneos
<your_project>.xctestrun
[optional]xctest_config.json
File name: xctest_config.json with following file content.
{
"xcodeVersion":"12.3",
"disableResign": false
}
*You might set “11.6” or “12.3” as the value of “xcodeVersion” when device OS version less than or equals to iOS 14.8.
*You might set “13.0” as the value of “xcodeVersion” when device OS version large than or equals to iOS 15.0
*The default value of “disableResign” is false, namely, WeTest would resign your .app bundles before tests.
Please add the WeTest XCTest/XCUITest configuration file (xctest_config.json) into the test script package TestsOnWeTest.zip created in the previous step.
The WeTest XCTest configuration file is optional. If there is no xctest_config.json in the test script package, WeTest would use default settings to run the tests.
zip TestsOnWeTest.zip xctest_config.json