2012-05-03 146 views
1

我使用bwoken爲iOS UI測試,其中,在引擎蓋下,使用UIAutomation運行所有測試。UIAutomation隨機失敗

我設置有兩個按鈕,一個非常簡單的示例應用程序,並在啓動時小1.5秒動畫 - 我所測試的是看到兩個按鈕在視圖中實際可用。

這個簡單的測試用例失敗,所有測試運行的1/3。

見附件我的測試用例:

#import "../../../../tuneup/tuneup.js" 

test "Initial screen has two buttons", (target, app) -> 
    target.delay(2) # wait until animation is over 
    window = app.mainWindow() 
    assertNotNull window.elements()["buttonA"], "buttonA is missing" 
    assertNotNull window.elements()["buttonB"], "buttonB is missing" 

爲什麼這是任何想法?

我檢查了常見的錯誤:

  • 的accessibilityLabel設置正確
  • 測試失敗,即使在啓動動畫被禁用
  • 添加/刪除延遲不會改變問題

回答

0

正確的方法是讓它更簡單。刪除動畫。測試是否存在一個按鈕。我有一種感覺,那就是動畫。此外,它可以幫助你得到確切的錯誤日誌/打印粘貼。

0

你可能想看看如果你的語法RYT。