Пример #1
0
 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());
 }
Пример #2
0
        public async Task TestForSuccess(Xamarin.UITest.IApp RunningApp, Type type)
        {
            var test = tests.FirstOrDefault(x => x.Value == type);

            RunningApp.WaitForElement(test.Key);
            RunningApp.Tap(test.Key);
            //It takes a second for everything to settle
            await Task.Delay(2500);

            RunningApp.WaitForElement($"Success: {type.Name.Replace("_", " ")}");
            RunningApp.Tap("Start Over");
        }
Пример #3
0
        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);
        }
Пример #4
0
        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");
        }
Пример #5
0
        internal static void RunUITests(Xamarin.UITest.IApp RunningApp)
        {
            RunningApp.WaitForElement(Title1);
            RunningApp.Tap(ChangeTitle1);
            RunningApp.Tap(ChangeIcon1);
            RunningApp.Tap(ChangeIconPage2);
            RunningApp.Tap(ChangeIcon1Null);
            RunningApp.WaitForElement(ChangeTitle1);


            RunningApp.Tap(Title2);
            RunningApp.Tap(ChangeTitle2);
            RunningApp.Tap(ChangeIcon2);
            RunningApp.Tap(ChangeIconPage1);
            RunningApp.Tap(ChangeIcon2Null);
            RunningApp.WaitForElement(ChangeTitle2);
        }
Пример #6
0
        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);
        }
Пример #7
0
        protected BaseViewContainerRemote(Xamarin.UITest.IApp app, Enum formsType, string platformViewType)
        {
            App = app;
            PlatformViewType = platformViewType;

            // Currently tests are failing because the ViewInitilized is setting the renderer and control, fix and then remove index one

            ContainerQuery       = string.Format("* marked:'{0}Container'", formsType);
            ContainerLabel       = string.Format("{0}VisualElement_Container", formsType);
            ContainerDescendents = string.Format("* marked:'{0}Container' child *", formsType);

            ViewQuery = string.Format("* marked:'{0}VisualElement'", formsType);

            EventLabelQuery          = string.Format("* marked:'{0}EventLabel'", formsType);
            StateLabelQuery          = string.Format("* marked:'{0}StateLabel'", formsType);
            StateButtonQuery         = string.Format("* marked:'{0}StateButton'", formsType);
            LayeredHiddenButtonQuery = string.Format("* marked:'{0}LayeredHiddenButton'", formsType);
            LayeredLabelQuery        = string.Format("* marked:'{0}LayeredLabel'", formsType);

            if (platformViewType == PlatformViews.DatePicker)
            {
                //requiresDismissal = true;
            }
        }
Пример #8
0
 public ScreenshotConditionalApp(Xamarin.UITest.IApp app)
 {
     _app = app;
 }
Пример #9
0
 public static bool ShouldRunTest(Xamarin.UITest.IApp app)
 {
     return(app.IsPhone());
 }
Пример #10
0
 public EventViewContainerRemote(Xamarin.UITest.IApp app, Enum formsType, string platformViewType)
     : base(app, formsType, platformViewType)
 {
 }