Appelium is a platform and a set of tools for improving the quality of mobile apps.
AppeliumTests is a companion SDK to be integrated into your UI Testing target in order to enable tests reporting to Appelium dashboard.
The SDK automatically captures videos of all of your tests and supplements them with full application logs, network logs and a screenshot at the time of test failure.
For more info, visit Appelium.com.
To integrate AppeliumTests SDK into your Xcode project using Carthage, add this to your Cartfile:
binary "https://api.appelium.com/v1/sdkArchives/AppeliumTestsKit.json"
Then run:
carthage update --platform iOS --use-xcframeworksOnce it finishes, drag the AppeliumTestsKit.xcframework into your UI Tests target.
Since the UI Tests on iOS are not a self contained app they don't have such an obvious entry point as application:didFinishLaunchingWithOptions:.
In order to workaround this, we can use a mechanism provided by the NSPrincipalClass.
-
In your UI Tests target, create a simple class called
UITestsSetup:@MainActor class UITestsSetup: NSObject { override init() { super.init() AppeliumTests.start(apiKey: <#api key#>) AppeliumTests.screenRecordingEnabled = true } }
You can create an
api keyor find an existing one here. -
In the
Info.plistfile of your UI Tests bundle add the following key:<key>NSPrincipalClass</key> <string>UITests.UITestsSetup</string>
Note the
UITests.prefix - it is the name of the Swift module where we created theUITestsSetupclass. -
Run the tests :)