Skip to content

Commit 59b7408

Browse files
committed
Add new header text to fix failing DaysUntilBirthdayUITests.
1 parent 10b8034 commit 59b7408

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

Samples/Swift/DaysUntilBirthday/DaysUntilBirthdayUITests(iOS)/DaysUntilBirthdayUITests_iOS.swift

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ class DaysUntilBirthdayUITests_iOS: XCTestCase {
2323
"Would you like to save this password to use with apps and websites?"
2424
private let signInDisclaimerHeaderText =
2525
"Sign in to Days Until Birthday"
26+
private let returningUserSignInDisclaimerHeaderText =
27+
"You’re signing back in to Days Until Birthday"
2628
private let accessHeaderText = "Days Until Birthday wants access to your Google Account"
2729
private let additionalAccessHeaderText = "Days Until Birthday wants additional access to your Google Account"
2830
private let appTrustWarningText = "Make sure you trust Days Until Birthday"
@@ -191,7 +193,7 @@ extension DaysUntilBirthdayUITests_iOS {
191193
return false
192194
}
193195

194-
handleSignInDisclaimerIfNeeded()
196+
handleReturningUserSignInDisclaimerIfNeeded()
195197
handleAccessRequestIfNeeded()
196198

197199
return true
@@ -303,6 +305,18 @@ extension DaysUntilBirthdayUITests_iOS {
303305
}
304306
}
305307

308+
func handleReturningUserSignInDisclaimerIfNeeded() {
309+
let currentlyShowingReturningUserSignInDisclaimer =
310+
sampleApp.staticTexts[returningUserSignInDisclaimerHeaderText]
311+
.waitForExistence(timeout: timeout) &&
312+
sampleApp.buttons["Continue"]
313+
.waitForExistence(timeout: timeout)
314+
315+
if currentlyShowingReturningUserSignInDisclaimer {
316+
sampleApp.buttons["Continue"].tap()
317+
}
318+
}
319+
306320
/// This method looks for an account in the current view that reflects an already-signed-in state, and taps it.
307321
/// - returns: true if the signed-in account was found and tapped, otherwise returns false.
308322
func findAndTapExistingSignedInEmail() -> Bool {

0 commit comments

Comments
 (0)