Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Helpful additions for XCTest, starting with a method to wait until an XCUIElement appears before continuing

License

Notifications You must be signed in to change notification settings

daniel-hall/DHTestingAdditions

Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DHTestingAdditions

Helpful additions for XCTest, starting with a method to wait until an XCUIElement appears before continuing

Installation

Download and copy the DHTestingAdditions folder into your project and add it to your UI Testing target.

Example Usage

- (void)testTapGoButton {  
	XCUIApplication *app = [[XCUIApplication alloc] init];
	XCUIElement *goButton = app.buttons[@"Go"];
	[self waitUntilElementExists:goButton withTimeout:5.0f]; //<-- execution will not continue past this line until the element exists, or the timeout expires (which will cause the test to fail)

	[goButton tap]; //<-- This line will only be reached and executed if the -waitUntilElementExists:withTimeout: method on the line above succeeds

	XCUIElement *nextScreenLabel = app.staticTexts[@"You have arrived on the next screen!"];
	XCTAssertEqual(nextScreenLabel.exists, YES);
}

To see this example in an actual running test, download the entire repository and execute the DHTestingAdditionsExample project UI Test target.

About

Helpful additions for XCTest, starting with a method to wait until an XCUIElement appears before continuing

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
Morty Proxy This is a proxified and sanitized view of the page, visit original site.