2

I tried:

SLButton *actionSheetButton = [SLButton elementWithAccessibilityLabel:@"Remove"]; // also tried same with SLElement

BOOL popoverDisplayed = SLWaitUntilTrue([UIAElement(actionSheetButton) isValidAndVisible], 3.0);

if (popoverDisplayed) {
    [UIAElement(actionSheetButton) tap];
}

I was able to dismiss/cancel the action sheet using SLPopover, but I'd like to test the button actions.

Thanks.

Edit:

The error logged in Instruments:

Unexpected exception occurred ***SLUIAElementNotTappableException*** for reason: Element '<SLButton description:"Remove">' is not tappable.

Andrew
  • 158
  • 1
  • 5
  • The error is happening on the `tap` line, right? So Subliminal is finding the `actionSheetButton` OK, but is failing to execute the tap? What error(s) are logged in Instruments when you run this test? – Aaron Golden Jul 20 '13 at 16:52
  • Yes, the error is occurring on the tap line. I edited the question to include the error. I'm assuming Subliminal is finding it because it passes the isValidAndVisible check. Is that the way to check? – Andrew Jul 20 '13 at 17:53
  • Hi Andrew, Subliminal is finding the button alright but it's not properly identifying it to UIAutomation to be tapped. I've filed an issue here (https://github.com/inkling/Subliminal/issues/46) to track the two bugs in play; I have a fix pending for the first one and @AaronGolden and I are talking about how to fix the second one. – Jeffrey Wear Jul 21 '13 at 22:22
  • The fix is merged into master. Andrew, can you give your test another try with the top of the master branch of Subliminal and see if it works now? – Aaron Golden Jul 22 '13 at 15:12
  • Thank you, it works. Compared to your test case in Subliminal, I present the action sheet using showFromRect:inView:animated:, which implicitly creates a popover to wrap the action sheet on the iPad. Just in case pointing it out, unless it looks identical to Subliminal, if it's worth having a separate test for that presentation. – Andrew Jul 22 '13 at 19:12

1 Answers1

1

There were two bugs in Subliminal where Subliminal could not manipulate action sheets at all, and then further could not manipulate action sheets when they were in popovers. This issue gives more details for anyone interested. The bugs are fixed as of commit 450f37ce28 on master. Thanks for the report @Andrew!

Jeffrey Wear
  • 1,155
  • 2
  • 12
  • 24