using System; using Xamarin.UITest; using Xamarin.UITest.Android; using Xamarin.UITest.Queries; using NUnit.Framework; using System.Threading; namespace Xamarin.Forms.UITests { public class iOSUiTestType { public iOSUiTestType () { } } public static class PlatformQueries { public static Func AbsoluteGalleryBackground = q => q.Raw ("xamarin.forms.platform.android.BoxRenderer parent xamarin.forms.platform.android.RendererFactory_DefaultRenderer index:0"); public static Func ActivityIndicators = q => q.Raw ("ProgressBar"); public static Func Back = q => q.Id ("up"); public static Func BoxRendererQuery = q => q.Raw ("xamarin.forms.platform.android.BoxRenderer"); public static Func Cells = q => q.Raw ("xamarin.forms.platform.android.ViewCellRenderer_ViewCellContainer"); public static Func DismissPickerCustom = q => q.Marked ("OK"); public static Func DismissPickerNormal = q => q.Marked ("Done"); public static Func Entrys = q => q.Raw ("EntryEditText"); public static Func EntryCells = q => q.Raw ("EntryCellEditText"); public static Func Editors = q => q.Raw ("EditorEditText"); public static Func Frames = q => q.Raw ("FrameRenderer"); public static Func Images = q => q.Raw ("xamarin.forms.platform.android.ImageRenderer"); public static Func ImageView = q => q.Raw("ImageView"); public static Func LabelRenderers = q => q.Raw ("LabelRenderer"); public static Func List = q => q.Raw ("ListView"); public static Func Labels = q => q.Raw ("TextView"); public static Func Map = q => q.Raw ("MapView"); public static Func NumberPicker = q => q.Raw ("NumberPicker"); public static Func ProgressBar = q => q.Raw ("ProgressBar"); public static Func Tables = q => q.Raw ("ListView"); public static Func SearchBars = q => q.Raw ("SearchView"); public static Func Sliders = q => q.Raw ("SeekBar"); public static Func SpanningThreeRows = q => q.Marked ("Spanning 3 rows"); public static Func Steppers = q => q.Raw ("button marked:'+'"); public static Func Switch = q => q.Raw("Switch"); public static Func ThreeXThreeGridCell = q => q.Marked ("a block 3x3"); public static Func EntryWithPlaceholder (string text) { return q => q.Raw (string.Format ("EntryEditText hint:'{0}'", text)); } public static Func EntryCellWithPlaceholder (string text) { return q => q.Raw (string.Format ("EntryCellEditText hint:'{0}'", text)); } public static Func EntryWithText (string text) { return q => q.Raw (string.Format ("EntryEditText text:'{0}'", text)); } public static Func EntryCellWithText (string text) { return q => q.Raw (string.Format ("EntryCellEditText text:'{0}'", text)); } public static Func EditorsWithText (string text) { return q => q.Raw (string.Format ("EditorEditText text:'{0}'", text)); } public static Func EntryWithIndex (int index) { return q => q.Raw (string.Format ("EntryEditText index:{0}", index)); } public static Func SearchBarWithIndex (int index) { return q => q.Raw (string.Format ("SearchView index:{0}", index)); } public static Func LabelWithIndex (int index) { return q => q.Raw (string.Format ("TextView index:{0}", index)); } public static Func LabelWithText (string text) { return q => q.Raw (string.Format ("TextView text:'{0}'", text)); } public static Func LabelWithId (string id) { return q => q.Raw (string.Format ("TextView id:'{0}'", id)); } public static Func PickerEntryWithIndex (int index) { return q => q.Raw (string.Format ("EditText index:{0}", index)); } public static Func PickerEntryWithPlaceholder (string placeholder) { return q => q.Raw (string.Format ("EditText hint:'{0}'", placeholder)); } public static Func PickerEntryWithText (string text) { return q => q.Raw (string.Format ("EditText text:'{0}'", text)); } public static Func SwitchWithIndex (int index) { return q => q.Raw (string.Format ("Switch index:{0}", index)); } public static Func StepperWithIndex (int index) { return q => q.Raw (string.Format ("button marked:'+' index:{0}", index)); } public static AppResult DetailPage (this AndroidApp app) { return app.Query (q => q.Raw ("*"))[0]; } } }