Exemplo n.º 1
0
        private void Tap(int xOffset, int yOffset)
        {
            System.Threading.Thread.Sleep(100);
            //the screenshot can take the place of sleeping instead

            Console.WriteLine("Tap start");
            PointerInputDevice touch         = new PointerInputDevice(PointerKind.Touch);
            ActionSequence     touchSequence = new ActionSequence(touch, 0);

            touchSequence.AddAction(touch.CreatePointerMove(CoordinateOrigin.Pointer, xOffset, yOffset, TimeSpan.Zero));
            touchSequence.AddAction(touch.CreatePointerDown(PointerButton.TouchContact));
            touchSequence.AddAction(touch.CreatePointerUp(PointerButton.TouchContact));
            List <ActionSequence> actions = new List <ActionSequence> {
                touchSequence
            };

            session.PerformActions(actions);

            ////String filename = "Tap_" + System.DateTime.Now.ToString("yyyymmdd-HHmm-ssfff") + "_" + xOffset + "_" + yOffset + ".png";
            ////Bitmap bmp = imageComparer.ScreenshotLockBits(width, height);
            ////bmp.Save(filename, System.Drawing.Imaging.ImageFormat.Png);


            Console.WriteLine("Echo: " + actions[actions.Count - 1].ToString());
            Console.WriteLine("Tap end");
        }
Exemplo n.º 2
0
        public static void DrawCircle(WindowsDriver <WindowsElement> session)
        {
            // Draw a circle with radius 300 and 40 (x, y) points
            const int radius = 300;
            const int points = 40;

            // Select the Brushes toolbox to have the Brushes Pane sidebar displayed and ensure that Marker is selected
            session.FindElementByAccessibilityId("Toolbox").FindElementByAccessibilityId("TopBar_ArtTools").Click();
            session.FindElementByAccessibilityId("SidebarWrapper").FindElementByAccessibilityId("Marker3d").Click();

            // Locate the drawing surface
            WindowsElement inkCanvas = session.FindElementByAccessibilityId("InteractorFocusWrapper");

            // Draw the circle with a single touch actions
            OpenQA.Selenium.Appium.Interactions.PointerInputDevice touchContact = new OpenQA.Selenium.Appium.Interactions.PointerInputDevice(PointerKind.Touch);
            ActionSequence touchSequence = new ActionSequence(touchContact, 0);

            touchSequence.AddAction(touchContact.CreatePointerMove(inkCanvas, 0, -radius, TimeSpan.Zero));
            touchSequence.AddAction(touchContact.CreatePointerDown(PointerButton.TouchContact));
            for (double angle = 0; angle <= 2 * Math.PI; angle += 2 * Math.PI / points)
            {
                touchSequence.AddAction(touchContact.CreatePointerMove(inkCanvas, (int)(Math.Sin(angle) * radius), -(int)(Math.Cos(angle) * radius), TimeSpan.Zero));
            }
            touchSequence.AddAction(touchContact.CreatePointerUp(PointerButton.TouchContact));
            session.PerformActions(new List <ActionSequence> {
                touchSequence
            });

            // Verify that the drawing operations took place
            WindowsElement undoButton = session.FindElementByAccessibilityId("UndoIcon");
        }
Exemplo n.º 3
0
        public void ZoomingOutMultiTouchWithInterpolation()
        {
            // Set pointer move Duration to 300 ms to implicitly generate 6 interpolation moves that are performed every 50 ms
            TimeSpan moveDuration = TimeSpan.FromMilliseconds(300);

            // Drag a touch contact diagonally in SW direction approaching the other contact point
            PointerInputDevice touch1         = new PointerInputDevice(PointerKind.Touch);
            ActionSequence     touch1Sequence = new ActionSequence(touch1, 0);

            touch1Sequence.AddAction(touch1.CreatePointerMove(zoomInteractor, 50, -50, TimeSpan.Zero));
            touch1Sequence.AddAction(touch1.CreatePointerDown(PointerButton.TouchContact));
            touch1Sequence.AddAction(touch1.CreatePointerMove(zoomInteractor, 20, -20, moveDuration));
            touch1Sequence.AddAction(touch1.CreatePointerUp(PointerButton.TouchContact));

            // Drag a touch contact diagonally in NE direction approaching the other contact point
            PointerInputDevice touch2         = new PointerInputDevice(PointerKind.Touch);
            ActionSequence     touch2Sequence = new ActionSequence(touch2, 0);

            touch2Sequence.AddAction(touch2.CreatePointerMove(zoomInteractor, -50, 50, TimeSpan.Zero));
            touch2Sequence.AddAction(touch2.CreatePointerDown(PointerButton.TouchContact));
            touch2Sequence.AddAction(touch2.CreatePointerMove(zoomInteractor, -20, 20, moveDuration));
            touch2Sequence.AddAction(touch2.CreatePointerUp(PointerButton.TouchContact));

            // Perform the 2 fingers zoom out (pinch) multi-touch sequences defined above
            session.PerformActions(new List <ActionSequence> {
                touch1Sequence, touch2Sequence
            });

            // Ensure that the zoom level now is less than 100%
            Assert.IsTrue(int.Parse(zoomScaleTextBox.Text) < 100);
        }
Exemplo n.º 4
0
        public void Touch_DragAndDrop()
        {
            WindowsElement appNameTitle = FindAppTitleBar();
            const int      offset       = 100;

            // Save application window original position
            Point originalPosition = session.Manage().Window.Position;

            Assert.IsNotNull(originalPosition);

            // Send touch down, move, and up actions combination to perform a drag and drop
            // action on the app title bar. These actions reposition the application window.
            PointerInputDevice touchDevice = new PointerInputDevice(PointerKind.Touch);
            ActionSequence     sequence    = new ActionSequence(touchDevice, 0);

            sequence.AddAction(touchDevice.CreatePointerMove(appNameTitle, 0, 0, TimeSpan.Zero));
            sequence.AddAction(touchDevice.CreatePointerDown(PointerButton.TouchContact));
            sequence.AddAction(touchDevice.CreatePointerMove(CoordinateOrigin.Pointer, offset, offset, TimeSpan.FromSeconds(1)));
            sequence.AddAction(touchDevice.CreatePointerUp(PointerButton.TouchContact));
            session.PerformActions(new List <ActionSequence> {
                sequence
            });
            Thread.Sleep(TimeSpan.FromSeconds(1));

            // Verify that application window is now re-positioned from the original location
            Assert.AreNotEqual(originalPosition, session.Manage().Window.Position);
            Assert.IsTrue(originalPosition.Y < session.Manage().Window.Position.Y);

            // Restore application window original position
            session.Manage().Window.Position = originalPosition;
            Assert.AreEqual(originalPosition, session.Manage().Window.Position);
        }
