Stabilize iOS UI test foundation and fix flaky suites
This commit is contained in:
@@ -12,10 +12,10 @@ struct NoteEditorScreen {
|
||||
|
||||
// MARK: - Elements
|
||||
|
||||
var navigationTitle: XCUIElement { app.navigationBars["Journal Note"] }
|
||||
var textEditor: XCUIElement { app.textViews["note_editor_text"] }
|
||||
var saveButton: XCUIElement { app.buttons["note_editor_save"] }
|
||||
var cancelButton: XCUIElement { app.buttons["note_editor_cancel"] }
|
||||
var navigationTitle: XCUIElement { app.navigationBars.firstMatch }
|
||||
var textEditor: XCUIElement { app.textViews[UITestID.NoteEditor.text] }
|
||||
var saveButton: XCUIElement { app.buttons[UITestID.NoteEditor.save] }
|
||||
var cancelButton: XCUIElement { app.buttons[UITestID.NoteEditor.cancel] }
|
||||
|
||||
// MARK: - Actions
|
||||
|
||||
@@ -47,7 +47,7 @@ struct NoteEditorScreen {
|
||||
|
||||
func assertVisible(file: StaticString = #file, line: UInt = #line) {
|
||||
XCTAssertTrue(
|
||||
navigationTitle.waitForExistence(timeout: 5),
|
||||
textEditor.waitForExistence(timeout: 5),
|
||||
"Note editor should be visible",
|
||||
file: file, line: line
|
||||
)
|
||||
@@ -55,7 +55,7 @@ struct NoteEditorScreen {
|
||||
|
||||
func assertDismissed(file: StaticString = #file, line: UInt = #line) {
|
||||
XCTAssertTrue(
|
||||
navigationTitle.waitForDisappearance(timeout: 5),
|
||||
textEditor.waitForDisappearance(timeout: 5),
|
||||
"Note editor should be dismissed",
|
||||
file: file, line: line
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user