use of ru.sbtqa.tag.pagefactory.annotations.ActionTitle in project page-factory-2 by sbtqa.
the class HTMLPage method setCheckBox.
/**
* Find web element with corresponding title, if it is a check box, select
* it If it's a WebElement instance, check whether it is already selected,
* and click if it's not Add corresponding parameter to allure report
*
* @param elementTitle WebElement that is supposed to represent checkbox
*
* @throws PageException if page was not initialized, or required element
* couldn't be found
*/
@ActionTitle("ru.sbtqa.tag.pagefactory.select.checkBox")
public void setCheckBox(String elementTitle) throws PageException {
WebElement targetElement = getElementByTitle(this, elementTitle);
if (targetElement.getClass().isAssignableFrom(CheckBox.class)) {
((CheckBox) targetElement).select();
} else {
setCheckBoxState(targetElement, true);
}
ParamsHelper.addParam(elementTitle, " is checked");
}
use of ru.sbtqa.tag.pagefactory.annotations.ActionTitle in project page-factory-2 by sbtqa.
the class WebElementsPage method pressKey.
/**
* Press specified key on a keyboard Add corresponding parameter to allure
* report
*
* @param keyName name of the key. See available key names in {@link Keys}
*/
@ActionTitle("ru.sbtqa.tag.pagefactory.press.key")
public void pressKey(String keyName) {
Keys key = Keys.valueOf(keyName.toUpperCase());
Actions actions = PageFactory.getActions();
actions.sendKeys(key).perform();
ParamsHelper.addParam(keyName, " is pressed");
}
use of ru.sbtqa.tag.pagefactory.annotations.ActionTitle in project page-factory-2 by sbtqa.
the class IndexPage method openedPage.
@ActionTitle("opened page")
public void openedPage(String page) throws ElementDescriptionException, ElementNotFoundException {
HtmlFindUtils htmlFindUtils = Environment.getFindUtils();
List<Link> links = htmlFindUtils.findList(null, "menu with list elements->toolbar");
String attributeClass = ElementUtils.getElementByText(links, page).findElement(By.xpath("./..")).getAttribute("class");
Assert.assertEquals("The path to element was compiled incorrectly.", "active", attributeClass);
}
use of ru.sbtqa.tag.pagefactory.annotations.ActionTitle in project page-factory-2 by sbtqa.
the class ContactPage method findBlock.
@ActionTitle("check find block")
public void findBlock() {
HtmlFindUtils htmlFindUtils = Environment.getFindUtils();
checkType(htmlFindUtils.find("menu", MenuBlock.class), MenuBlock.class);
checkType(htmlFindUtils.find("menu", HtmlElement.class), MenuBlock.class);
}
use of ru.sbtqa.tag.pagefactory.annotations.ActionTitle in project page-factory-2 by sbtqa.
the class ContactPage method errNotContains.
@ActionTitle("check that error message not contains")
public void errNotContains(String message) {
WebPageChecks checks = new WebPageChecks();
Assert.assertFalse(checks.checkEquality(errorMsg, message, MatchStrategy.CONTAINS));
}
Aggregations