示例#1
0
 public void ClickSwitchWindowDSBtn()
 {
     if (ElementHandler.Exists(SwitchTimeWindow))
     {
         RawDataDirectlySwitchButton.Click();
         JazzMessageBox.LoadingMask.WaitLoading();
     }
 }
示例#2
0
 public void CloseSwitchTimeWindow()
 {
     if (ElementHandler.Exists(SwitchTimeWindow))
     {
         RawDataCancelSwitchButton.Click();
         JazzMessageBox.LoadingMask.WaitLoading();
     }
 }
示例#3
0
 /// <summary>
 /// Click 'Directly switch' button in popup time span after modified value without save in rawdata
 /// </summary>
 public void ClickDirectlySwitchButton()
 {
     if (ElementHandler.Exists(VEESwitchTimeWindow))
     {
         VEERawDataDirectlySwitchButton.Click();
         JazzMessageBox.LoadingMask.WaitChartMaskerLoading();
     }
 }
示例#4
0
 public void LoginCutomerOption(string customer)
 {
     if (ElementHandler.Exists(OptionWindowLocator))
     {
         LoginCustomerOption.SelectItem(customer);
         TimeManager.ShortPause();
         LoginCustomerOptionConfirm.Click();
         ElementHandler.Wait(HomePageNavigationLocator, WaitType.ToAppear, timeout: 150);
         TimeManager.MediumPause();
     }
 }
示例#5
0
        public void UncheckNodeWithoutConfirm(string nodeText)
        {
            Locator uncheckboxLocator       = Locator.GetVariableLocator(CHECKBOXXPATHFORMAT, ByType.XPath, TREENODEVARIABLENAME, nodeText);
            Locator confirmUncheckboxButton = new Locator(UNCHECKBOXCONFIRMBUTTON, ByType.XPath);

            if (ElementHandler.Exists(uncheckboxLocator))
            {
                IWebElement checkbox = FindChild(uncheckboxLocator);
                //Console.WriteLine("checkbox: " + nodeText + ", at point:" + checkbox.Location.X + "," + checkbox.Location.Y);

                if (String.Equals(checkbox.GetAttribute("aria-checked"), "true", StringComparison.OrdinalIgnoreCase))
                {
                    ClickCheckbox(checkbox);
                }
            }
        }
示例#6
0
        public void CheckNode(string nodeText)
        {
            Locator checkboxLocator = Locator.GetVariableLocator(CHECKBOXXPATHFORMAT, ByType.XPath, TREENODEVARIABLENAME, nodeText);

            if (ElementHandler.Exists(checkboxLocator))
            {
                IWebElement checkbox = FindChild(checkboxLocator);
                //Console.WriteLine("checkbox: " + nodeText + ", at point:" + checkbox.Location.X + "," + checkbox.Location.Y);

                if (!String.Equals(checkbox.GetAttribute("aria-checked"), "true", StringComparison.OrdinalIgnoreCase))
                {
                    ClickCheckbox(checkbox);
                    GetControl <LoadingMask>().WaitLoading();
                }
            }
        }
示例#7
0
        public void UncheckNode(string nodeText)
        {
            Locator uncheckboxLocator       = Locator.GetVariableLocator(CHECKBOXXPATHFORMAT, ByType.XPath, TREENODEVARIABLENAME, nodeText);
            Locator confirmUncheckboxButton = new Locator(UNCHECKBOXCONFIRMBUTTON, ByType.XPath);

            if (ElementHandler.Exists(uncheckboxLocator))
            {
                IWebElement checkbox = FindChild(uncheckboxLocator);
                //Console.WriteLine("checkbox: " + nodeText + ", at point:" + checkbox.Location.X + "," + checkbox.Location.Y);

                if (String.Equals(checkbox.GetAttribute("aria-checked"), "true", StringComparison.OrdinalIgnoreCase))
                {
                    ClickCheckbox(checkbox);

                    if (GetControl <MessageBox>().GetMessage().Contains(UNCHECKMESSAGE))
                    {
                        ElementHandler.FindElement(confirmUncheckboxButton).Click();

                        GetControl <LoadingMask>().WaitLoading();
                    }
                }
            }
        }
示例#8
0
 /// <summary>
 /// check a widget is or no exist
 /// </summary>
 /// <returns></returns>
 public bool CheckWidgetIsExist()
 {
     return(ElementHandler.Exists(JazzControlLocatorRepository.GetLocator(JazzControlLocatorKey.WidgetName)));
 }
示例#9
0
 public bool IsScrollbarExists()
 {
     return(ElementHandler.Exists(ScrollbarLocator));
 }
示例#10
0
 /// <summary>
 /// Judge if the container existed
 /// </summary>
 /// <param></param>
 public bool IsContainerExisted()
 {
     return(ElementHandler.Exists(this._RootLocator));
 }
