-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
UI Tests for Reset Password [fdl deprecation] (#13999)
- Loading branch information
Showing
1 changed file
with
54 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -255,6 +255,60 @@ class AuthenticationExampleUITests: XCTestCase { | |
) | ||
} | ||
|
||
func testResetPasswordLinkCustomDomain() { | ||
// assuming action type is in-app + continue URL everytime the app launches | ||
|
||
// set Authorized Domain as Continue URL | ||
let testContinueURL = "fir-ios-auth-sample.firebaseapp.com" | ||
app.staticTexts["Continue URL"].tap() | ||
app.alerts.textFields.element.typeText(testContinueURL) | ||
app.buttons["Save"].tap() | ||
|
||
// set Custom Hosting Domain as Link Domain | ||
let testLinkDomain = "http://firebaseiosauthsample.testdomaindonotuse.com" | ||
app.staticTexts["Link Domain"].tap() | ||
app.alerts.textFields.element.typeText(testLinkDomain) | ||
app.buttons["Save"].tap() | ||
|
||
app.staticTexts["Request Password Reset"].tap() | ||
let testEmail = "[email protected]" | ||
app.alerts.textFields.element.typeText(testEmail) | ||
app.buttons["Save"].tap() | ||
|
||
// Go back and check that there is no user that is signed in | ||
app.tabBars.firstMatch.buttons.element(boundBy: 1).tap() | ||
wait(forElement: app.navigationBars["User"], timeout: 5.0) | ||
XCTAssertEqual( | ||
app.cells.count, | ||
0, | ||
"The user shouldn't be signed in and the user view should have no cells." | ||
) | ||
} | ||
|
||
func testResetPasswordLinkDefaultDomain() { | ||
// assuming action type is in-app + continue URL everytime the app launches | ||
|
||
// set Authorized Domain as Continue URL | ||
let testContinueURL = "fir-ios-auth-sample.firebaseapp.com" | ||
app.staticTexts["Continue URL"].tap() | ||
app.alerts.textFields.element.typeText(testContinueURL) | ||
app.buttons["Save"].tap() | ||
|
||
app.staticTexts["Request Password Reset"].tap() | ||
let testEmail = "[email protected]" | ||
app.alerts.textFields.element.typeText(testEmail) | ||
app.buttons["Save"].tap() | ||
|
||
// Go back and check that there is no user that is signed in | ||
app.tabBars.firstMatch.buttons.element(boundBy: 1).tap() | ||
wait(forElement: app.navigationBars["User"], timeout: 5.0) | ||
XCTAssertEqual( | ||
app.cells.count, | ||
0, | ||
"The user shouldn't be signed in and the user view should have no cells." | ||
) | ||
} | ||
|
||
// MARK: - Private Helpers | ||
|
||
private func signOut() { | ||
|