Exemple #1
0
        public void NextPageButtonVisibilityOptionsTest()
        {
            using (var setup = new TestSetupHelper("PipsPager Tests"))
            {
                elements = new PipsPagerElements();
                SetPreviousPageButtonVisibilityMode(ButtonVisibilityMode.VisibleOnHover);

                ChangeNumberOfPages(NumberOfPagesOptions.Five);
                VerifyNumberOfPages("5");

                /* Test for Collapsed */
                SetNextPageButtonVisibilityMode(ButtonVisibilityMode.Collapsed);
                VerifyPageButtonWithVisibilityModeSet(ButtonType.Next, ButtonVisibilityMode.Collapsed);

                /* Test for Visible */
                SetNextPageButtonVisibilityMode(ButtonVisibilityMode.Visible);
                VerifyPageButtonWithVisibilityModeSet(ButtonType.Next, ButtonVisibilityMode.Visible);
                /* We step until the end of the list (4 times, since we have 5 pages) */
                InputHelper.LeftClick(elements.GetNextPageButton());
                InputHelper.LeftClick(elements.GetNextPageButton());
                InputHelper.LeftClick(elements.GetNextPageButton());
                InputHelper.LeftClick(elements.GetNextPageButton());
                VerifyPageButtonWithVisibilityModeSet(ButtonType.Next, ButtonVisibilityMode.Collapsed);

                /* Test for VisibleOnHover */
                SetNextPageButtonVisibilityMode(ButtonVisibilityMode.VisibleOnHover);
                VerifyPageButtonWithVisibilityModeSet(ButtonType.Next, ButtonVisibilityMode.Collapsed);

                InputHelper.LeftClick(elements.GetPreviousPageButton());
                VerifyPageButtonWithVisibilityModeSet(ButtonType.Next, ButtonVisibilityMode.VisibleOnHover, true);

                InputHelper.LeftClick(elements.GetCurrentNumberOfPagesTextBlock());
                VerifyPageButtonWithVisibilityModeSet(ButtonType.Next, ButtonVisibilityMode.VisibleOnHover);
            }
        }
Exemple #2
0
        public void PipsPagerInfinitePagesTest()
        {
            using (var setup = new TestSetupHelper("PipsPager Tests"))
            {
                elements = new PipsPagerElements();
                SetPreviousPageButtonVisibilityMode(ButtonVisibilityMode.Visible);
                SetNextPageButtonVisibilityMode(ButtonVisibilityMode.Visible);

                VerifyPageChanged(0);

                ChangeNumberOfPages(NumberOfPagesOptions.Infinite);
                VerifyNumberOfPages("Infinite");

                InputHelper.LeftClick(elements.GetNextPageButton());
                VerifyPageChanged(1);

                InputHelper.LeftClick(elements.GetNextPageButton());
                VerifyPageChanged(2);

                InputHelper.LeftClick(elements.GetNextPageButton());
                VerifyPageChanged(3);

                InputHelper.LeftClick(elements.GetNextPageButton());
                VerifyPageChanged(4);

                InputHelper.LeftClick(elements.GetNextPageButton());
                VerifyPageChanged(5);

                InputHelper.LeftClick(elements.GetNextPageButton());
                VerifyPageChanged(6);

                InputHelper.LeftClick(elements.GetNextPageButton());
                VerifyPageChanged(7);
            }
        }
