Skip to content

Commit 781d876

Browse files
Merge pull request mxcl#406 from programmerdave/fix-photo-picker-test
Make Image Picker test more reliable
2 parents 453b001 + b68e6cd commit 781d876

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Tests/UITests/TestUIImagePickerController.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class UITest_UIImagePickerController_Swift: PMKiOSUITestCase {
3131
let tablesQuery = app.tables
3232
tablesQuery.staticTexts["3"].tap()
3333
tablesQuery.childrenMatchingType(.Cell).elementBoundByIndex(0).tap()
34-
app.collectionViews.childrenMatchingType(.Cell).matchingIdentifier("Photo, Landscape, August 08, 2012, 4:55 PM").elementBoundByIndex(0).tap()
34+
app.collectionViews.childrenMatchingType(.Cell).matchingPredicate(NSPredicate(format: "SELF.label BEGINSWITH %@", argumentArray: ["Photo, Landscape, August 08, 2012"])).elementBoundByIndex(0).tap()
3535

3636
XCTAssertTrue(value)
3737
}
@@ -41,7 +41,7 @@ class UITest_UIImagePickerController_Swift: PMKiOSUITestCase {
4141
let tablesQuery = app.tables
4242
tablesQuery.staticTexts["4"].tap()
4343
tablesQuery.buttons["Moments"].tap()
44-
app.collectionViews.childrenMatchingType(.Cell).matchingIdentifier("Photo, Landscape, August 08, 2012, 4:55 PM").elementBoundByIndex(0).tap()
44+
app.collectionViews.childrenMatchingType(.Cell).matchingPredicate(NSPredicate(format: "SELF.label BEGINSWITH %@", argumentArray: ["Photo, Landscape, August 08, 2012"])).elementBoundByIndex(0).tap()
4545

4646
XCTAssertTrue(value)
4747
}

0 commit comments

Comments
 (0)