-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cover more user paths where UI tests ask to save password
- Loading branch information
Showing
5 changed files
with
27 additions
and
6 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
16 changes: 16 additions & 0 deletions
16
WordPress/UITestsFoundation/XCUIApplication+SavePassword.swift
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,16 @@ | ||
import XCTest | ||
|
||
extension XCUIApplication { | ||
|
||
// Starting with iOS 16.4, the Simulator might ask to save the password with a modal sheet. | ||
// This method encapsulates the logic to dimiss the prompt. | ||
func dismissSavePasswordPrompt() { | ||
XCTContext.runActivity(named: "Dismiss save password prompt if needed.") { _ in | ||
guard buttons["Save Password"].waitForExistence(timeout: 5) else { return } | ||
|
||
// There should be no need to wait for this button to exist since it's part of the same | ||
// alert where "Save Password" is. | ||
buttons["Not Now"].tap() | ||
} | ||
} | ||
} |
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