Exemplo n.º 5
0
        public void Touch_Flick()
        {
            // Navigate to add alarm page
            session.FindElementByAccessibilityId("AddAlarmButton").Click();
            session.FindElementByAccessibilityId("AlarmTimePicker").Click();
            Thread.Sleep(TimeSpan.FromSeconds(1));

            WindowsElement minuteSelector = session.FindElementByAccessibilityId("MinuteLoopingSelector");
            WindowsElement minute00       = session.FindElementByName("00");

            Assert.IsNotNull(minuteSelector);
            Assert.IsNotNull(minute00);
            Assert.IsTrue(minute00.Displayed);

            // Perform touch flick down action to scroll the minute hiding 00 minutes that was shown
            PointerInputDevice touchDevice = new PointerInputDevice(PointerKind.Touch);
            ActionSequence     sequence    = new ActionSequence(touchDevice, 0);

            sequence.AddAction(touchDevice.CreatePointerMove(minuteSelector, 0, 0, TimeSpan.Zero));
            sequence.AddAction(touchDevice.CreatePointerDown(PointerButton.TouchContact));
            sequence.AddAction(touchDevice.CreatePointerMove(minuteSelector, 0, 500, TimeSpan.Zero));
            sequence.AddAction(touchDevice.CreatePointerUp(PointerButton.TouchContact));
            session.PerformActions(new List <ActionSequence> {
                sequence
            });
            Thread.Sleep(TimeSpan.FromSeconds(2));
            Assert.IsFalse(minute00.Displayed);
        }
Exemplo n.º 6
0
        public void Touch_LongClick()
        {
            // Create a new test alarm
            string alarmName = "LongTapTest";

            DeletePreviouslyCreatedAlarmEntry(alarmName);
            AddAlarmEntry(alarmName);
            Thread.Sleep(TimeSpan.FromSeconds(3));

            var alarmEntries = session.FindElementsByXPath($"//ListItem[starts-with(@Name, \"{alarmName}\")]");

            Assert.IsNotNull(alarmEntries);
            Assert.AreEqual(1, alarmEntries.Count);

            // Open a the context menu on the alarm entry using long tap (press and hold) action and click delete
            PointerInputDevice touchDevice = new PointerInputDevice(PointerKind.Touch);
            ActionSequence     sequence    = new ActionSequence(touchDevice, 0);

            sequence.AddAction(touchDevice.CreatePointerMove(alarmEntries[0], 0, 0, TimeSpan.Zero));
            sequence.AddAction(touchDevice.CreatePointerDown(PointerButton.TouchContact));
            sequence.AddAction(touchDevice.CreatePointerMove(alarmEntries[0], 0, 0, TimeSpan.FromSeconds(3)));
            sequence.AddAction(touchDevice.CreatePointerUp(PointerButton.TouchContact));
            session.PerformActions(new List <ActionSequence> {
                sequence
            });

            Thread.Sleep(TimeSpan.FromSeconds(1));
            session.FindElementByName("Delete").Click();
            Thread.Sleep(TimeSpan.FromSeconds(1));

            alarmEntries = session.FindElementsByXPath($"//ListItem[starts-with(@Name, \"{alarmName}\")]");
            Assert.IsNotNull(alarmEntries);
            Assert.AreEqual(0, alarmEntries.Count);
        }
        private void Flick(AndroidDriver <AppiumWebElement> driver, AppiumWebElement element, UpOrDown direction)
        {
            int moveYDirection;

            if (direction == UpOrDown.Down)
            {
                moveYDirection = 600;
            }
            else
            {
                moveYDirection = -600;
            }

            var            input   = new PointerInputDevice(PointerKind.Touch);
            ActionSequence FlickUp = new ActionSequence(input);

            FlickUp.AddAction(input.CreatePointerMove(element, 0, 0, TimeSpan.Zero));
            FlickUp.AddAction(input.CreatePointerDown(MouseButton.Left));

            FlickUp.AddAction(input.CreatePointerMove(element, 0, moveYDirection, TimeSpan.FromMilliseconds(200)));
            FlickUp.AddAction(input.CreatePointerUp(MouseButton.Left));
            driver.PerformActions(new List <ActionSequence>()
            {
                FlickUp
            });
        }
Exemplo n.º 8
0
        private void Tap(int xOffset, int yOffset)
        {
            System.Threading.Thread.Sleep(100);
            //the screenshot can take the place of sleeping instead

            Console.WriteLine("Tap start");
            PointerInputDevice touch         = new PointerInputDevice(PointerKind.Touch);
            ActionSequence     touchSequence = new ActionSequence(touch, 0);

            touchSequence.AddAction(touch.CreatePointerMove(CoordinateOrigin.Pointer, xOffset, yOffset, TimeSpan.Zero));
            touchSequence.AddAction(touch.CreatePointerDown(PointerButton.TouchContact));
            touchSequence.AddAction(touch.CreatePointerUp(PointerButton.TouchContact));
            List <ActionSequence> actions = new List <ActionSequence> {
                touchSequence
            };

            session.PerformActions(actions);

            if (record)
            {
                String eventFolder = installDirectory + "\\" + currentEventName;
                String filename    = eventFolder + "\\" + currentEventName + "_" + currentEventTapCount + ".png";
                currentEventTapCount++;
                Bitmap bmp = imageComparer.ScreenshotLockBits(width, height);
                bmp.Save(filename, ImageFormat.Png);
                bmp.Dispose();//doesn't work?
            }

            Console.WriteLine("Echo: " + actions[actions.Count - 1].ToString());
            Console.WriteLine("Tap end");
        }
