87 lines
1.5 KiB
Java
87 lines
1.5 KiB
Java
package pages.webelements;
|
|
|
|
import org.openqa.selenium.WebDriver;
|
|
import org.openqa.selenium.WebElement;
|
|
import org.openqa.selenium.support.FindBy;
|
|
import org.openqa.selenium.support.PageFactory;
|
|
|
|
import pages.BasePage;
|
|
|
|
public class MostCommonInputsPage extends BasePage
|
|
{
|
|
@FindBy(xpath = "//button[contains(text(),'Most Common Inputs')]")
|
|
private WebElement accordionItem;
|
|
|
|
@FindBy(id = "text-input")
|
|
private WebElement textInput;
|
|
|
|
@FindBy(id = "readonly-input")
|
|
private WebElement readonlyInput;
|
|
|
|
@FindBy(id = "email-input")
|
|
private WebElement emailInput;
|
|
|
|
@FindBy(id = "password-input")
|
|
private WebElement passwordInput;
|
|
|
|
@FindBy(id = "textarea")
|
|
private WebElement textarea;
|
|
|
|
@FindBy(id = "form-interactions-reset-button")
|
|
private WebElement resetButton;
|
|
|
|
@FindBy(id = "form-interactions-submit-button")
|
|
private WebElement submitButton;
|
|
|
|
public MostCommonInputsPage(WebDriver driver)
|
|
{
|
|
super(driver);
|
|
PageFactory.initElements(this.driver, this);
|
|
}
|
|
|
|
public void clickOnAccordionItem()
|
|
{
|
|
accordionItem.click();
|
|
}
|
|
|
|
public void setText(String text)
|
|
{
|
|
textInput.sendKeys(text);
|
|
}
|
|
|
|
public void setEmail(String text)
|
|
{
|
|
emailInput.sendKeys(text);
|
|
}
|
|
|
|
public void setPassword(String text)
|
|
{
|
|
passwordInput.sendKeys(text);
|
|
}
|
|
|
|
public void setTextarea(String text)
|
|
{
|
|
textarea.sendKeys(text);
|
|
}
|
|
|
|
public void clearText()
|
|
{
|
|
textInput.clear();
|
|
}
|
|
|
|
public void reset()
|
|
{
|
|
resetButton.click();
|
|
}
|
|
|
|
public void submit()
|
|
{
|
|
submitButton.click();
|
|
}
|
|
|
|
public String getReadonlyValue()
|
|
{
|
|
return readonlyInput.getAttribute("value");
|
|
}
|
|
}
|