From 71c452efe5fd9c13bbe47b46295a3952f6062a4f Mon Sep 17 00:00:00 2001 From: Philipp Zagar Date: Sat, 21 Dec 2024 11:23:02 +0100 Subject: [PATCH] UI test fixes --- Tests/UITests/TestAppUITests/TestAppUITests.swift | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Tests/UITests/TestAppUITests/TestAppUITests.swift b/Tests/UITests/TestAppUITests/TestAppUITests.swift index 26ddcf3..2d4abd1 100644 --- a/Tests/UITests/TestAppUITests/TestAppUITests.swift +++ b/Tests/UITests/TestAppUITests/TestAppUITests.swift @@ -78,7 +78,13 @@ class TestAppUITests: XCTestCase { #endif sleep(3) - XCTAssert(app.buttons["Save"].waitForExistence(timeout: 2)) + + // Select "On My iPhone / iPad" directory, if necessary + let predicate = NSPredicate(format: "label BEGINSWITH[c] %@", "On My") + let matchingStaticTexts = app.staticTexts.containing(predicate) + matchingStaticTexts.allElementsBoundByIndex.first?.tap() + + XCTAssert(app.buttons["Save"].waitForExistence(timeout: 5)) app.buttons["Save"].tap() sleep(10) // Wait until file is saved