Exemplo n.º 9
0
        private void Tap(int xOffset, int yOffset)
        {
            PointerInputDevice touch         = new PointerInputDevice(PointerKind.Touch);
            ActionSequence     touchSequence = new ActionSequence(touch, 0);

            touchSequence.AddAction(touch.CreatePointerMove(zoomInteractor, xOffset, yOffset, TimeSpan.Zero));
            touchSequence.AddAction(touch.CreatePointerDown(PointerButton.TouchContact));
            touchSequence.AddAction(touch.CreatePointerUp(PointerButton.TouchContact));
            session.PerformActions(new List <ActionSequence> {
                touchSequence
            });
        }
        private void FlickUp(WindowsDriver <WindowsElement> driver, AppiumWebElement element)
        {
            var            input   = new PointerInputDevice(PointerKind.Touch);
            ActionSequence FlickUp = new ActionSequence(input);

            FlickUp.AddAction(input.CreatePointerMove(element, 0, 0, TimeSpan.Zero));
            FlickUp.AddAction(input.CreatePointerDown(MouseButton.Left));
            FlickUp.AddAction(input.CreatePointerMove(element, 0, -300, TimeSpan.FromMilliseconds(200)));
            FlickUp.AddAction(input.CreatePointerUp(MouseButton.Left));
            driver.PerformActions(new List <ActionSequence>()
            {
                FlickUp
            });
        }
Exemplo n.º 11
0
        private void ScrollToEnd(WindowsDriver <WindowsElement> driver, AppiumWebElement element)
        {
            var            input       = new PointerInputDevice(PointerKind.Mouse);
            ActionSequence scrollToEnd = new ActionSequence(input);

            scrollToEnd.AddAction(input.CreatePointerMove(element, 0, 0, TimeSpan.Zero));
            scrollToEnd.AddAction(input.CreatePointerDown(MouseButton.Middle));
            scrollToEnd.AddAction(input.CreatePointerMove(element, 0, 600, TimeSpan.FromMilliseconds(200)));
            scrollToEnd.AddAction(input.CreatePointerUp(MouseButton.Middle));
            driver.PerformActions(new List <ActionSequence>()
            {
                scrollToEnd
            });
        }
Exemplo n.º 12
0
        public void DrawWithPen()
        {
            PointerInputDevice penDevice = new PointerInputDevice(PointerKind.Pen);

            // Draw rectangle ABCD (consisting of AB, BC, CD, and DA lines)
            ActionSequence sequence = new ActionSequence(penDevice, 0);

            sequence.AddAction(penDevice.CreatePointerMove(inkCanvas, A.X, A.Y, TimeSpan.Zero));
            sequence.AddAction(penDevice.CreatePointerDown(PointerButton.PenContact));
            sequence.AddAction(penDevice.CreatePointerMove(inkCanvas, B.X, B.Y, TimeSpan.Zero));
            sequence.AddAction(penDevice.CreatePointerMove(inkCanvas, C.X, C.Y, TimeSpan.Zero));
            sequence.AddAction(penDevice.CreatePointerMove(inkCanvas, D.X, D.Y, TimeSpan.Zero));
            sequence.AddAction(penDevice.CreatePointerMove(inkCanvas, A.X, A.Y, TimeSpan.Zero));
            sequence.AddAction(penDevice.CreatePointerUp(PointerButton.PenContact));
            session.PerformActions(new List <ActionSequence> {
                sequence
            });

            // Fill the rectangle ABCD at the middle of the crosshair position (Point E)
            brushesPane.FindElementByAccessibilityId("FillBucket").Click();

            ActionSequence fillSequence = new ActionSequence(penDevice, 0);

            fillSequence.AddAction(penDevice.CreatePointerMove(inkCanvas, E.X, E.Y, TimeSpan.Zero));
            fillSequence.AddAction(penDevice.CreatePointerDown(PointerButton.PenContact));
            fillSequence.AddAction(penDevice.CreatePointerUp(PointerButton.PenContact));
            session.PerformActions(new List <ActionSequence> {
                fillSequence
            });

            // Erase by pressing PenEraser button along Point E X-Axis and Y-Axis to make the crosshair
            ActionSequence eraseSequence = new ActionSequence(penDevice, 0);

            eraseSequence.AddAction(penDevice.CreatePointerMove(inkCanvas, A.X - 5, E.Y, TimeSpan.Zero));
            eraseSequence.AddAction(penDevice.CreatePointerDown(PointerButton.PenEraser));
            eraseSequence.AddAction(penDevice.CreatePointerMove(inkCanvas, B.X + 5, E.Y, TimeSpan.FromSeconds(.5)));
            eraseSequence.AddAction(penDevice.CreatePointerUp(PointerButton.PenEraser));
            eraseSequence.AddAction(penDevice.CreatePointerMove(inkCanvas, E.X, C.Y, TimeSpan.Zero));
            eraseSequence.AddAction(penDevice.CreatePointerDown(PointerButton.PenEraser));
            eraseSequence.AddAction(penDevice.CreatePointerMove(inkCanvas, E.X, B.Y, TimeSpan.FromSeconds(.5)));
            eraseSequence.AddAction(penDevice.CreatePointerUp(PointerButton.PenEraser));
            session.PerformActions(new List <ActionSequence> {
                eraseSequence
            });

            // Verify that the drawing operations took place
            Assert.IsTrue(undoButton.Displayed);
            Assert.IsTrue(undoButton.Enabled);
        }
Exemplo n.º 13
0
        public void Pen_Scroll_Horizontal()
        {
            // Different Alarm & Clock application version uses different UI elements
            if (AlarmTabClassName == "ListViewItem")
            {
                // The latest Alarms & Clock application no longer has horizontal scroll UI elements
            }
            else
            {
                WindowsElement homePagePivot       = session.FindElementByAccessibilityId("HomePagePivot");
                WindowsElement alarmPivotItem      = session.FindElementByAccessibilityId(AlarmTabAutomationId);
                WindowsElement worldClockPivotItem = session.FindElementByAccessibilityId(WorldClockTabAutomationId);
                Assert.IsNotNull(homePagePivot);
                Assert.IsNotNull(alarmPivotItem);
                Assert.IsNotNull(worldClockPivotItem);
                Assert.IsTrue(alarmPivotItem.Selected);
                Assert.IsFalse(worldClockPivotItem.Selected);

                // Perform scroll left pen action to switch from Alarm to WorldClock tab
                PointerInputDevice penDevice = new PointerInputDevice(PointerKind.Pen);
                ActionSequence     sequence  = new ActionSequence(penDevice, 0);
                sequence.AddAction(penDevice.CreatePointerMove(homePagePivot, 0, 0, TimeSpan.Zero));
                sequence.AddAction(penDevice.CreatePointerDown(PointerButton.PenContact));
                sequence.AddAction(penDevice.CreatePointerMove(homePagePivot, -session.Manage().Window.Size.Width / 2, 0, TimeSpan.FromSeconds(.5)));
                sequence.AddAction(penDevice.CreatePointerUp(PointerButton.PenContact));
                session.PerformActions(new List <ActionSequence> {
                    sequence
                });

                Thread.Sleep(TimeSpan.FromSeconds(1));
                Assert.IsFalse(alarmPivotItem.Selected);
                Assert.IsTrue(worldClockPivotItem.Selected);

                // Perform scroll right pen action to switch back from WorldClock to Alarm tab
                sequence = new ActionSequence(penDevice, 0);
                sequence.AddAction(penDevice.CreatePointerMove(homePagePivot, 0, 0, TimeSpan.Zero));
                sequence.AddAction(penDevice.CreatePointerDown(PointerButton.PenContact));
                sequence.AddAction(penDevice.CreatePointerMove(homePagePivot, session.Manage().Window.Size.Width / 2, 0, TimeSpan.FromSeconds(.5)));
                sequence.AddAction(penDevice.CreatePointerUp(PointerButton.PenContact));
                session.PerformActions(new List <ActionSequence> {
                    sequence
                });

                Thread.Sleep(TimeSpan.FromSeconds(1));
                Assert.IsTrue(alarmPivotItem.Selected);
                Assert.IsFalse(worldClockPivotItem.Selected);
            }
        }