Exemple #3
0
        public void PreviousPageButtonVisibilityOptionsTest()
        {
            using (var setup = new TestSetupHelper("PipsPager Tests"))
            {
                elements = new PipsPagerElements();
                SetNextPageButtonVisibilityMode(ButtonVisibilityMode.Visible);

                /* Test for Collapsed */
                SetPreviousPageButtonVisibilityMode(ButtonVisibilityMode.Collapsed);
                VerifyPageButtonWithVisibilityModeSet(ButtonType.Previous, ButtonVisibilityMode.Collapsed);
                InputHelper.LeftClick(elements.GetNextPageButton());
                VerifyPageButtonWithVisibilityModeSet(ButtonType.Previous, ButtonVisibilityMode.Collapsed);

                /* Test for Visible */
                SetPreviousPageButtonVisibilityMode(ButtonVisibilityMode.Visible);
                VerifyPageButtonWithVisibilityModeSet(ButtonType.Previous, ButtonVisibilityMode.Visible);
                InputHelper.LeftClick(elements.GetPreviousPageButton());
                VerifyPageButtonWithVisibilityModeSet(ButtonType.Previous, ButtonVisibilityMode.Collapsed);

                /* Test for VisibleOnHover */
                SetPreviousPageButtonVisibilityMode(ButtonVisibilityMode.VisibleOnHover);
                VerifyPageButtonWithVisibilityModeSet(ButtonType.Previous, ButtonVisibilityMode.Collapsed);

                InputHelper.LeftClick(elements.GetNextPageButton());
                VerifyPageButtonWithVisibilityModeSet(ButtonType.Previous, ButtonVisibilityMode.VisibleOnHover, true);

                InputHelper.LeftClick(elements.GetCurrentNumberOfPagesTextBlock());
                VerifyPageButtonWithVisibilityModeSet(ButtonType.Previous, ButtonVisibilityMode.VisibleOnHover);
            }
        }
Exemple #4
0
        public void KeyboardPageSelectTest()
        {
            using (var setup = new TestSetupHelper("PipsPager Tests"))
            {
                if (!PlatformConfiguration.IsOsVersionGreaterThanOrEqual(OSVersion.Redstone4))
                {
                    Log.Warning("This test is only designed to run on RS4+ machines due to difference in focus behaviour.");
                    return;
                }

                elements = new PipsPagerElements();
                SetPreviousPageButtonVisibilityMode(ButtonVisibilityMode.Visible);
                SetNextPageButtonVisibilityMode(ButtonVisibilityMode.Visible);

                InputHelper.LeftClick(elements.GetNextPageButton());
                KeyboardHelper.PressDownModifierKey(ModifierKey.Shift);
                KeyboardHelper.PressKey(Key.Tab);
                KeyboardHelper.ReleaseModifierKey(ModifierKey.Shift);

                KeyboardHelper.PressKey(Key.Right);
                KeyboardHelper.PressKey(Key.Space);
                VerifySelectedPageIndex(2);

                KeyboardHelper.PressKey(Key.Right);
                KeyboardHelper.PressKey(Key.Space);
                VerifySelectedPageIndex(3);

                KeyboardHelper.PressKey(Key.Left);
                KeyboardHelper.PressKey(Key.Space);
                VerifySelectedPageIndex(2);
            }
        }
Exemple #5
0
 public void PipsPagerRTLDoesNotCrash()
 {
     using (var setup = new TestSetupHelper("PipsPager Tests"))
     {
         elements = new PipsPagerElements();
         TestSetupHelper.SetInnerFrameFlowDirection(FlowDirection.RightToLeft);
         SetNextPageButtonVisibilityMode(ButtonVisibilityMode.Visible);
         InputHelper.LeftClick(elements.GetNextPageButton());
     }
 }
Exemple #6
0
        public void OrientationChangeTest()
        {
            using (var setup = new TestSetupHelper("PipsPager Tests"))
            {
                elements = new PipsPagerElements();
                SetOrientation(Microsoft.Windows.Apps.Test.Automation.OrientationType.Horizontal);
                VerifyOrientationChanged(Microsoft.Windows.Apps.Test.Automation.OrientationType.Horizontal);

                SetOrientation(Microsoft.Windows.Apps.Test.Automation.OrientationType.Vertical);
                VerifyOrientationChanged(Microsoft.Windows.Apps.Test.Automation.OrientationType.Vertical);
            }
        }
Exemple #7
0
        public void PipSizeWithDifferentOrientationsTest()
        {
            using (var setup = new TestSetupHelper("PipsPager Tests"))
            {
                elements = new PipsPagerElements();
                Button getButtonSizesButton = elements.GetPipsPagerButtonSizesButton();
                getButtonSizesButton.InvokeAndWait();

                TextBlock horizontalOrientationPipsPagerButtonWidth  = elements.GetHorizontalOrientationPipsPagerButtonWidthTextBlock();
                TextBlock horizontalOrientationPipsPagerButtonHeight = elements.GetHorizontalOrientationPipsPagerButtonHeightTextBlock();

                TextBlock verticalOrientationPipsPagerButtonWidth  = elements.GetVerticalOrientationPipsPagerButtonWidthTextBlock();
                TextBlock verticalOrientationPipsPagerButtonHeight = elements.GetVerticalOrientationPipsPagerButtonHeightTextBlock();

                Verify.AreEqual("12", horizontalOrientationPipsPagerButtonWidth.DocumentText);
                Verify.AreEqual("20", horizontalOrientationPipsPagerButtonHeight.DocumentText);
                Verify.AreEqual("20", verticalOrientationPipsPagerButtonWidth.DocumentText);
                Verify.AreEqual("12", verticalOrientationPipsPagerButtonHeight.DocumentText);
            }
        }
