-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve strategy for waiting for an item to disappear
- Loading branch information
1 parent
c907745
commit d409bd3
Showing
4 changed files
with
22 additions
and
8 deletions.
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
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
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
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import XCTest | ||
|
||
extension XCTestCase { | ||
func waitForDisappearance(of element: XCUIElement) { | ||
let doesNotExist = NSPredicate(format: "exists == 0") | ||
let elementToNotExist = expectation(for: doesNotExist, evaluatedWith: element) | ||
wait(for: [elementToNotExist], timeout: 3) | ||
} | ||
|
||
func waitForDisappearance(of element: PocketUIElement) { | ||
waitForDisappearance(of: element.element) | ||
} | ||
} |