Exemplo n.º 14
0
        public void TapTest()
        {
            PointerInputDevice touch         = new PointerInputDevice(PointerKind.Touch);
            ActionSequence     touchSequence = new ActionSequence(touch, 0);

            touchSequence.AddAction(touch.CreatePointerMove(zoomInteractor, 0, 0, TimeSpan.Zero));
            touchSequence.AddAction(touch.CreatePointerDown(PointerButton.TouchContact));
            touchSequence.AddAction(touch.CreatePointerUp(PointerButton.TouchContact));
            touchSequence.AddAction(touch.CreatePointerDown(PointerButton.TouchContact));
            touchSequence.AddAction(touch.CreatePointerUp(PointerButton.TouchContact));
            session.PerformActions(new List <ActionSequence> {
                touchSequence
            });

            Assert.IsTrue(true);
        }
Exemplo n.º 15
0
        private void ProcessTick(params Interaction[] interactionsToAdd)
        {
            List <InputDevice> usedDevices = new List <InputDevice>();

            foreach (Interaction interaction in interactionsToAdd)
            {
                InputDevice actionDevice = interaction.SourceDevice;
                if (usedDevices.Contains(actionDevice))
                {
                    throw new ArgumentException("You can only add one action per device for a single tick.");
                }
            }

            List <InputDevice> unusedDevices = new List <InputDevice>(this.sequences.Keys);

            foreach (Interaction interaction in interactionsToAdd)
            {
                ActionSequence sequence = this.FindSequence(interaction.SourceDevice);
                sequence.AddAction(interaction);
                unusedDevices.Remove(interaction.SourceDevice);
            }

            foreach (InputDevice unusedDevice in unusedDevices)
            {
                ActionSequence sequence = this.sequences[unusedDevice];
                sequence.AddAction(new PauseInteraction(unusedDevice, TimeSpan.Zero));
            }
        }
Exemplo n.º 16
0
        public void Touch_DoubleClick()
        {
            WindowsElement appNameTitle   = FindAppTitleBar();
            WindowsElement maximizeButton = session.FindElementByAccessibilityId("Maximize");

            // Set focus on the application by switching window to itself
            session.SwitchTo().Window(session.CurrentWindowHandle);

            // Restore the application window if it is currently maximized
            if (!maximizeButton.Text.Contains("Maximize"))
            {
                maximizeButton.Click();
            }

            // Verify that window is currently not maximized
            Assert.IsTrue(maximizeButton.Text.Contains("Maximize"));

            // Perform touch double click action on the title bar to maximize the application window
            PointerInputDevice touchDevice = new PointerInputDevice(PointerKind.Touch);
            ActionSequence     sequence    = new ActionSequence(touchDevice, 0);

            sequence.AddAction(touchDevice.CreatePointerMove(appNameTitle, 0, 0, TimeSpan.Zero));
            sequence.AddAction(touchDevice.CreatePointerDown(PointerButton.TouchContact));
            sequence.AddAction(touchDevice.CreatePointerUp(PointerButton.TouchContact));
            sequence.AddAction(touchDevice.CreatePointerDown(PointerButton.TouchContact));
            sequence.AddAction(touchDevice.CreatePointerUp(PointerButton.TouchContact));
            session.PerformActions(new List <ActionSequence> {
                sequence
            });
            Thread.Sleep(TimeSpan.FromSeconds(1));
            Assert.IsFalse(maximizeButton.Text.Contains("Maximize"));

            // Perform touch double click action on the title bar to restore the application window
            sequence = new ActionSequence(touchDevice, 0);
            sequence.AddAction(touchDevice.CreatePointerMove(appNameTitle, 0, 0, TimeSpan.Zero));
            sequence.AddAction(touchDevice.CreatePointerDown(PointerButton.TouchContact));
            sequence.AddAction(touchDevice.CreatePointerUp(PointerButton.TouchContact));
            sequence.AddAction(touchDevice.CreatePointerDown(PointerButton.TouchContact));
            sequence.AddAction(touchDevice.CreatePointerUp(PointerButton.TouchContact));
            session.PerformActions(new List <ActionSequence> {
                sequence
            });
            Thread.Sleep(TimeSpan.FromSeconds(1));
            Assert.IsTrue(maximizeButton.Text.Contains("Maximize"));
        }
