public void FiltersColorsCorrectly()
        {
            // Not using DataTestMethod as the initial steps are very expensive
            Tuple <string, string>[] colorsToSearch = new Tuple <string, string>[] {
                new Tuple <string, string>("ChromeHigh", "ChromeHigh"),
                new Tuple <string, string>("ErrorTextColor", "ErrorText"),
                new Tuple <string, string>("Accent", "Accent")
            };

            OpenQA.Selenium.Appium.Windows.WindowsElement searchIconsBox = TestRunInitializer.Session.FindElementByAccessibilityId("SearchColorsInput");
            Assert.IsNotNull(searchIconsBox);
            Assert.IsTrue(searchIconsBox.Displayed);
            Assert.IsTrue(searchIconsBox.Enabled);

            foreach (var search in colorsToSearch)
            {
                searchIconsBox.Clear();
                TestHelper.WaitMilli(500);

                searchIconsBox.SendKeys(search.Item1);
                TestHelper.WaitMilli(500);

                Assert.IsNotNull(TestRunInitializer.Session.FindElementByName("System color " + search.Item2));
                Assert.IsTrue(TestRunInitializer.Session.FindElementByName("System color " + search.Item2).Displayed);
            }
            searchIconsBox.Clear();
        }
Пример #2
0
        public void FiltersBrushesCorrectly()
        {
            // Not using DataTestMethod as the initial steps are very expensive
            Tuple <string, string>[] brushesToSearch = new Tuple <string, string>[] {
                new Tuple <string, string>("Description", "SystemControlDescriptionTextForegroundBrush"),
                new Tuple <string, string>("Transparent", "SystemControlDisabledTransparentBrush"),
                new Tuple <string, string>("Medium", "SystemControlBackgroundAltMediumHighBrush")
            };

            OpenQA.Selenium.Appium.Windows.WindowsElement searchIconsBox = TestRunInitializer.Session.FindElementByAccessibilityId("SearchBrushesInput");

            Assert.IsNotNull(searchIconsBox);
            Assert.IsTrue(searchIconsBox.Displayed);
            Assert.IsTrue(searchIconsBox.Enabled);

            foreach (var search in brushesToSearch)
            {
                searchIconsBox.Clear();
                TestHelper.WaitMilli(500);

                searchIconsBox.SendKeys(search.Item1);
                TestHelper.WaitMilli(500);

                Assert.IsNotNull(TestRunInitializer.Session.FindElementByName("System brush " + search.Item2));
                Assert.IsTrue(TestRunInitializer.Session.FindElementByName("System brush " + search.Item2).Displayed);
            }

            searchIconsBox.Clear();
        }
        public void FilterWorks()
        {
            Tuple <string, string>[] iconsToTest = new Tuple <string, string>[] {
                new Tuple <string, string>("AdjustHologram", "AdjustHologram"),
                new Tuple <string, string>("A", "GlobalNavigationButton"),
                new Tuple <string, string>("DataSenseBar", "DataSenseBar"),
                new Tuple <string, string>("EmojiTabCelebrationObjects", "EmojiTabCelebrationObjects"),
                new Tuple <string, string>("ED55", "EmojiTabCelebrationObjects")
            };


            OpenQA.Selenium.Appium.Windows.WindowsElement searchIconsBox = TestRunInitializer.Session.FindElementByAccessibilityId("SearchIconsInput");

            Assert.IsNotNull(searchIconsBox);
            Assert.IsTrue(searchIconsBox.Displayed);
            Assert.IsTrue(searchIconsBox.Enabled);

            foreach (var search in iconsToTest)
            {
                searchIconsBox.Clear();
                TestHelper.WaitMilli(500);

                searchIconsBox.SendKeys(search.Item1);
                TestHelper.WaitMilli(500);

                Assert.IsNotNull(TestRunInitializer.Session.FindElementByName("Icon " + search.Item2));
                Assert.IsTrue(TestRunInitializer.Session.FindElementByName("Icon " + search.Item2).Displayed);
            }
        }
        public void OnlySymbolsFilterWorksCorrectly()
        {
            OpenQA.Selenium.Appium.Windows.WindowsElement searchIconsBox      = TestRunInitializer.Session.FindElementByAccessibilityId("SearchIconsInput");
            OpenQA.Selenium.Appium.Windows.WindowsElement symbolsOnlyCheckbox = TestRunInitializer.Session.FindElementByName("Only show symbols");
            symbolsOnlyCheckbox.Click();

            Assert.IsNotNull(searchIconsBox);
            Assert.IsTrue(searchIconsBox.Displayed);
            Assert.IsTrue(searchIconsBox.Enabled);

            searchIconsBox.Clear();
            TestHelper.WaitMilli(500);

            searchIconsBox.SendKeys("Global");
            TestHelper.WaitMilli(500);

            var globalIcon = TestRunInitializer.Session.FindElementByName("Icon GlobalNavigationButton");

            Assert.IsNotNull(globalIcon);
            Assert.IsTrue(globalIcon.Displayed);

            searchIconsBox.Clear();
            TestHelper.WaitMilli(500);

            searchIconsBox.SendKeys("ED55");
            TestHelper.WaitMilli(500);

            bool crashed = true;

            try
            {
                TestRunInitializer.Session.FindElementByName("Icon EmojiTabCelebrationObjects");
                crashed = false;
            } catch (OpenQA.Selenium.WebDriverException) { }

            // Element not found, thus selenium threw an exception
            Assert.IsTrue(crashed);
            searchIconsBox.Clear();
            symbolsOnlyCheckbox.Click();
        }
        public void FindsContractsCorrectly()
        {
            Tuple <string, string>[] contractsToSearch = new Tuple <string, string>[]
            {
                new Tuple <string, string>("AI", "UWP contract Windows.AI.MachineLearning.Preview.MachineLearningPreviewContract")
            };
            OpenQA.Selenium.Appium.Windows.WindowsElement searchContractsBox = TestRunInitializer.Session.FindElementByAccessibilityId("SearchUWPContractsInput");
            searchContractsBox.Clear();
            TestHelper.WaitMilli(500);

            foreach (var search in contractsToSearch)
            {
                searchContractsBox.SendKeys(search.Item1);
                TestHelper.WaitMilli(500);

                Assert.IsNotNull(TestRunInitializer.Session.FindElementByName(search.Item2));
            }
        }
        public void FindsResults(string search, string foundVersion, string foundContract)
        {
            OpenQA.Selenium.Appium.Windows.WindowsElement searchContractsBox = TestRunInitializer.Session.FindElementByAccessibilityId("SearchUWPContractsInput");
            searchContractsBox.Clear();
            TestHelper.WaitMilli(500);

            foreach (char c in search.ToCharArray())
            {
                searchContractsBox.SendKeys(c.ToString());
                TestHelper.WaitMilli(100);
            }

            if (foundVersion.IsNullOrEmpty())
            {
                Assert.IsNotNull("No contracts found");
            }
            else
            {
                Assert.IsNotNull(TestRunInitializer.Session.FindElementByName(foundVersion));
                Assert.IsNotNull(TestRunInitializer.Session.FindElementByName(foundContract));
            }
        }