XCTestCase: Wait for the application to stop working

My UI test fails because the test waits forever until the application is idle. I do not see that in the background something is happening, like a bootloader.

It just happens in one tab. All other tabs can be printed, but the test does not work on screen 3. I click on another tab after the test is caught on screen 3, the test resumes and ends successfully.

Any ideas?

- (void)testExample
{

    XCUIElementQuery* tabBarsQuery = self.app.tabBars;

    [tabBarsQuery.buttons[@"Screen2"] tap];
    [tabBarsQuery.buttons[@"Screen3"] tap];
    [tabBarsQuery.buttons[@"Screen1"] tap];
    [tabBarsQuery.buttons[@"Screen4"] tap];

}
+13
source share
2 answers

, - ( ) , . , "quiesce" - , . UIView Repeat. , , . ​​ . , , , #ifdef , , : fooobar.com/questions/295003/...

+8
let tabBarsQuery = self.app.tabBars
let button = tabBarsQuery.buttons[@"Screen2"]

, , .

let predicate = NSPredicate(format: "isHittable == 1") expectation(for: 
predicate, evaluatedWith: button, handler: nil)
waitForExpectations(timeout:10, handler: nil)
button.tap()
0

Source: https://habr.com/ru/post/1664521/


All Articles