public virtual void GoTo([CallerMemberName] string callerMemberName = "")
        {
            var scrollBounds = App.Query(Queries.PageWithoutNavigationBar()).First().Rect;

            // Scroll using gutter to the right of view, avoid scrolling inside of WebView
            if (PlatformViewType == PlatformViews.WebView)
            {
                scrollBounds = new AppRect {
                    X       = scrollBounds.Width - 20,
                    CenterX = scrollBounds.Width - 10,
                    Y       = scrollBounds.Y,
                    CenterY = scrollBounds.CenterY,
                    Width   = 20,
                    Height  = scrollBounds.Height,
                };
            }


            while (true)
            {
                var result = App.Query(o => o.Raw(ContainerQuery));
                if (result.Any())
                {
                    break;
                }
                App.Tap(o => o.Raw("* marked:'MoveNextButton'"));
            }

            //Assert.True (App.ScrollForElement (
            //	ContainerQuery, new Drag (scrollBounds, Drag.Direction.BottomToTop, Drag.DragLength.Medium)
            //), "Failed to find element in: " + callerMemberName);

            App.Screenshot("Go to element");
        }
Ejemplo n.º 2
0
        public virtual void GoTo([CallerMemberName] string callerMemberName = "")
        {
            // Scroll using gutter to the right of view, avoid scrolling inside of WebView
            if (PlatformViewType == PlatformViews.WebView)
            {
                var scrollBounds = App.Query(Queries.PageWithoutNavigationBar()).First().Rect;

                scrollBounds = new AppRect
                {
                    X       = scrollBounds.Width - 20,
                    CenterX = scrollBounds.Width - 10,
                    Y       = scrollBounds.Y,
                    CenterY = scrollBounds.CenterY,
                    Width   = 20,
                    Height  = scrollBounds.Height,
                };
            }

            App.WaitForElement("TargetViewContainer");
            App.Tap("TargetViewContainer");
            App.EnterText(callerMemberName.Replace("_", "") + "VisualElement");
            App.Tap("GoButton");
        }