Example #1
0
        public override string ToString()
        {
            string source = string.Empty;

            if (!From.Equals(string.Empty))
            {
                source += " from " + From + "\r\n ";
            }
            if (!By.Equals(string.Empty))
            {
                source += " by " + By + "\r\n ";
            }
            if (!With.Equals(string.Empty))
            {
                source += " with " + With + "\r\n ";
            }
            if (!For.Equals(string.Empty))
            {
                source += " for " + For + "\r\n ";
            }
            if (!Via.Equals(string.Empty))
            {
                source += " via " + Via + "\r\n ";
            }
            if (!Id.Equals(string.Empty))
            {
                source += " id " + Id + "\r\n ";
            }

            if (string.IsNullOrEmpty(source))
            {
                return("");
            }
            return(source.Remove(0, source.Length - 3) + ";" + Date.ToString("r"));
        }
Example #2
0
        public bool Equals(LockState other)
        {
            //Check whether the compared object is null.
            if (Object.ReferenceEquals(other, null))
            {
                return(false);
            }

            //Check whether the compared object references the same data.
            if (Object.ReferenceEquals(this, other))
            {
                return(true);
            }
            if (Is)
            {
                return(At.Equals(other.At) && Expiration.Equals(other.Expiration) && By.Equals(other.By));
            }
            else
            {
                if (other.Is)
                {
                    return(false);
                }
                else
                {
                    return(true);
                }
            }
        }
Example #3
0
        public bool Equals(ArchiveState other)
        {
            //Check whether the compared object is null.
            if (Object.ReferenceEquals(other, null))
            {
                return(false);
            }

            //Check whether the compared object references the same data.
            if (Object.ReferenceEquals(this, other))
            {
                return(true);
            }

            if (!Is)
            {
                if (!other.Is)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            else
            {
                return(By.Equals(other.By) && At.Equals(other.At));
            }
        }
Example #4
0
        public IWebElement FindElement(By by)
        {
            string classNameToFind = "waitForElement";
            By     waitForElement  = By.ClassName(classNameToFind);

            if (by.Equals(waitForElement))
            {
                return(new WebElementStub(classNameToFind));
            }

            return(new WebElementStub("invalid"));
        }
Example #5
0
        public bool Equals(UpdateState other)
        {
            //Check whether the compared object is null.
            if (Object.ReferenceEquals(other, null))
            {
                return(false);
            }

            //Check whether the compared object references the same data.
            if (Object.ReferenceEquals(this, other))
            {
                return(true);
            }

            //Should be enought to compare equity
            return(By.Equals(other.By) && At.Equals(other.At));
        }
Example #6
0
        //******************************* Added by Kathy ****************************************/
        //* This method explicitly makes a driver wait until a target element becomes clickable */
        //***************************************************************************************/
        public static void WaitForElementClickable(IWebDriver driver, By by, int timeoutInSeconds)
        {
            if ((timeoutInSeconds <= 0) || (by.Equals(null)))
            {
                log.Info("Parameter error in WaitForElementClickable method!");
            }

            else
            {
                try
                {
                    WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(timeoutInSeconds));
                    wait.Until(ExpectedConditions.ElementToBeClickable(by));
                    Thread.Sleep(1000);
                }

                catch (Exception ex)
                {
                    log.Info("Failure in WaitForElementClickable method : " + Environment.NewLine + ex.Message);
                }
            }
        }