public void VerifyCompactOverlayBehavior() { OpenQA.Selenium.Appium.Windows.WindowsElement compactOverlayButton = TestHelper.GetElementsOfTypeWithContent( "Button", "Switch to overlay mode")[0]; Assert.IsNotNull(compactOverlayButton); // Switch to CompactOverlay compactOverlayButton.Click(); TestHelper.WaitMilli(10000); // Get new button with updated text try { compactOverlayButton = TestHelper.GetElementsOfTypeWithContent( "Button", "Switch to normal mode")[0]; Assert.IsNotNull(compactOverlayButton); // Switch to normal compactOverlayButton.Click(); TestHelper.WaitMilli(2000); // Check if button has updated correctly compactOverlayButton = TestHelper.GetElementsOfTypeWithContent( "Button", "Switch to overlay mode")[0]; Assert.IsNotNull(compactOverlayButton); } catch { } }
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 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(); }
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 RendersColors() { OpenQA.Selenium.Appium.Windows.WindowsElement searchIconsBox = TestRunInitializer.Session.FindElementByAccessibilityId("SearchColorsInput"); searchIconsBox.Clear(); TestHelper.WaitMilli(500); string[] colors = new string[] { "AltHigh", "AltLow" }; foreach (string color in colors) { var uiElement = TestRunInitializer.Session.FindElementByName("System color " + color); Assert.IsNotNull(uiElement); } }
public void RendersBrushes() { OpenQA.Selenium.Appium.Windows.WindowsElement searchIconsBox = TestRunInitializer.Session.FindElementByAccessibilityId("SearchBrushesInput"); searchIconsBox.Clear(); TestHelper.WaitMilli(500); string[] brushes = new string[] { "SystemControlBackgroundAccentBrush", "SystemControlBackgroundAltHighBrush" }; foreach (string brushName in brushes) { var uiElement = TestRunInitializer.Session.FindElementByName("System brush " + brushName); Assert.IsNotNull(uiElement); } }
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 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 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)); } }