コード例 #1
0
        public void RendersItems()
        {
            // Clear search before test!
            OpenQA.Selenium.Appium.Windows.WindowsElement searchIconsBox = TestRunInitializer.Session.FindElementByAccessibilityId("SearchIconsInput");
            searchIconsBox.Clear();
            TestHelper.WaitMilli(500);

            var rootGrid = TestRunInitializer.Session.FindElementByName("Icons");

            // Just checking a few
            Assert.IsNotNull(rootGrid.FindElementByName("Icon GlobalNavigationButton"));
            Assert.IsNotNull(rootGrid.FindElementByName("Icon Wifi"));
            Assert.IsNotNull(rootGrid.FindElementByName("Icon Bluetooth"));
        }
        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));
            }
        }