Exemple #8
0
        public void PreviousPageButtonChangingPageTest()
        {
            using (var setup = new TestSetupHelper("PipsPager Tests"))
            {
                elements = new PipsPagerElements();
                SetPreviousPageButtonVisibilityMode(ButtonVisibilityMode.Visible);
                SetNextPageButtonVisibilityMode(ButtonVisibilityMode.Visible);

                VerifyPageChanged(0);
                InputHelper.LeftClick(elements.GetNextPageButton());

                InputHelper.LeftClick(elements.GetPreviousPageButton());
                VerifyPageChanged(0);

                InputHelper.LeftClick(elements.GetNextPageButton());
                InputHelper.LeftClick(elements.GetNextPageButton());

                InputHelper.LeftClick(elements.GetPreviousPageButton());
                VerifyPageChanged(1);
            }
        }
Exemple #9
0
        public void PipSizeAfterOrientationChangeTest()
        {
            using (var setup = new TestSetupHelper("PipsPager Tests"))
            {
                elements = new PipsPagerElements();
                Button getButtonSizesButton = elements.GetPipsPagerButtonSizesButton();
                getButtonSizesButton.InvokeAndWait();

                TextBlock horizontalOrientationPipsPagerButtonWidth  = elements.GetHorizontalOrientationPipsPagerButtonWidthTextBlock();
                TextBlock horizontalOrientationPipsPagerButtonHeight = elements.GetHorizontalOrientationPipsPagerButtonHeightTextBlock();
                Verify.AreEqual("12", horizontalOrientationPipsPagerButtonWidth.DocumentText);
                Verify.AreEqual("20", horizontalOrientationPipsPagerButtonHeight.DocumentText);

                SetOrientation(Microsoft.Windows.Apps.Test.Automation.OrientationType.Vertical);
                VerifyOrientationChanged(Microsoft.Windows.Apps.Test.Automation.OrientationType.Vertical);

                getButtonSizesButton.InvokeAndWait();

                Verify.AreEqual("20", horizontalOrientationPipsPagerButtonWidth.DocumentText);
                Verify.AreEqual("12", horizontalOrientationPipsPagerButtonHeight.DocumentText);
            }
        }
Exemple #10
0
        public void PipsPagerChangingPageTest()
        {
            using (var setup = new TestSetupHelper("PipsPager Tests"))
            {
                elements = new PipsPagerElements();
                SetPreviousPageButtonVisibilityMode(ButtonVisibilityMode.Visible);
                SetNextPageButtonVisibilityMode(ButtonVisibilityMode.Visible);

                VerifySelectedPageIndex(0);

                InputHelper.LeftClick(elements.GetNextPageButton());
                VerifySelectedPageIndex(1);

                InputHelper.LeftClick(elements.GetNextPageButton());
                VerifySelectedPageIndex(2);

                InputHelper.LeftClick(elements.GetPreviousPageButton());
                VerifySelectedPageIndex(1);

                InputHelper.LeftClick(elements.GetPreviousPageButton());
                VerifySelectedPageIndex(0);

                ChangeNumberOfPages(NumberOfPagesOptions.Five);
                VerifyNumberOfPages("5");

                InputHelper.LeftClick(elements.GetNextPageButton());
                VerifySelectedPageIndex(1);

                InputHelper.LeftClick(elements.GetNextPageButton());
                VerifySelectedPageIndex(2);

                InputHelper.LeftClick(elements.GetNextPageButton());
                VerifySelectedPageIndex(3);

                InputHelper.LeftClick(elements.GetPreviousPageButton());
                VerifySelectedPageIndex(2);
            }
        }