Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
Loading