mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-08-05 21:07:49 +01:00
Improve flakiness of RegistrationEndToEndTest.
This commit is contained in:
committed by
Alex Hart
parent
a7064a365b
commit
472cd107d4
+3
-2
@@ -1509,9 +1509,10 @@ class RegistrationEndToEndTest {
|
||||
@Suppress("DEPRECATION")
|
||||
private fun solveCaptcha(token: String) {
|
||||
var webView: WebView? = null
|
||||
// Matched with onAllNodesWithTag so that an absent screen fails the condition and is retried, rather than throwing out of the wait
|
||||
waitFor("the captcha WebView") {
|
||||
val composeView = (composeTestRule.onNodeWithTag(TestTags.CAPTCHA_SCREEN).fetchSemanticsNode().root as ViewRootForTest).view
|
||||
webView = findWebView(composeView)
|
||||
val composeView = (composeTestRule.onAllNodesWithTag(TestTags.CAPTCHA_SCREEN).fetchSemanticsNodes().firstOrNull()?.root as? ViewRootForTest)?.view
|
||||
webView = composeView?.let { findWebView(it) }
|
||||
webView != null
|
||||
}
|
||||
webView!!.let { Shadows.shadowOf(it).webViewClient.shouldOverrideUrlLoading(it, "signalcaptcha://$token") }
|
||||
|
||||
Reference in New Issue
Block a user