예제 #1
0
         public void Test_Setup()
         {
           _driver = new FirefoxDriver();
 		   dash = new DashboardElements(_driver);
            LoginPage login = new LoginPage(_driver);
            _driver.Navigate().GoToUrl("exampleurl/login");
            login.Login();
         }
예제 #2
0
        /// <summary>
        /// Opens the dashboard via home button. Verifies whether dashboard is open.
        /// </summary>
        /// <param name="timeoutInMilliseconds">
        /// The timeout in milliseconds.
        /// </param>
        /// <returns>
        /// <c>true</c> if XXXX, <c>false</c> otherwise.
        /// </returns>
        public bool OpenDashboard(int timeoutInMilliseconds)
        {
            try
            {
                bool result = true;

                Button home = new DashboardElements().HomeButton;

                if (home == null)
                {
                    Log.Error(LogInfo.Namespace(MethodBase.GetCurrentMethod()), "The Home Button is null.");
                    result = false;
                }
                else
                {
                    Mouse.MoveTo(home);
                    home.Click();

                    var watch = new Stopwatch();
                    watch.Start();
                    while (this.IsDashboardAvailable() == false)
                    {
                        if (watch.ElapsedMilliseconds > timeoutInMilliseconds)
                        {
                            Log.Error(LogInfo.Namespace(MethodBase.GetCurrentMethod()), "Opening Dashboard timed out after -> " + timeoutInMilliseconds + "ms.");

                            result = false;
                            break;
                        }
                    }

                    watch.Stop();
                }

                if (result)
                {
                    Log.Info(LogInfo.Namespace(MethodBase.GetCurrentMethod()), "Dashboard open and ready.");
                }

                return(result);
            }
            catch (Exception)
            {
                return(false);
            }
        }
예제 #3
0
        /// <summary>
        /// Checks whether the Dashboard is available or not using the the main Dashboard control.
        /// </summary>
        /// <returns>
        /// true: if the module is available
        /// false: if module is not available
        /// </returns>
        public bool IsDashboardAvailable()
        {
            bool    result    = true;
            Element container = new DashboardElements().MainDashboardContainer;

            if (container == null)
            {
                result = false;
                Log.Info(LogInfo.Namespace(MethodBase.GetCurrentMethod()), "The main Dashboard container is not found. Dashboard Module is not available");
            }
            else
            {
                Log.Info(LogInfo.Namespace(MethodBase.GetCurrentMethod()), "The main Dashboard container is found. Dashboard Module is available");
            }

            return(result);
        }
예제 #4
0
        /// <summary>
        /// Stores all extended dashboard values(container) in a list
        /// </summary>
        /// <returns>List with value container.</returns>
        private List <Element> StoreAllExtendedDashboardMainValues()
        {
            var result = new List <Element>();

            Element container = new DashboardElements().ExtendedDashboardAlternateMeasuredValueMainLabel;

            if (container != null)
            {
                result.Add(container);
            }

            Element container1 = new DashboardElements().ExtendedDashboardAlternateMeasuredValueLabel1;

            if (container1 != null)
            {
                result.Add(container1);
            }

            Element container2 = new DashboardElements().ExtendedDashboardAlternateMeasuredValueLabel2;

            if (container2 != null)
            {
                result.Add(container2);
            }

            Element container3 = new DashboardElements().ExtendedDashboardAlternateMeasuredValueLabel3;

            if (container3 != null)
            {
                result.Add(container3);
            }

            Element container4 = new DashboardElements().ExtendedDashboardAlternateMeasuredValueLabel4;

            if (container4 != null)
            {
                result.Add(container4);
            }

            return(result);
        }
예제 #5
0
        /// <summary>
        /// Stores all extended dashboard values(container) in a list
        /// </summary>
        /// <returns>List with value container.</returns>
        private List <Element> StoreAllExtendedDashboardExtendedValues()
        {
            var result = new List <Element>();

            Element container = new DashboardElements().ExtendedDashboardExtendedMeasuredValueLabel1;

            if (container != null)
            {
                result.Add(container);
            }

            Element container1 = new DashboardElements().ExtendedDashboardExtendedMeasuredValueLabel2;

            if (container1 != null)
            {
                result.Add(container1);
            }

            Element container2 = new DashboardElements().ExtendedDashboardExtendedMeasuredValueLabel3;

            if (container2 != null)
            {
                result.Add(container2);
            }

            Element container3 = new DashboardElements().ExtendedDashboardExtendedMeasuredValueLabel4;

            if (container3 != null)
            {
                result.Add(container3);
            }

            Element container4 = new DashboardElements().ExtendedDashboardExtendedMeasuredValueLabel5;

            if (container4 != null)
            {
                result.Add(container4);
            }

            Element container5 = new DashboardElements().ExtendedDashboardExtendedMeasuredValueLabel6;

            if (container5 != null)
            {
                result.Add(container5);
            }

            Element container6 = new DashboardElements().ExtendedDashboardExtendedMeasuredValueLabel7;

            if (container6 != null)
            {
                result.Add(container6);
            }

            Element container7 = new DashboardElements().ExtendedDashboardExtendedMeasuredValueLabel8;

            if (container7 != null)
            {
                result.Add(container7);
            }

            return(result);
        }