![](/img/trans.png)
[英]how to assert that text not contains specific characters in android jetpack compose testing?
[英]How to disable transition for testing Android Jetpack Compose?
根據文檔 [Testing your Compose layout][1],我們可以禁用轉換如下:
@get:Rule
val composeTestRule = AndroidComposeTestRule<MyActivity>(disableTransitions = true)
但是,AndroidComposeTestRule 中沒有這樣的參數可用。 使用 SnackbarHost 進行測試失敗,因為它有動畫。 有沒有辦法禁用過渡?
根據review.googlesource.com , AndroidComposeTestRule 中不再提供參數disableTransitions
。 我們可以使用DisableTransitionsTestRule
來禁用轉換。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.