Exemplo n.º 17
0
        public void DrawConcentricSquaresWithVaryingDuration()
        {
            const int             concentricSquareCount = 8; // Paint application only supports up to 10 touch inputs
            List <ActionSequence> actionSequencesList   = new List <ActionSequence>();

            // Draw N concentric rectangles with varying speed defined by the duration specified in durationMs
            for (int i = 0, radius = defaultRadius, durationMs = 1000; i < concentricSquareCount && radius > 0; i++, radius -= radiusOffset)
            {
                OpenQA.Selenium.Appium.Interactions.PointerInputDevice touchContact = new OpenQA.Selenium.Appium.Interactions.PointerInputDevice(PointerKind.Touch);
                ActionSequence touchSequence = new ActionSequence(touchContact, 0);
                touchSequence.AddAction(touchContact.CreatePointerMove(inkCanvas, -radius, -radius, TimeSpan.Zero));
                touchSequence.AddAction(touchContact.CreatePointerDown(PointerButton.TouchContact));
                touchSequence.AddAction(touchContact.CreatePointerMove(inkCanvas, radius, -radius, TimeSpan.FromMilliseconds(durationMs)));
                touchSequence.AddAction(touchContact.CreatePointerMove(inkCanvas, radius, radius, TimeSpan.FromMilliseconds(durationMs)));
                touchSequence.AddAction(touchContact.CreatePointerMove(inkCanvas, -radius, radius, TimeSpan.FromMilliseconds(durationMs)));
                touchSequence.AddAction(touchContact.CreatePointerMove(inkCanvas, -radius, -radius, TimeSpan.FromMilliseconds(durationMs)));
                touchSequence.AddAction(touchContact.CreatePointerUp(PointerButton.TouchContact));
                actionSequencesList.Add(touchSequence);
                durationMs += 300;
            }

            ourSession.PerformActions(actionSequencesList);

            // Verify that the drawing operations took place
            Assert.IsTrue(undoButton.Displayed);
            Assert.IsTrue(undoButton.Enabled);
        }
Exemplo n.º 18
0
    private void OnMouseDown()
    {
        Vector2    mouseToWorldPosition = CalculateMousePositionOnField();
        Vector2Int currentlyClickedCell = fieldProperties.CalculateCellFromLocalPosition(mouseToWorldPosition);

        if (fieldObjectMarker.IsAnyFieldObjectMarked())
        {
            Vector2Int previouslyClickedCell = fieldObjectMarker.GetMarkedFieldObjectCell();
            fieldObjectMarker.RemoveMark();

            if (AreSelectedCellsAdjacent(currentlyClickedCell, previouslyClickedCell))
            {
                DisableUserInput();

                ActionSequence fieldUpdateActionSequence = new ActionSequence();

                IAction swapAnimationActionPack = fieldObjectSwapper.SwapFieldObjects(currentlyClickedCell, previouslyClickedCell);
                fieldUpdateActionSequence.AddAction(swapAnimationActionPack);

                if (combinationsFinder.GetCurrentCombinations().Count > 0)
                {
                    IAction fieldUpdateActionPack = fieldUpdater.UpdateField();
                    fieldUpdateActionSequence.AddAction(fieldUpdateActionPack);
                }
                else
                {
                    IAction swapBackAnimationActionPack = fieldObjectSwapper.SwapFieldObjects(currentlyClickedCell, previouslyClickedCell);
                    fieldUpdateActionSequence.AddAction(swapBackAnimationActionPack);
                }

                fieldUpdateActionSequence.AddAction((callback) => { EnableUserInput(); callback(); });

                fieldUpdateActionSequence.Play(null);
            }
            else if (currentlyClickedCell != previouslyClickedCell)
            {
                fieldObjectMarker.MarkFieldObject(currentlyClickedCell);
            }
        }
        else
        {
            fieldObjectMarker.MarkFieldObject(currentlyClickedCell);
        }
    }
Exemplo n.º 19
0
        public void Touch_Click_OriginPointer()
        {
            WindowsElement alarmPivotItem      = session.FindElementByAccessibilityId("AlarmPivotItem");
            WindowsElement worldClockPivotItem = session.FindElementByAccessibilityId("WorldClockPivotItem");
            int            relativeX           = 0; // Initial x coordinate
            int            relativeY           = 0; // Initial y coordinate

            Assert.IsNotNull(alarmPivotItem);
            Assert.IsNotNull(worldClockPivotItem);
            Assert.IsTrue(alarmPivotItem.Selected);
            Assert.IsFalse(worldClockPivotItem.Selected);

            // Perform touch click action using pointer coordinate origin to switch from Alarm to WorldClock tab
            PointerInputDevice touchDevice = new PointerInputDevice(PointerKind.Touch);
            ActionSequence     sequence    = new ActionSequence(touchDevice, 0);

            relativeX = worldClockPivotItem.Location.X - relativeX;
            relativeY = worldClockPivotItem.Location.Y - relativeY;
            sequence.AddAction(touchDevice.CreatePointerMove(CoordinateOrigin.Pointer, relativeX, relativeY, TimeSpan.Zero));
            sequence.AddAction(touchDevice.CreatePointerDown(PointerButton.TouchContact));
            sequence.AddAction(touchDevice.CreatePointerUp(PointerButton.TouchContact));
            session.PerformActions(new List <ActionSequence> {
                sequence
            });

            Thread.Sleep(TimeSpan.FromSeconds(1));
            Assert.IsFalse(alarmPivotItem.Selected);
            Assert.IsTrue(worldClockPivotItem.Selected);

            // Perform touch click action using pointer coordinate origin to switch from WorldClock to Alarm tab
            sequence  = new ActionSequence(touchDevice, 0);
            relativeX = alarmPivotItem.Location.X - relativeX;
            relativeY = alarmPivotItem.Location.Y - relativeY;
            sequence.AddAction(touchDevice.CreatePointerMove(CoordinateOrigin.Pointer, relativeX, relativeY, TimeSpan.Zero));
            sequence.AddAction(touchDevice.CreatePointerDown(PointerButton.TouchContact));
            sequence.AddAction(touchDevice.CreatePointerUp(PointerButton.TouchContact));
            session.PerformActions(new List <ActionSequence> {
                sequence
            });

            Thread.Sleep(TimeSpan.FromSeconds(1));
            Assert.IsTrue(alarmPivotItem.Selected);
            Assert.IsFalse(worldClockPivotItem.Selected);
        }
