I tried for the longest time to click the back button, but I couldn’t reference it using an accessibilityLabel. I found that you need the navigation controller to pop the top view controller.
In the it block:
To get the navigation controller add these lines
In the beforeAll block:
UIWindow *window = [UIApplication sharedApplication].keyWindow; nav = ((UINavigationController*)window.rootViewController);
Since the navigation controller needs to be declared throughout the whole test. Declare a navigation controller
Between the first describe statement and the beforeAll block:
__block UINavigationController *nav;