[英]React Native: How to navigate from one screen to another in Detox tests
[英]Detox UI tests are very slow with React Native
我們在運行wix / detox UI測試時遇到問題。 他們實在太慢了。
我們嘗試消除了所有可能的方法,禁用了所有后台進程,刪除了幾乎整個UI元素,嘗試禁用自動同步,但無濟於事。 這肯定比排毒文檔中的動畫要慢幾個數量級。
一個只有1個按鈕的簡單應用程序,單擊該按鈕大約需要1.5秒,而嘗試在我們的UI的某些部分上運行測試時,則需要40秒,但是按鈕和文本輸入很少。
結果是我們的整個測試套件運行了30分鍾(並且我們仍然沒有涵蓋我們想要的所有內容)。
典型日志:
Timed: animateWithDuration:delay:options:animations:completion:
Timed: animateWithDuration:delay:options:animations:completion:
Timed: animateWithDuration:delay:options:animations:completion:
Timed: animateWithDuration:delay:options:animations:completion:
(即使沒有動畫)
要么:
send: {"type":"currentStatus","params":{},"messageId":676}
send: {"type":"currentStatus","params":{},"messageId":677}
send: {"type":"currentStatus","params":{},"messageId":678}
send: {"type":"currentStatus","params":{},"messageId":679}
onMessage: {"type":"currentStatusResult","messageId":668,"params":{"state":"busy","resources":[{"name":"Dispatch Queue","info":{"queue":"<OS_dispatch_queue_main: com.apple.main-thread[0x11692fdc0] = { xref = -2147483648, ref = -2147483648, sref = 1, target = com.apple.root.default-qos.overcommit[0x116931300], width = 0x1, state = 0x001ffe9e00000300, dirty, max qos 6, in-flight = 0, thread = 0x303 }>","prettyPrint":"com.apple.main-thread"}}],"messageId":668}}
rbx
Dispatch Queue: com.apple.main-thread
onMessage: {"type":"currentStatusResult","messageId":669,"params":{"state":"busy","resources":[{"name":"Dispatch Queue","info":{"queue":"<OS_dispatch_queue_main: com.apple.main-thread[0x11692fdc0] = { xref = -2147483648, ref = -2147483648, sref = 1, target = com.apple.root.default-qos.overcommit[0x116931300], width = 0x1, state = 0x001ffe9e00000300, dirty, max qos 6, in-flight = 0, thread = 0x303 }>","prettyPrint":"com.apple.main-thread"}}],"messageId":669}}
rbx
Dispatch Queue: com.apple.main-thread
send: {"type":"currentStatus","params":{},"messageId":680}
send: {"type":"currentStatus","params":{},"messageId":681}
send: {"type":"currentStatus","params":{},"messageId":682}
onMessage: {"type":"currentStatusResult","messageId":670,"params":{"state":"busy","resources":[{"name":"Dispatch Queue","info":{"queue":"<OS_dispatch_queue_main: com.apple.main-thread[0x11692fdc0] = { xref = -2147483648, ref = -2147483648, sref = 1, target = com.apple.root.default-qos.overcommit[0x116931300], width = 0x1, state = 0x001ffe9e00000300, dirty, max qos 6, in-flight = 0, thread = 0x303 }>","prettyPrint":"com.apple.main-thread"}}],"messageId":670}}
rbx
庫版本
排毒:6.0.0,6.0.4,7.0.0-alpha
反應本機:0.51.0
開玩笑:20.0.4
(我們也嘗試過摩卡咖啡,沒有變化)
就我而言 ,我有一個背景Redux Saga ,它每1秒運行一次(代碼在以yield call(delay, 1000)
結束的循環中運行yield call(delay, 1000)
。
1秒間隔太短,無法排毒。 將延遲更改為2000可解決此問題。
計時器的松緊度可能取決於您擁有的背景雜物數量。 以2000毫秒的間隔運行2次sagas可能有效,但以相同的間隔運行100次sagas可能不可行。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.