XCTestCase
associated object
-
stored an associated app in XCTestCase‘s instance
Declaration
Swift
var app: XCUIApplication { get set }
-
Try to force launch the application. This structure tries to ovecome the issues described at https://forums.developer.apple.com/thread/15780
Declaration
Swift
func tryLaunch<T>(arguments: [T], count counter: Int = 10, wait: UInt32 = 2) where T : RawRepresentable, T.RawValue == StringParameters
argumentsAn array of RawRepresentable iterms that will be passed on as arguments
counterThe retry counter for trying to startup the app (Default is 10)
waitThe number of seconds to wait. Slower test machines might require a longer wait
-
Declaration
Swift
func tryLaunch(count counter: Int = 10) -
kill App And Relaunch
Declaration
Swift
func killAppAndRelaunch() -
Try to force closing the application
Declaration
Swift
func tryTearDown(wait: UInt32 = 2)Parameters
waitThe number of seconds to wait. Slower test machines might require a longer wait
-
Declaration
Swift
func isSimulator() -> Bool -
take a Screenshot
Declaration
Swift
func takeScreenshot(activity: XCTActivity, name: String = "Screenshot")Parameters
activityXCTContext.runActivity
namethe name of attachment
-
defalut a Screenshot
Declaration
Swift
func takeScreenshot(groupName: String = "--- Screenshot ---", name: String = "Screenshot")Parameters
groupNamegroupName description
nameattachment name
-
swifty UITest syntactic sugar
Declaration
Swift
func group(text: String = "Group", closure: (_ activity: XCTActivity) -> ())Parameters
textgroup text description
closuregroup content code
-
hide the system’s and app’s alerts
Declaration
Swift
func hideAlertsIfNeeded() -
only apply real iOS machine
XCTestCase Extension Reference