I am writing some XCUITests. I’ve a display screen the place one thing modifications on the display screen whereas the person holds their finger on a component. I am making an attempt to write down a take a look at one thing just like the beneath, the place I examine what the worth is first, press and maintain, whereas checking that the worth just isn’t the identical
let ingredient = app.staticTexts["selected-date"]
XCTAssert(dateElement.label == "In the present day", dateElement.label)
tablesQuery.staticTexts["annotation"].press(forDuration: 3)
XCTAssert(dateElement.label != "In the present day", dateElement.label)
I would like the second examine to occur in the course of the maintain. However press(forDuration: )
is a blocking name that stops the runner for 3 seconds. Ensuing within the examine working after. Is there anyway to make a non-blocking maintain, or something like that?