Exemplo n.º 20
0
        public void Touch_Scroll_Horizontal()
        {
            WindowsElement homePagePivot       = session.FindElementByAccessibilityId("HomePagePivot");
            WindowsElement alarmPivotItem      = session.FindElementByAccessibilityId("AlarmPivotItem");
            WindowsElement worldClockPivotItem = session.FindElementByAccessibilityId("WorldClockPivotItem");

            Assert.IsNotNull(homePagePivot);
            Assert.IsNotNull(alarmPivotItem);
            Assert.IsNotNull(worldClockPivotItem);
            Assert.IsTrue(alarmPivotItem.Selected);
            Assert.IsFalse(worldClockPivotItem.Selected);

            // Perform scroll left touch action to switch from Alarm to WorldClock tab
            PointerInputDevice touchDevice = new PointerInputDevice(PointerKind.Touch);
            ActionSequence     sequence    = new ActionSequence(touchDevice, 0);

            sequence.AddAction(touchDevice.CreatePointerMove(homePagePivot, 0, 0, TimeSpan.Zero));
            sequence.AddAction(touchDevice.CreatePointerDown(PointerButton.TouchContact));
            sequence.AddAction(touchDevice.CreatePointerMove(homePagePivot, -session.Manage().Window.Size.Width / 2, 0, TimeSpan.FromSeconds(.5)));
            sequence.AddAction(touchDevice.CreatePointerUp(PointerButton.TouchContact));
            session.PerformActions(new List <ActionSequence> {
                sequence
            });

            Thread.Sleep(TimeSpan.FromSeconds(1));
            Assert.IsFalse(alarmPivotItem.Selected);
            Assert.IsTrue(worldClockPivotItem.Selected);

            // Perform scroll right touch action to switch back from WorldClock to Alarm tab
            sequence = new ActionSequence(touchDevice, 0);
            sequence.AddAction(touchDevice.CreatePointerMove(homePagePivot, 0, 0, TimeSpan.Zero));
            sequence.AddAction(touchDevice.CreatePointerDown(PointerButton.TouchContact));
            sequence.AddAction(touchDevice.CreatePointerMove(homePagePivot, session.Manage().Window.Size.Width / 2, 0, TimeSpan.FromSeconds(.5)));
            sequence.AddAction(touchDevice.CreatePointerUp(PointerButton.TouchContact));
            session.PerformActions(new List <ActionSequence> {
                sequence
            });

            Thread.Sleep(TimeSpan.FromSeconds(1));
            Assert.IsTrue(alarmPivotItem.Selected);
            Assert.IsFalse(worldClockPivotItem.Selected);
        }
Exemplo n.º 21
0
        public void Touch_Click_OriginViewport()
        {
            WindowsElement alarmPivotItem      = session.FindElementByAccessibilityId("AlarmPivotItem");
            WindowsElement worldClockPivotItem = session.FindElementByAccessibilityId("WorldClockPivotItem");
            int            x = worldClockPivotItem.Location.X; // x coordinate of UI element relative to application window
            int            y = worldClockPivotItem.Location.Y; // y coordinate of UI element relative to application window

            Assert.IsNotNull(alarmPivotItem);
            Assert.IsNotNull(worldClockPivotItem);
            Assert.IsTrue(alarmPivotItem.Selected);
            Assert.IsFalse(worldClockPivotItem.Selected);

            // Perform touch click action using viewport coordinate origin to switch from Alarm to WorldClock tab
            PointerInputDevice touchDevice = new PointerInputDevice(PointerKind.Touch);
            ActionSequence     sequence    = new ActionSequence(touchDevice, 0);

            sequence.AddAction(touchDevice.CreatePointerMove(CoordinateOrigin.Viewport, x, y, TimeSpan.Zero));
            sequence.AddAction(touchDevice.CreatePointerDown(PointerButton.TouchContact));
            sequence.AddAction(touchDevice.CreatePointerUp(PointerButton.TouchContact));
            session.PerformActions(new List <ActionSequence> {
                sequence
            });

            Thread.Sleep(TimeSpan.FromSeconds(1));
            Assert.IsFalse(alarmPivotItem.Selected);
            Assert.IsTrue(worldClockPivotItem.Selected);

            // Perform touch click action using viewport coordinate origin to switch from WorldClock to Alarm tab
            sequence = new ActionSequence(touchDevice, 0);
            x        = alarmPivotItem.Location.X;
            y        = alarmPivotItem.Location.Y;
            sequence.AddAction(touchDevice.CreatePointerMove(CoordinateOrigin.Viewport, x, y, TimeSpan.Zero));
            sequence.AddAction(touchDevice.CreatePointerDown(PointerButton.TouchContact));
            sequence.AddAction(touchDevice.CreatePointerUp(PointerButton.TouchContact));
            session.PerformActions(new List <ActionSequence> {
                sequence
            });

            Thread.Sleep(TimeSpan.FromSeconds(1));
            Assert.IsTrue(alarmPivotItem.Selected);
            Assert.IsFalse(worldClockPivotItem.Selected);
        }
Exemplo n.º 22
0
 public void DrawCircle(PointerInputDevice penDevice, ActionSequence sequence, int centerX, int centerY, int radius, int stepSize)
 {
     sequence.AddAction(penDevice.CreatePointerMove(
                            CoordinateOrigin.Viewport,
                            centerX + radius,
                            centerY,
                            TimeSpan.Zero
                            ));
     sequence.AddAction(penDevice.CreatePointerDown(PointerButton.PenContact));
     for (int i = 0; i <= stepSize; i++)
     {
         sequence.AddAction(penDevice.CreatePointerMove(
                                CoordinateOrigin.Viewport,
                                Convert.ToInt32(centerX + radius * Math.Cos(2 * Math.PI * i / stepSize)),
                                Convert.ToInt32(centerY + radius * Math.Sin(2 * Math.PI * i / stepSize)),
                                TimeSpan.Zero
                                ));
     }
     sequence.AddAction(penDevice.CreatePointerUp(PointerButton.PenContact));
 }
