This repository was archived by the owner on May 1, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +20
-1
lines changed
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared
Xamarin.Forms.Core.UITests.Shared/Utilities Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -91,7 +91,7 @@ public void TranslatingViewKeepsScrollViewPosition()
91
91
Assert . AreEqual ( 0 , label [ 0 ] . Rect . Height ) ;
92
92
Assert . AreEqual ( 0 , label [ 0 ] . Rect . Width ) ;
93
93
#else
94
- RunningApp . WaitForNoElement ( _failedText ) ;
94
+ var result = RunningApp . QueryUntilNotPresent ( ( ) => RunningApp . Query ( _failedText ) ) ;
95
95
#endif
96
96
}
97
97
#endif
Original file line number Diff line number Diff line change @@ -68,6 +68,25 @@ public static T[] QueryUntilPresent<T>(
68
68
return results ;
69
69
}
70
70
71
+ public static T [ ] QueryUntilNotPresent < T > (
72
+ this IApp app ,
73
+ Func < T [ ] > func ,
74
+ int retryCount = 10 ,
75
+ int delayInMs = 2000 )
76
+ {
77
+ var results = func ( ) ;
78
+
79
+ int counter = 0 ;
80
+ while ( ( results != null || results . Length > 0 ) && counter < retryCount )
81
+ {
82
+ Thread . Sleep ( delayInMs ) ;
83
+ results = func ( ) ;
84
+ counter ++ ;
85
+ }
86
+
87
+ return results ;
88
+ }
89
+
71
90
public static bool IsApiHigherThan ( this IApp app , int apiLevel , string apiLabelId = "ApiLevel" )
72
91
{
73
92
var api = Convert . ToInt32 ( app . WaitForElement ( "ApiLabel" ) [ 0 ] . ReadText ( ) ) ;
You can’t perform that action at this time.
0 commit comments