Xamarin.UITest.Queries.AppRect[] GetLabels(Xamarin.UITest.IApp RunningApp, string label) { return(RunningApp .Query(q => q.Class("FormsTextView")) .Where(x => x.Text == label) .Select(x => x.Rect) .ToArray()); }
static bool MaybeGetProperty <T>(Xamarin.UITest.IApp app, string query, string[] propertyPath, out object result) { try { switch (propertyPath.Length) { case 1: result = app.Query(q => q.Raw(query).Invoke(propertyPath[0]).Value <T>()).First(); break; case 2: result = app.Query(q => q.Raw(query).Invoke(propertyPath[0]).Invoke(propertyPath[1]).Value <T>()).First(); break; case 3: result = app.Query(q => q.Raw(query).Invoke(propertyPath[0]).Invoke(propertyPath[1]).Invoke(propertyPath[2]).Value <T>()) .First(); break; case 4: result = app.Query( q => q.Raw(query) .Invoke(propertyPath[0]) .Invoke(propertyPath[1]) .Invoke(propertyPath[2]) .Invoke(propertyPath[3]) .Value <T>()).First(); break; default: result = null; return(false); } } catch { result = null; return(false); } return(true); }
static bool MaybeGetProperty <T>(Xamarin.UITest.IApp app, string query, string property, out object result) { try { result = app.Query(q => q.Raw(query).Invoke(property).Value <T>()).First(); } catch { result = null; return(false); } return(true); }
public void ShellStoreSetup() { RunningApp = AppSetup.Setup(); if (RunningApp.Query("SwapRoot - Store Shell").Length > 0) { RunningApp.Tap("SwapRoot - Store Shell"); } else { RunningApp.NavigateTo("SwapRoot - Store Shell"); } RunningApp.WaitForElement("Welcome to the HomePage"); }