Comment on page
Swift
An example UI testing bundle
AppfigurateExampleUITests
is available in AppfigurateExample
. To test AppfigurateExample (Swift 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.Tap on your
APLConfiguration
subclass in the project navigator. In File inspector ‣ Target membership, tick on your UI testing bundle.

In your
APLConfiguration
subclass, ensure that your allowInvalidSignatures method returns true
when running automation tests. (Test schemes are by default run with a DEBUG build).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.Swift example
addUIInterruptionMonitor(withDescription: "Appfigurate") { alert -> Bool in
alert.buttons["OK"].tap()
alert.buttons["Ignore"].tap()
return true
}
- 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.
Swift example
let c = ExampleConfiguration()
c.boolean = false
c.string_Textfield = "thursday"
- Apply the result of
APLConfiguration
automationLaunchArguments method toXCUIApplication launchArguments
property. - Launch your app.
Swift example
app = XCUIApplication()
app.launchArguments = c.automationLaunchArguments()
app.launch()
Once your app is launched, the configuration you set in Create instance of APLConfiguration subclass will be applied before executing each test case.
See also automationLaunchArgumentsReset and automationLaunchArgumentsWithAction methods of
APLConfiguration
.Last modified 8mo ago