Fix UI tests and Release builds. (#2248)

* Fix PollFormScreen UI tests.

* Fix compilation error on release builds.
This commit is contained in:
Doug
2023-12-14 15:09:29 +00:00
committed by GitHub
parent 872c807f56
commit 278cf06f44
3 changed files with 8 additions and 12 deletions

View File

@@ -25,8 +25,8 @@ class PollFormScreenUITests: XCTestCase {
func testFilledPoll() async throws {
let app = Application.launch(.createPoll)
let questionTextField = app.textFields[A11yIdentifiers.pollFormScreen.question]
questionTextField.tap()
let questionTextField = app.textViews[A11yIdentifiers.pollFormScreen.question]
questionTextField.coordinate(withNormalizedOffset: .init(dx: 0.5, dy: 0.5)).tap() // Tap isn't registered without the offset.
questionTextField.typeText("Do you like polls?")
let option1TextField = app.textFields[A11yIdentifiers.pollFormScreen.optionID(0)]
@@ -54,12 +54,9 @@ class PollFormScreenUITests: XCTestCase {
app.swipeUp()
}
addOption.tap()
app.typeText("\n") // Dismiss the keyboard so the Add button is always visible.
}
if app.keyboards.count > 0 {
app.typeText("\n")
}
app.swipeUp() // Dismisses the keyboard.
app.swipeUp() // Ensures that the bottom is shown.
XCTAssertFalse(addOption.exists)