本文整理汇总了Java中ru.yandex.qatools.allure.annotations.Step类的典型用法代码示例。如果您正苦于以下问题:Java Step类的具体用法?Java Step怎么用?Java Step使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Step类属于ru.yandex.qatools.allure.annotations包,在下文中一共展示了Step类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: showElementsSteps
import ru.yandex.qatools.allure.annotations.Step; //导入依赖的package包/类
@Step
@When("вывести на консоль все элементы экрана")
public void showElementsSteps() {
System.out.printf("%-90s %-35s %-35s %-70s %-10s%n",
"webElement",
"text",
"class",
"resourceId",
"contentDescription");
for (Object we : driver.findElements(By.xpath(".//*"))) {
WebElement webElement = (WebElement) we;
System.out.printf("%-90s %-35s %-35s %-70s %-10s%n",
webElement,
webElement.getText(),
webElement.getTagName(),
webElement.getAttribute("resourceId"),
webElement.getAttribute("contentDescription"));
}
}
示例2: reActivateItem
import ru.yandex.qatools.allure.annotations.Step; //导入依赖的package包/类
@Step("Rreactivate the item")
public boolean reActivateItem(String itemName){
WebElement todoItem = driver.findElement(By.xpath("//label[.='" + itemName + "']"));
WebElement divClass = todoItem.findElement(By.xpath(".."));
WebElement chkComplete = divClass.findElement(By.tagName("input"));
chkComplete.click();
WebElement liClass = null;
try{
liClass = divClass.findElement(By.xpath(".//*[@id='clear-completed']"));
if (liClass.isDisplayed()){
return false;
}
}catch (Exception e){
}
return true;
}
示例3: findAccount
import ru.yandex.qatools.allure.annotations.Step; //导入依赖的package包/类
@Step
@When("выбрать \"$item\" в \"$field\"")
public void findAccount(@Named("$item") String item, @Named("$field") String field) {
String pageName = "Выбор счета";
String buttonName = "Готово";
item = propertyUtils.injectProperties(item);
IElement cell = getCurrentPage().getElementByName(field);
finder.findWebElement(cell).click();
setFirstPickerWheelValue();
IElement element = pageProvider.getPageByName(pageName).getElementByName(buttonName);
finder.findWebElement(element).click();
boolean found = checkSelected(field, item);
while (!found) {
IElement accountElement = getCurrentPage().getElementByName(field);
finder.findWebElement(accountElement).click();
setNextPickerWheelValue();
element = pageProvider.getPageByName(pageName).getElementByName(buttonName);
finder.findWebElement(element).click();
found = checkSelected(field, item);
}
}
示例4: addProduct
import ru.yandex.qatools.allure.annotations.Step; //导入依赖的package包/类
@Step
public void addProduct(String name, String path) {
$("#btn-add-product").click();
new Dialog()
.setForLabel("Name:", name)
.setForLabel("Path:", path)
.confirm();
/* + more universal,
* + less dependent on deep details of html layout
* - for first usage, needs some more work (think more)
* to create correspondent Widget
* >
$(".product-name").setValue(name);
$(".product-path").setValue(path);
$("#dialog-btn-add-product").click();
* + more KISS
* - in long perspective "less efficient", "longer" in implementation
*/
new ConfirmationDialog().confirm();
}
示例5: addRowAfter
import ru.yandex.qatools.allure.annotations.Step; //导入依赖的package包/类
@Step
public Row addRowAfter(int index) {
row(index).cell(0)
.menu()
.open()
.select("Insert row below");
/* + more readable and concise
* - maybe more complicated for someone's taste
* ~
ContextMenu menu = this.table.row(index).cell(0).contextMenu();
menu.open();
menu.select("Insert row below");
*/
return row(index + 1);
}
示例6: add
import ru.yandex.qatools.allure.annotations.Step; //导入依赖的package包/类
@Step
public Categories add(String name) {
$("#btn-add-category").click();
new Dialog()
.setForLabel("Name:", name)
.confirm();
/* + more universal,
* + less dependent on deep details of html layout
* - for first usage, needs some more work (think more)
* to create correspondent Widget
* >
$(".category-name").setValue(name);
$("#dialog-btn-add-category").click();
* + more KISS
* - in long perspective "less efficient", "longer" in implementation
*/
return this;
}
示例7: pageLoaded
import ru.yandex.qatools.allure.annotations.Step; //导入依赖的package包/类
@Step
@Then("загружена страница \"$screenName\"")
public void pageLoaded(@Named("$screenName") String screenName) {
List<IElement> elements = pageProvider.getPageByName(screenName).getSpecificElements();
for (IElement element : elements) {
WebElement webElement = finder.findWebElement(element);
if (webElement == null)
throw new PageNoLoadException(screenName);
}
testContext.setCurrentPageName(screenName);
}
示例8: optionalPageLoaded
import ru.yandex.qatools.allure.annotations.Step; //导入依赖的package包/类
@Step
@Then("(Optional) загружена страница \"$screenName\"")
public void optionalPageLoaded(@Named("$screenName") String screenName) {
try {
pageLoaded(screenName);
} catch (Exception ignored) {
}
}
示例9: checkElement
import ru.yandex.qatools.allure.annotations.Step; //导入依赖的package包/类
@Step
@Then("на экране есть \"$elementName\"")
public void checkElement(@Named("$elementName") String elementName) {
WebElement webElement = getWebElementByName(elementName);
if (webElement == null) {
throw new ElementNotFoundException(elementName, getCurrentPage().getName());
}
}
示例10: sendKeys
import ru.yandex.qatools.allure.annotations.Step; //导入依赖的package包/类
@Step
@When("поле \"$field\" заполняется значением \"$valueOrKeyword\"")
public void sendKeys(@Named("$field") String field, @Named("$valueOrKeyword") String valueOrKeyword) {
WebElement webElement = getWebElementByName(field);
String value = propertyUtils.injectProperties(valueOrKeyword);
((MobileElement) webElement).setValue(value);
}
示例11: optionalSendKeys
import ru.yandex.qatools.allure.annotations.Step; //导入依赖的package包/类
@Step
@When("(Optional) поле \"$field\" заполняется значением \"$valueOrKeyword\"")
public void optionalSendKeys(@Named("$field") String field, @Named("$valueOrKeyword") String valueOrKeyword) {
try {
sendKeys(field, valueOrKeyword);
} catch (Exception ignored) {
System.out.println("Не удалось ввести");
}
}
示例12: listItemCheck
import ru.yandex.qatools.allure.annotations.Step; //导入依赖的package包/类
@Step
@Then("количество найденных элементов \"$fieldName\" равно \"$quantityExpectedValue\"")
public void listItemCheck(@Named("$fieldName") String fieldName, @Named("$quantityExpectedValue") String quantityExpectedValue) {
IElement element = getCurrentPage().getElementByName(fieldName);
List<WebElement> elementsFound = finder.findWebElements(element);
int quantityActualElements = elementsFound.size();
quantityExpectedValue = propertyUtils.injectProperties(quantityExpectedValue);
assertTrue(format("количество найденных элементов [%s] не равно [%s]", quantityActualElements, quantityExpectedValue), quantityActualElements == Integer.parseInt(quantityExpectedValue));
}
示例13: listItemClick
import ru.yandex.qatools.allure.annotations.Step; //导入依赖的package包/类
@Step
@When("выполнено нажатие на элемент \"$fieldName\" с индексом \"$index\"")
public void listItemClick(String fieldName, int index) {
IElement element = getCurrentPage().getElementByName(fieldName);
List<WebElement> elementsFound = finder.findWebElements(element);
WebElement firstElement = elementsFound.get(index);
firstElement.click();
}
示例14: eachElementContainsValue
import ru.yandex.qatools.allure.annotations.Step; //导入依赖的package包/类
@Step
@Then("каждый элемент \"$elementName\" содержит значение \"$template\" без учета регистра")
public void eachElementContainsValue(@Named("$elementName") String elementName, @Named("$template") String template) {
IElement element = getCurrentPage().getElementByName(elementName);
List<WebElement> elementsFound = finder.findWebElements(element);
String expectedValue = propertyUtils.injectProperties(template);
elementsFound.forEach(elem -> {
assertThat("Элемент не содержит заданное значение", elem.getText().toLowerCase(), containsString(expectedValue.toLowerCase()));
});
}
示例15: eachElementContainsOneOfTwoValues
import ru.yandex.qatools.allure.annotations.Step; //导入依赖的package包/类
@Step
@Then("каждый элемент \"$elementName\" содержит любое из значений \"$template1\" или \"$template2\" без учета регистра")
public void eachElementContainsOneOfTwoValues(@Named("$elementName") String elementName, @Named("$template1") String templateOne, @Named("$template2") String templateTwo) {
IElement element = getCurrentPage().getElementByName(elementName);
List<WebElement> elementsFound = finder.findWebElements(element);
String expectedValueOne = propertyUtils.injectProperties(templateOne);
String expectedValueTwo = propertyUtils.injectProperties(templateTwo);
elementsFound.forEach(elem -> {
assertThat("Элемент не содержит ни одно из заданных значений", elem.getText().toLowerCase(), CoreMatchers.anyOf(
containsString(expectedValueOne.toLowerCase()),
containsString(expectedValueTwo.toLowerCase())
));
});
}