示例#11
0
        public void LoginWithOption(string userName, string passWord, string customerName)
        {
            JazzTextField.LoginUserNameTextField.Fill(userName);
            JazzTextField.LoginPasswordTextField.Fill(passWord);

            JazzButton.LoginSubmitButton.Click();
            TimeManager.Pause(WAITVERYLONGTIME);

            if (String.IsNullOrEmpty(customerName))
            {
                if (JazzMessageBox.MessageBox.Exists())
                {
                    if (JazzMessageBox.MessageBox.GetMessage().Contains("地图不可用") || JazzMessageBox.MessageBox.GetMessage().Contains("map is unavailable"))
                    {
                        JazzMessageBox.MessageBox.OK();
                    }
                }

                if (JazzMessageBox.MessageBox.Exists())
                {
                    if (JazzMessageBox.MessageBox.GetMessage().Contains("服务器错误") || JazzMessageBox.MessageBox.GetMessage().Contains("Server error"))
                    {
                        JazzMessageBox.MessageBox.OK();
                    }
                }

                ElementHandler.Wait(HomePageNavigationLocator, WaitType.ToAppear, timeout: 5);
            }
            else
            {
                ElementHandler.Wait(OptionWindowLocator, WaitType.ToAppear, timeout: 30);

                if (ElementHandler.Exists(OptionWindowLocator))
                {
                    LoginCustomerOption.SelectItem(customerName);
                    TimeManager.ShortPause();
                    LoginCustomerOptionConfirm.Click();
                    TimeManager.LongPause();

                    if (JazzMessageBox.MessageBox.Exists())
                    {
                        if (JazzMessageBox.MessageBox.GetMessage().Contains("地图不可用") || JazzMessageBox.MessageBox.GetMessage().Contains("Google map is unavailable"))
                        {
                            JazzMessageBox.MessageBox.OK();
                        }
                    }

                    if (JazzMessageBox.MessageBox.Exists())
                    {
                        if (JazzMessageBox.MessageBox.GetMessage().Contains("服务器错误") || JazzMessageBox.MessageBox.GetMessage().Contains("Server error"))
                        {
                            JazzMessageBox.MessageBox.OK();
                        }
                    }
                }
                else
                {
                    throw new Exception("Login error, no popup option window and can't login");
                }
            }
        }
示例#12
0
 /// <summary>
 /// Return whether combobox list is empty
 /// </summary>
 /// <returns>True if enabled</returns>
 public Boolean IsComboxListEmpty()
 {
     return(ElementHandler.Exists(ControlLocatorRepository.GetLocator(ControlLocatorKey.ComboBoxDropdownListItems), this.RootElement));
 }
示例#13
0
        public bool IsComboBoxItemExisted(string itemKey)
        {
            Locator itemLocator = GetComboBoxItemLocator(itemKey);

            return(ElementHandler.Exists(itemLocator));
        }
示例#14
0
 public bool IsLabelExisted()
 {
     return(ElementHandler.Exists(this._RootLocator));
 }
示例#15
0
 public bool EntirelyNoChartDrawn()
 {
     return(!(ElementHandler.Exists(this._RootLocator)));
 }
示例#16
0
 public virtual bool Exists()
 {
     return(ElementHandler.Exists(this._RootLocator));
 }
示例#17
0
 public virtual bool Exists(Locator locator)
 {
     return(ElementHandler.Exists(locator, container: this.RootElement));
 }
示例#18
0
        public bool IsAlreadyLogin()
        {
            var HomePageNavigationLocator = JazzControlLocatorRepository.GetLocator(JazzControlLocatorKey.ButtonNavigatorHomePage);

            return(ElementHandler.Exists(HomePageNavigationLocator));
        }
示例#19
0
 public bool IsOptionWindowPopup()
 {
     return(ElementHandler.Exists(OptionWindowLocator));
 }
示例#20
0
        public void RefreshJazz(string customerName = null)
        {
            JazzBrowseManager.RefreshJazz();
            if (String.IsNullOrEmpty(customerName))
            {
                if (JazzMessageBox.MessageBox.Exists())
                {
                    if (JazzMessageBox.MessageBox.GetMessage().Contains("地图不可用") || JazzMessageBox.MessageBox.GetMessage().Contains("Google map is unavailable"))
                    {
                        JazzMessageBox.MessageBox.OK();
                    }
                }

                TimeManager.ShortPause();

                if (JazzMessageBox.MessageBox.Exists())
                {
                    if (JazzMessageBox.MessageBox.GetMessage().Contains("服务器错误") || JazzMessageBox.MessageBox.GetMessage().Contains("Server error"))
                    {
                        JazzMessageBox.MessageBox.OK();
                    }
                }

                ElementHandler.Wait(HomePageNavigationLocator, WaitType.ToAppear, timeout: 300);
                TimeManager.MediumPause();
            }
            else
            {
                ElementHandler.Wait(OptionWindowLocator, WaitType.ToAppear, timeout: 300);
                TimeManager.MediumPause();

                if (ElementHandler.Exists(OptionWindowLocator))
                {
                    LoginCustomerOption.SelectItem(customerName);
                    TimeManager.ShortPause();
                    LoginCustomerOptionConfirm.Click();
                    TimeManager.Pause(5000);

                    if (JazzMessageBox.MessageBox.Exists())
                    {
                        if (JazzMessageBox.MessageBox.GetMessage().Contains("地图不可用") || JazzMessageBox.MessageBox.GetMessage().Contains("Google map is unavailable"))
                        {
                            JazzMessageBox.MessageBox.OK();
                        }
                    }

                    TimeManager.ShortPause();

                    if (JazzMessageBox.MessageBox.Exists())
                    {
                        if (JazzMessageBox.MessageBox.GetMessage().Contains("服务器错误") || JazzMessageBox.MessageBox.GetMessage().Contains("Server error"))
                        {
                            JazzMessageBox.MessageBox.OK();
                        }
                    }

                    ElementHandler.Wait(HomePageNavigationLocator, WaitType.ToAppear, timeout: 300);
                    TimeManager.MediumPause();
                }
            }
        }
示例#21
0
        /// <summary>
        /// Verify whether the UI element exist
        /// </summary>
        /// <returns>True if the UI elemrnt exist, false if not</returns>
        public bool IsExisted(string itemKey)
        {
            Locator itemLocator = JazzControlLocatorRepository.GetLocator(itemKey);

            return(ElementHandler.Exists(itemLocator));
        }
示例#22
0
 public bool IsNavigatorExists()
 {
     return(ElementHandler.Exists(NavigatorLocator));
 }