Exemplo n.º 23
0
        private void DrawCircle()
        {
            // Draw a circle with radius 300 and 40 (x, y) points
            const int radius = 300;
            const int points = 40;

            // Select the Brushes toolbox to have the Brushes Pane sidebar displayed and ensure that Marker is selected
            session.FindElementByAccessibilityId("Toolbox").FindElementByAccessibilityId("TopBar_ArtTools").Click();
            session.FindElementByAccessibilityId("SidebarWrapper").FindElementByAccessibilityId("Marker3d").Click();

            // Locate the drawing surface
            WindowsElement inkCanvas = session.FindElementByAccessibilityId("InteractorFocusWrapper");
            //WindowsElement paintCanvas = session.FindElementByClassName("Afx:00007FF6908E0000:8");

            // Draw the circle with a single touch actions
            PointerInputDevice touchContact  = new PointerInputDevice(PointerKind.Touch);
            ActionSequence     touchSequence = new ActionSequence(touchContact, 0);

            //touchSequence.AddAction(touchContact.CreatePointerMove(inkCanvas, 0, -radius, TimeSpan.Zero));
            //touchSequence.AddAction(touchContact.CreatePointerMove(paintCanvas, 0, -radius, TimeSpan.Zero));
            touchSequence.AddAction(touchContact.CreatePointerMove(CoordinateOrigin.Viewport, 0, -radius, TimeSpan.Zero));
            touchSequence.AddAction(touchContact.CreatePointerDown(PointerButton.TouchContact));
            for (double angle = 0; angle <= 2 * Math.PI; angle += 2 * Math.PI / points)
            {
                //touchSequence.AddAction(touchContact.CreatePointerMove(inkCanvas, (int)(Math.Sin(angle) * radius), -(int)(Math.Cos(angle) * radius), TimeSpan.Zero));
                touchSequence.AddAction(touchContact.CreatePointerMove(CoordinateOrigin.Viewport, (int)(Math.Sin(angle) * radius), -(int)(Math.Cos(angle) * radius), TimeSpan.Zero));
                //touchSequence.AddAction(touchContact.CreatePointerMove(paintCanvas, 0, -radius, TimeSpan.Zero));
            }
            touchSequence.AddAction(touchContact.CreatePointerUp(PointerButton.TouchContact));


            session.PerformActions(new List <ActionSequence> {
                touchSequence
            });

            // Verify that the drawing operations took place
            WindowsElement undoButton = session.FindElementByAccessibilityId("UndoIcon");

            Assert.IsTrue(undoButton.Displayed);
            Assert.IsTrue(undoButton.Enabled);
        }
Exemplo n.º 24
0
        public void DrawTwistingHurricane()
        {
            const int             LinesCount          = 10; // Paint application only supports up to 10 touch inputs
            List <ActionSequence> actionSequencesList = new List <ActionSequence>();

            // Draw N lines following a twisting & rotating radial pattern ressembling a hurricane eye
            double angle = 0;

            for (int line = 0; line < LinesCount; line++)
            {
                PointerInputDevice touchContact  = new PointerInputDevice(PointerKind.Touch);
                ActionSequence     touchSequence = new ActionSequence(touchContact, 0);

                int radius = 100;
                int x      = (int)(Math.Sin(angle) * radius);
                int y      = (int)(Math.Cos(angle) * radius);
                touchSequence.AddAction(touchContact.CreatePointerMove(inkCanvas, x, -y, TimeSpan.Zero));
                touchSequence.AddAction(touchContact.CreatePointerDown(PointerButton.TouchContact));

                double subAngle = angle;
                while (radius < defaultRadius)
                {
                    x = (int)(Math.Sin(subAngle) * radius);
                    y = (int)(Math.Cos(subAngle) * radius);
                    touchSequence.AddAction(touchContact.CreatePointerMove(inkCanvas, x, -y, TimeSpan.Zero));
                    radius   += 5;
                    subAngle += 2 * Math.PI / 36;
                }

                touchSequence.AddAction(touchContact.CreatePointerUp(PointerButton.TouchContact));
                actionSequencesList.Add(touchSequence);
                angle += Math.PI / LinesCount;
            }

            session.PerformActions(actionSequencesList);

            // Verify that the drawing operations took place
            Assert.IsTrue(undoButton.Displayed);
            Assert.IsTrue(undoButton.Enabled);
        }
Exemplo n.º 25
0
        public void Pen_Scroll_Vertical()
        {
            // Navigate to add alarm page
            session.FindElementByAccessibilityId("AddAlarmButton").Click();
            session.FindElementByAccessibilityId("AlarmTimePicker").Click();
            Thread.Sleep(TimeSpan.FromSeconds(1));

            WindowsElement minuteSelector = session.FindElementByAccessibilityId("MinuteLoopingSelector");
            WindowsElement minute00       = session.FindElementByName("00");

            Assert.IsNotNull(minuteSelector);
            Assert.IsNotNull(minute00);
            Assert.IsTrue(minute00.Displayed);

            // Perform scroll down pen action to scroll the minute hiding 00 minutes that was shown
            PointerInputDevice penDevice = new PointerInputDevice(PointerKind.Pen);
            ActionSequence     sequence  = new ActionSequence(penDevice, 0);

            sequence.AddAction(penDevice.CreatePointerMove(minuteSelector, 0, 0, TimeSpan.Zero));
            sequence.AddAction(penDevice.CreatePointerDown(PointerButton.PenContact));
            sequence.AddAction(penDevice.CreatePointerMove(minuteSelector, 0, -200, TimeSpan.FromSeconds(.5)));
            sequence.AddAction(penDevice.CreatePointerUp(PointerButton.PenContact));
            session.PerformActions(new List <ActionSequence> {
                sequence
            });
            Thread.Sleep(TimeSpan.FromSeconds(1));
            Assert.IsFalse(minute00.Displayed);

            // Perform scroll up pen action to scroll the the minute back showing 00 minutes that was hidden
            sequence = new ActionSequence(penDevice, 0);
            sequence.AddAction(penDevice.CreatePointerMove(minuteSelector, 0, 0, TimeSpan.Zero));
            sequence.AddAction(penDevice.CreatePointerDown(PointerButton.PenContact));
            sequence.AddAction(penDevice.CreatePointerMove(minuteSelector, 0, 200, TimeSpan.FromSeconds(.5)));
            sequence.AddAction(penDevice.CreatePointerUp(PointerButton.PenContact));
            session.PerformActions(new List <ActionSequence> {
                sequence
            });
            Thread.Sleep(TimeSpan.FromSeconds(1));
            Assert.IsTrue(minute00.Displayed);
        }
