Esempio n. 1
0
        public void Bugzilla31330Test()
        {
            var screenBounds = RunningApp.Query(q => q.Raw("* index:0"))[0].Rect;

            var cell  = RunningApp.Query(c => c.Marked("Something 1")) [0];
            var cell2 = RunningApp.Query(c => c.Marked("Something 2")) [0];

#if __IOS__
            RunningApp.DragCoordinates(screenBounds.Width - 10, cell.Rect.CenterY, 0, cell.Rect.CenterY);
            RunningApp.WaitForElement(c => c.Marked("Delete"));
            RunningApp.Tap(c => c.Marked("Delete"));
            RunningApp.WaitForElement(c => c.Marked("Something 1"));
            RunningApp.Tap(c => c.Marked("Something 2"));
            RunningApp.DragCoordinates(screenBounds.Width - 10, cell2.Rect.CenterY, 0, cell2.Rect.CenterY);
            RunningApp.Tap(c => c.Marked("Delete"));
            RunningApp.WaitForNoElement(c => c.Marked("Something 2"));
#else
            RunningApp.TouchAndHoldCoordinates(cell.Rect.CenterX, cell.Rect.CenterY);
            RunningApp.WaitForElement(c => c.Marked("Delete"));
            RunningApp.Tap(c => c.Marked("Delete"));
            RunningApp.Back();
            RunningApp.WaitForElement(c => c.Marked("Something 1"));
            RunningApp.Tap(c => c.Marked("Something 2"));
            RunningApp.TouchAndHoldCoordinates(cell2.Rect.CenterX, cell2.Rect.CenterY);
            RunningApp.Tap(c => c.Marked("Delete"));
            RunningApp.WaitForNoElement(c => c.Marked("Something 2"));
#endif
        }
Esempio n. 2
0
        public void TestShowContextMenuItemsInTheRightOrder()
        {
            var screenBounds = RunningApp.Query(q => q.Raw("* index:0"))[0].Rect;

            var cell = RunningApp.Query(c => c.Marked("Swipe ME")) [0];

#if __IOS__
            RunningApp.DragCoordinates(screenBounds.Width - 10, cell.Rect.CenterY, 0, cell.Rect.CenterY);
#else
            RunningApp.TouchAndHoldCoordinates(cell.Rect.CenterX, cell.Rect.CenterY);
#endif
            RunningApp.WaitForElement(c => c.Marked("Text0"));
            RunningApp.Screenshot("Are the menuitems in the right order?");
        }
Esempio n. 3
0
        public void TestDoesntCrashShowingContextMenu()
        {
            var screenBounds = RunningApp.Query(q => q.Raw("* index:0"))[0].Rect;

            var cell = RunningApp.Query(c => c.Marked("Swipe ME")) [0];

#if __IOS__
            RunningApp.DragCoordinates(screenBounds.Width - 10, cell.Rect.CenterY, 0, cell.Rect.CenterY);
            //TODO: fix this when context menu bug is fixed
            RunningApp.WaitForElement(c => c.Marked("Text4"));
#else
            RunningApp.TouchAndHoldCoordinates(cell.Rect.CenterX, cell.Rect.CenterY);
            RunningApp.WaitForElement(c => c.Marked("Text0"));
#endif
            RunningApp.Screenshot("Didn't crash");
            RunningApp.TapCoordinates(screenBounds.CenterX, screenBounds.CenterY);
        }
Esempio n. 4
0
        public void TestIsEnabledFalseContextActions()
        {
            if (RunningApp is iOSApp)
            {
                var disable1 = RunningApp.Query(c => c.Marked("txtCellDisableContextActions1")) [0];
                Assert.IsFalse(disable1.Enabled);

                var screenBounds = RunningApp.Query(q => q.Raw("* index:0")) [0].Rect;

                if (RunningApp is iOSApp)
                {
                    RunningApp.DragCoordinates(screenBounds.Width - 10, disable1.Rect.CenterY, 10, disable1.Rect.CenterY);
                }
                else
                {
                    disable1 = RunningApp.Query(c => c.Marked("txtCellDisableContextActions1")) [0];
                    RunningApp.TouchAndHoldCoordinates(disable1.Rect.CenterX, disable1.Rect.CenterY);
                }
                RunningApp.Screenshot("Not showing context menu");
                RunningApp.WaitForNoElement(c => c.Marked("More"));
                RunningApp.TapCoordinates(screenBounds.CenterX, screenBounds.CenterY);
            }
        }