Objective-C
An example UI testing bundle AppfigurateExampleUITests
is available in AppfigurateExample
. To test, ensure AppfigurateExample (ObjC iOS)
is selected as the scheme, then long tap the run button to show more options and tap Test
(⌘U).
As your target app links AppfigurateLibrary.xcframework
, Xcode will automatically make the framework available for the testing target.
Add APLConfiguration subclass to UI testing bundle
Tap on your APLConfiguration
subclass in the project navigator. In File inspector ‣ Target membership, tick on your UI testing bundle.
Ensure allowInvalidSignatures returns YES
In your APLConfiguration
subclass, ensure that your allowInvalidSignatures method returns YES
when running automation tests. (Test schemes are by default run with a DEBUG build).
Add a UIInterruptionMonitor
When the configuration is applied to the application on launch, the standard Appfigurate 'Configuration applied' alert is displayed. You can optionally add an UIInterruptionMonitor
to your XCTestCase
to automatically dismiss this alert.
Objective-C example
Create instance of APLConfiguration subclass
Create an instance of your
APLConfiguration
subclass in yourXCTestCase
. A good place to do this in the setUp method.Set the properties required to be applied to your app to allow it to be tested correctly.
Objective-C example
Apply configuration to XCUIApplication
Apply the result of
APLConfiguration
automationLaunchArguments method toXCUIApplication launchArguments
property.Launch your app.
Objective-C example
Once your app is launched, the configuration you set in Create instance of APLConfiguration subclass will be applied before executing each test case.
Additional automation launch methods
See also automationLaunchArgumentsReset and automationLaunchArgumentsWithAction methods of APLConfiguration
.
Last updated