Skip to content

SDK for seamless UI tests recording on iOS using native XCTest framework

License

Notifications You must be signed in to change notification settings

Appelium/AppeliumTests

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

75 Commits
 
 
 
 
 
 
 
 

Repository files navigation

AppeliumTests iOS SDK

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.

Installation

CocoaPods

To integrate AppeliumTests SDK into your Xcode project using CocoaPods, add it to your Podfile:

target 'YourUITestsTarget' do
	pod 'AppeliumTests'
end

Then, run the following command:

$ pod install

Usage

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.

  1. In your UI Tests target, create a simple class called UITestsSetup:

    class UITestsSetup: NSObject {
    
    	override init() {
    		super.init()
    		
    		AppeliumTests.start(apiKey: <#api key#>)
    		AppeliumTests.screenRecordingEnabled = true
    	}
    	
    }

    You can create an api key or find an existing one here.

  2. In the Info.plist file 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 the UITestsSetup class.

  3. Run the tests :)