-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add expectation when checking email text field value
- Loading branch information
1 parent
6520201
commit 0f1bfe6
Showing
1 changed file
with
9 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -148,7 +148,15 @@ class FireWindowTests: XCTestCase { | |
let coordinate = autoFillPopup.coordinate(withNormalizedOffset: CGVector(dx: 0.5, dy: 0.5)) | ||
coordinate.tap() | ||
|
||
XCTAssertEqual(emailTextFieldFire.value as? String, "[email protected]") | ||
// Use an expectation to wait for the value to update | ||
let expectedValue = "[email protected]" | ||
let valuePredicate = NSPredicate(format: "value == %@", expectedValue) | ||
|
||
let expectation = XCTNSPredicateExpectation(predicate: valuePredicate, object: emailTextFieldFire) | ||
|
||
let result = XCTWaiter().wait(for: [expectation], timeout: UITests.Timeouts.elementExistence) | ||
XCTAssertEqual(result, .completed, "The email text field value did not update as expected.") | ||
XCTAssertEqual(emailTextFieldFire.value as? String, expectedValue) | ||
} | ||
} | ||
|
||
|