예제 #1
0
        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 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();
        }