Ejemplo n.º 1
0
 public static string GetRole(DriverWrapper driver)
 {
     try
     {
         GetPOM <BasePageObject>(driver);
         WebElementWrapper role = driver.GetByXpath("//*[@class='menu_section']/h3", 1);
         return(role.GetText());
     }
     catch (WebDriverTimeoutException)
     {
         return(null);
     }
 }
Ejemplo n.º 2
0
 public WebElementWrapper GetByXpath(string xpath, int timeoutInSeconds = 5)
 {
     if (timeoutInSeconds > 0)
     {
         WebDriverWait wait   = new WebDriverWait(driver, TimeSpan.FromSeconds(timeoutInSeconds));
         var           result = new WebElementWrapper(wait.Until(condition: ExpectedConditions.ElementIsVisible(By.XPath(xpath))));
         return(result);
     }
     else
     {
         var result = new WebElementWrapper(driver.FindElement(By.XPath(xpath)));
         return(result);
     }
 }
Ejemplo n.º 3
0
        public override void Init(DriverWrapper driver)
        {
            base.Init(driver);
            language = GetPOM <LanguageChanger>(driver);

            nameInput        = driver.GetByXpath("//input[@id = 'name']");
            surnameInput     = driver.GetByXpath("//input[@id = 'surname']");
            phoneNumberInput = driver.GetByXpath("//input[@id='phone-number']");
            password         = driver.GetByXpath("//input[@id='password']");
            newPassword      = driver.GetByXpath("//input[@id='new-password']");
            confirmPassword  = driver.GetByXpath("//input[@id='password-repeat']");
            btnUpdateProfile = driver.GetByXpath("//button[@id='submit-button']");
            title            = driver.GetByXpath("//div[@class='title_left']//span");
            //imageSelect = driver.GetByXpath("//input[@id='image-file']");
        }
Ejemplo n.º 4
0
 public override void Init(DriverWrapper driver)
 {
     btnSignIn = driver.GetByXpath("//a[@id='Sign_in']", 10);
     btnSignUp = driver.GetByXpath("//a[@id='Sign_up']", 10);
     base.Init(driver);
 }
Ejemplo n.º 5
0
 public string GetRole()
 {
     role = driver.GetByXpath("//tbody/tr/td[contains(text(),'*****@*****.**')]/../td[3]");
     return(role.GetText());
 }
Ejemplo n.º 6
0
 public void ChangeRoleToUser()
 {
     btnChangeRole = driver.GetByXpath("//tbody/tr/td[contains(text(),'*****@*****.**')]/../td[6]/button");
     btnChangeRole.Click();
     SelectRole("user");
 }
Ejemplo n.º 7
0
 public bool IsSuccessAlertDisplayed()
 {
     successAlert = driver.GetByXpath("//*[@class='alert ui-pnotify-container alert-success ui-pnotify-shadow']");
     return(successAlert.IsDisplayed());
 }
Ejemplo n.º 8
0
 public bool IsErrorAlertDisplayed()
 {
     errorAlert = driver.GetByXpath("//*[@class='alert ui-pnotify-container alert-danger ui-pnotify-shadow']");
     return(errorAlert.IsDisplayed());
 }
Ejemplo n.º 9
0
        public string GetSuccessText()
        {
            WebElementWrapper success = driver.GetByXpath("//h4[@class='ui-pnotify-title']");

            return(success.GetText());
        }
Ejemplo n.º 10
0
 public string GetXTitleText()
 {
     xTitle = driver.GetByXpath("//*[@class='x_title']/h2");
     return(xTitle.GetText());
 }
Ejemplo n.º 11
0
 public string GetMainPageTitleText()
 {
     mainPageTitle = driver.GetByXpath("//*[@data-locale-item='mainPage']/span");
     return(mainPageTitle.GetText());
 }
Ejemplo n.º 12
0
 public bool GetRole()
 {
     role = driver.GetByXpath("//h3[text()='User']");
     return(role.IsDisplayed());
 }