Exemplo n.º 26
0
        public void DrawFlower()
        {
            const int             LinesCount          = 10; // Paint application only supports up to 10 touch inputs
            List <ActionSequence> actionSequencesList = new List <ActionSequence>();

            // Draw N petals shape graph to create a flower like shape
            double angle = 0;

            for (int line = 0; line < LinesCount; line++)
            {
                OpenQA.Selenium.Appium.Interactions.PointerInputDevice touchContact = new OpenQA.Selenium.Appium.Interactions.PointerInputDevice(PointerKind.Touch);
                ActionSequence touchSequence = new ActionSequence(touchContact, 0);

                int radius = 0;
                int x      = (int)(Math.Sin(angle) * (defaultRadius * Math.Cos(radius * 2 * Math.PI / 360)));
                int y      = (int)(Math.Cos(angle) * (defaultRadius * Math.Cos(radius * 2 * Math.PI / 360)));
                touchSequence.AddAction(touchContact.CreatePointerMove(inkCanvas, x, -y, TimeSpan.Zero));
                touchSequence.AddAction(touchContact.CreatePointerDown(PointerButton.TouchContact));

                double subAngle = angle;
                while (radius < defaultRadius)
                {
                    x = (int)(Math.Sin(subAngle) * (defaultRadius * Math.Cos(radius * 2 * Math.PI / 360)));
                    y = (int)(Math.Cos(subAngle) * (defaultRadius * Math.Cos(radius * 2 * Math.PI / 360)));
                    touchSequence.AddAction(touchContact.CreatePointerMove(inkCanvas, x, -y, TimeSpan.Zero));
                    radius   += 5;
                    subAngle += 2 * Math.PI / 360;
                }

                touchSequence.AddAction(touchContact.CreatePointerUp(PointerButton.TouchContact));
                actionSequencesList.Add(touchSequence);
                angle += 2 * Math.PI / LinesCount;
            }

            ourSession.PerformActions(actionSequencesList);

            // Verify that the drawing operations took place
            Assert.IsTrue(undoButton.Displayed);
            Assert.IsTrue(undoButton.Enabled);
        }
Exemplo n.º 27
0
    public IAction UpdateField()
    {
        ActionSequence updateActionSequence = new ActionSequence();

        List <RectInt> currentCombinations = combinationsFinder.GetCurrentCombinations();

        while (currentCombinations.Count > 0)
        {
            IAction removalAction           = RemoveCombinations(currentCombinations);
            IAction fillingEmptyCellsAction = CreateNewFieldObjectsAndFillEmptyCells();

            ActionSequence updateIterationActionSequence = new ActionSequence();
            updateIterationActionSequence.AddAction((callback) => { removalAction.Play(callback); });
            updateIterationActionSequence.AddAction((callback) => { fillingEmptyCellsAction.Play(callback); });

            updateActionSequence.AddAction((callback) => { updateIterationActionSequence.Play(callback); });

            currentCombinations = combinationsFinder.GetCurrentCombinations();
        }

        return(updateActionSequence);
    }
Exemplo n.º 28
0
        private void ActionsLaunch(String type)
        {
            int Y = 300;

            if (type.Contains("cmd"))
            {
                Y = 100;
            }
            else if (type.Contains("About"))
            {
                Y = 300;
            }
            else
            {
                Y = 650;
            }

            WindowsElement     plusTab   = session.FindElementByAccessibilityId("Console Window");
            PointerInputDevice penDevice = new PointerInputDevice(PointerKind.Touch);
            ActionSequence     sequence  = new ActionSequence(penDevice, 0);
            ActionSequence     sequence2 = new ActionSequence(penDevice, 0);

            sequence.AddAction(penDevice.CreatePointerMove(plusTab, 0, 0, TimeSpan.Zero));
            sequence.AddAction(penDevice.CreatePointerDown(PointerButton.TouchContact));
            sequence.AddAction(penDevice.CreatePointerMove(CoordinateOrigin.Pointer, 0, 0, TimeSpan.Zero));
            sequence.AddAction(penDevice.CreatePointerUp(PointerButton.TouchContact));
            session.PerformActions(new List <ActionSequence> {
                sequence
            });

            Thread.Sleep(2000);
            sequence2.AddAction(penDevice.CreatePointerMove(CoordinateOrigin.Pointer, 0, Y, TimeSpan.Zero));
            sequence2.AddAction(penDevice.CreatePointerDown(PointerButton.TouchContact));
            sequence2.AddAction(penDevice.CreatePointerMove(CoordinateOrigin.Pointer, 0, 1, TimeSpan.FromMilliseconds(50)));
            sequence2.AddAction(penDevice.CreatePointerUp(PointerButton.TouchContact));
            session.PerformActions(new List <ActionSequence> {
                sequence2
            });
        }
Exemplo n.º 29
0
        public void Touch_Click_OriginElement()
        {
            var alarmPivotItem      = session.FindElementByAccessibilityId("AlarmPivotItem");
            var worldClockPivotItem = session.FindElementByAccessibilityId("WorldClockPivotItem");

            Assert.IsNotNull(alarmPivotItem);
            Assert.IsNotNull(worldClockPivotItem);
            Assert.IsTrue(alarmPivotItem.Selected);
            Assert.IsFalse(worldClockPivotItem.Selected);

            // Perform touch click action using element coordinate origin to switch from Alarm to WorldClock tab
            PointerInputDevice touchDevice = new PointerInputDevice(PointerKind.Touch);
            ActionSequence     sequence    = new ActionSequence(touchDevice, 0);

            sequence.AddAction(touchDevice.CreatePointerMove(worldClockPivotItem, 0, 0, TimeSpan.Zero));
            sequence.AddAction(touchDevice.CreatePointerDown(PointerButton.TouchContact));
            sequence.AddAction(touchDevice.CreatePointerUp(PointerButton.TouchContact));
            session.PerformActions(new List <ActionSequence> {
                sequence
            });

            Thread.Sleep(TimeSpan.FromSeconds(1));
            Assert.IsFalse(alarmPivotItem.Selected);
            Assert.IsTrue(worldClockPivotItem.Selected);

            // Perform touch click action using element coordinate origin to switch from WorldClock to Alarm tab
            sequence = new ActionSequence(touchDevice, 0);
            sequence.AddAction(touchDevice.CreatePointerMove(alarmPivotItem, 0, 0, TimeSpan.Zero));
            sequence.AddAction(touchDevice.CreatePointerDown(PointerButton.TouchContact));
            sequence.AddAction(touchDevice.CreatePointerUp(PointerButton.TouchContact));
            session.PerformActions(new List <ActionSequence> {
                sequence
            });

            Thread.Sleep(TimeSpan.FromSeconds(1));
            Assert.IsTrue(alarmPivotItem.Selected);
            Assert.IsFalse(worldClockPivotItem.Selected);
        }
Exemplo n.º 30
0
 public void ActionsError_UnsupportedPointerType()
 {
     try
     {
         // Perform move action using unsupported pointer type
         PointerInputDevice penDevice = new PointerInputDevice((PointerKind)(-1));
         ActionSequence     sequence  = new ActionSequence(penDevice, 0);
         sequence.AddAction(penDevice.CreatePointerMove(alarmTabElement, 0, 0, TimeSpan.Zero));
         session.PerformActions(new List <ActionSequence> {
             sequence
         });
         Assert.Fail("Exception should have been thrown");
     }
     catch (InvalidOperationException) { }
 }