fix(ios): select Quick Question draft after focus
TestFlight / Build and upload (push) Successful in 1m52s
TestFlight / Build and upload (push) Successful in 1m52s
This commit is contained in:
@@ -37,7 +37,7 @@ final class QuickQuestionSelectionUITests: XCTestCase {
|
||||
XCTAssertEqual(prompt.value as? String, "abc")
|
||||
}
|
||||
|
||||
func testQuickQuestionReappearanceSelectsRetainedDraftForReplacement() {
|
||||
func testQuickQuestionDismissalAndReappearanceSelectsRetainedDraftForReplacement() {
|
||||
app.launch()
|
||||
openQuickQuestionFromHomeScreen()
|
||||
|
||||
@@ -47,8 +47,12 @@ final class QuickQuestionSelectionUITests: XCTestCase {
|
||||
prompt.typeText("retained draft")
|
||||
XCTAssertEqual(prompt.value as? String, "retained draft")
|
||||
|
||||
// A second real home-screen Quick Question action advances the existing
|
||||
// focus request. The original TextSelection binding selects the draft.
|
||||
dismissQuickQuestion()
|
||||
let dismissed = XCTNSPredicateExpectation(predicate: NSPredicate(format: "exists == false"), object: prompt)
|
||||
wait(for: [dismissed], timeout: 5)
|
||||
|
||||
// Reopen through the same home-screen Quick Question route after the
|
||||
// sheet has actually disappeared.
|
||||
openQuickQuestionFromHomeScreen()
|
||||
|
||||
XCTAssertTrue(prompt.waitForExistence(timeout: 10))
|
||||
@@ -62,6 +66,14 @@ final class QuickQuestionSelectionUITests: XCTestCase {
|
||||
app.textFields["Ask anything..."]
|
||||
}
|
||||
|
||||
private func dismissQuickQuestion() {
|
||||
let header = app.staticTexts["Quick question"]
|
||||
XCTAssertTrue(header.waitForExistence(timeout: 5))
|
||||
let dismissStart = header.coordinate(withNormalizedOffset: CGVector(dx: 0.5, dy: 0.5))
|
||||
let dismissEnd = app.coordinate(withNormalizedOffset: CGVector(dx: 0.5, dy: 0.9))
|
||||
dismissStart.press(forDuration: 0.1, thenDragTo: dismissEnd)
|
||||
}
|
||||
|
||||
private func openQuickQuestionFromHomeScreen() {
|
||||
XCUIDevice.shared.press(.home)
|
||||
let sybilIcon = springboard.icons.matching(identifier: "Sybil").firstMatch
|
||||
|
||||
Reference in New Issue
Block a user