public MatchYourSkillsToCareerHomePage(ScenarioContext context) : base(context)
 {
     _context       = context;
     _axeHelper     = context.Get <AxeHelper>();
     _formHelper    = context.Get <FormCompletionHelper>();
     _objectContext = context.Get <ObjectContext>();
     _webDriver     = context.GetWebDriver();
     _config        = context.GetMatchYourSkillsToCareerConfig <MatchYourSkillsToCareerConfig>();
 }
Exemplo n.º 2
0
 public void SessionGetsInitialized()
 {
     Assert.IsNotNull(SessionManager.Session);
     try
     {
         // First run can be flaky due to external components
         AxeHelper.AssertNoAccessibilityErrors();
     }
     catch (System.Exception) { }
     AxeHelper.AssertNoAccessibilityErrors();
 }
Exemplo n.º 3
0
        public static void CreateSession(TestContext _)
        {
            if (_session == null)
            {
                int timeoutCount = 50;

                tryInitializeSession();
                if (_session == null)
                {
                    // WinAppDriver is probably not running, so lets start it!
                    if (File.Exists(@"C:\Program Files (x86)\Windows Application Driver\WinAppDriver.exe"))
                    {
                        Process.Start(@"C:\Program Files (x86)\Windows Application Driver\WinAppDriver.exe");
                    }
                    else if (File.Exists(@"C:\Program Files\Windows Application Driver\WinAppDriver.exe"))
                    {
                        Process.Start(@"C:\Program Files\Windows Application Driver\WinAppDriver.exe");
                    }
                    else
                    {
                        throw new Exception("Unable to start WinAppDriver since no suitable location was found.");
                    }

                    Thread.Sleep(10000);
                    tryInitializeSession();
                }

                while (_session == null && timeoutCount < 1000 * 4)
                {
                    tryInitializeSession();
                    Thread.Sleep(timeoutCount);
                    timeoutCount *= 2;
                }

                Thread.Sleep(3000);
                Assert.IsNotNull(_session);
                Assert.IsNotNull(_session.SessionId);

                // Dismiss the disclaimer window that may pop up on the very first application launch
                // If the disclaimer is not found, this throws an exception, so lets catch that
                try
                {
                    _session.FindElementByName("Disclaimer").FindElementByName("Accept").Click();
                }
                catch (OpenQA.Selenium.WebDriverException) { }

                // Wait if something is still animating in the visual tree
                _session.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(3);
                _session.Manage().Window.Maximize();

                AxeHelper.InitializeAxe();
            }
        }
Exemplo n.º 4
0
        public void VerifySettingsAreAccessible()
        {
            TestHelper.InvokeButtonById("SettingsButton");
            AxeHelper.AssertNoAccessibilityErrors();

            var settingsItems = new string[]
            {
                "SettingsItemAppearance",
                "SettingsItemPreferences",
                "SettingsItemMultitasking",
                "SettingsItemExperimental",
                "SettingsItemAbout"
            };

            foreach (var item in settingsItems)
            {
                for (int i = 0; i < 5; i++)
                {
                    try
                    {
                        Console.WriteLine("Inoking button:" + item);
                        Thread.Sleep(2000);
                        TestHelper.InvokeButtonById(item);
                        i = 1000;
                    }
                    catch (Exception exc)
                    {
                        Console.WriteLine("Failed to invoke the button:" + item + " with exception" + exc.Message);
                    }
                }
                try
                {
                    // First run can be flaky due to external components
                    AxeHelper.AssertNoAccessibilityErrors();
                }
                catch (System.Exception) { }
                AxeHelper.AssertNoAccessibilityErrors();
            }
        }
Exemplo n.º 5
0
 public void VerifyNavigationWorks()
 {
     TestHelper.InvokeButtonById("Desktop");
     AxeHelper.AssertNoAccessibilityErrors();
 }