2013-07-20 20 views
2

我想:可以使用SLButton或SLElement來解除彈出窗口中顯示的UIActionSheet?

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

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

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

我能解僱/取消使用SLPopover的動作片,但我想測試按鈕的動作。

謝謝。

編輯:

登錄儀器的錯誤:

意外的異常***SLUIAElementNotTappableException*** 的原因:元素'<SLButton description:"Remove">不是可點擊。

+0

錯誤發生在「tap」行上,對吧?所以Subliminal找到'actionSheetButton'確定,但是無法執行水龍頭?在運行此測試時,儀器中記錄了哪些錯誤? –

+0

是的,錯誤發生在水龍頭線上。我編輯了問題以包含錯誤。我假設Subliminal找到它是因爲它通過了isValidAndVisible檢查。這是檢查的方式嗎? – Andrew

+0

嗨安德魯,潛意識找到按鈕好吧,但它沒有正確識別它UIAutomation被挖掘。我在這裏提交了一個問題(https://github.com/inkling/Subliminal/issues/46)來跟蹤這兩個bug。我有第一個和@AaronGolden懸而未決的問題,我正在討論如何解決第二個問題。 –

回答

1

Subliminal中有兩個bug,Subliminal根本無法操作動作表,然後在彈出時無法操作動作表。 This issue爲任何感興趣的人提供更多細節。這些錯誤在master上承諾450f37ce28。感謝@Andrew的報道!