• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java Step类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中ru.yandex.qatools.allure.annotations.Step的典型用法代码示例。如果您正苦于以下问题:Java Step类的具体用法?Java Step怎么用?Java Step使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Step类属于ru.yandex.qatools.allure.annotations包,在下文中一共展示了Step类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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"));
    }
}
 
开发者ID:alfa-laboratory,项目名称:colibri-ui,代码行数:20,代码来源:SystemSteps.java


示例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;
}
 
开发者ID:AdyKalra,项目名称:ToDoMVCEmberJS,代码行数:17,代码来源:BasicTodoMvcPage.java


示例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);
    }
}
 
开发者ID:alfa-laboratory,项目名称:colibri-ui-template,代码行数:22,代码来源:PickerWheelSteps.java


示例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();
}
 
开发者ID:yashaka,项目名称:talks,代码行数:26,代码来源:Home.java


示例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);
}
 
开发者ID:yashaka,项目名称:talks,代码行数:18,代码来源:Table.java


示例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;
}
 
开发者ID:yashaka,项目名称:talks,代码行数:22,代码来源:Categories.java


示例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);
}
 
开发者ID:alfa-laboratory,项目名称:colibri-ui,代码行数:12,代码来源:PagesSteps.java


示例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) {

    }
}
 
开发者ID:alfa-laboratory,项目名称:colibri-ui,代码行数:10,代码来源:PagesSteps.java


示例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());
    }
}
 
开发者ID:alfa-laboratory,项目名称:colibri-ui,代码行数:9,代码来源:PagesSteps.java


示例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);
}
 
开发者ID:alfa-laboratory,项目名称:colibri-ui,代码行数:8,代码来源:TextFieldSteps.java


示例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("Не удалось ввести");
    }
}
 
开发者ID:alfa-laboratory,项目名称:colibri-ui,代码行数:10,代码来源:TextFieldSteps.java


示例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));
}
 
开发者ID:alfa-laboratory,项目名称:colibri-ui,代码行数:10,代码来源:ListItemCheck.java


示例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();
}
 
开发者ID:alfa-laboratory,项目名称:colibri-ui,代码行数:9,代码来源:ListItemSteps.java


示例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()));
    });
}
 
开发者ID:alfa-laboratory,项目名称:colibri-ui,代码行数:11,代码来源:CheckSteps.java


示例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())
        ));

    });
}
 
开发者ID:alfa-laboratory,项目名称:colibri-ui,代码行数:16,代码来源:CheckSteps.java


示例16: stepCheckValue

import ru.yandex.qatools.allure.annotations.Step; //导入依赖的package包/类
@Step
@Then("значение элемента \"$fieldName\" равно \"$expectedValueOrKeyword\"")
public void stepCheckValue(String fieldName, String expectedValueOrKeyword) {
    WebElement webElement = getWebElementByName(fieldName);
    String actualElement = webElement.getText();
    String expectedValue = propertyUtils.injectProperties(expectedValueOrKeyword);
    assertEquals(format("Значение поля [%s] не соответствует ожидаемому [%s]", actualElement, expectedValue), expectedValue, actualElement);
}
 
开发者ID:alfa-laboratory,项目名称:colibri-ui,代码行数:9,代码来源:CheckSteps.java


示例17: stepCheckContainsValue

import ru.yandex.qatools.allure.annotations.Step; //导入依赖的package包/类
@Step
@Then("значение элемента \"$fieldName\" содержит \"$expectedValueOrKeyword\"")
public void stepCheckContainsValue(String fieldName, String expectedValueOrKeyword) {
    WebElement webElement = getWebElementByName(fieldName);
    String actualElement = webElement.getText();
    String expectedValue = propertyUtils.injectProperties(expectedValueOrKeyword);
    assertTrue(format("Элемент [%s] не сожержит внутри себя такой элемент [%s]", actualElement, expectedValue), actualElement.contains(expectedValue));
}
 
开发者ID:alfa-laboratory,项目名称:colibri-ui,代码行数:9,代码来源:CheckSteps.java


示例18: optionalButtonClick

import ru.yandex.qatools.allure.annotations.Step; //导入依赖的package包/类
@Step
@When("(Optional) выполнено нажатие на \"$button\"")
public void optionalButtonClick(@Named("$button") String button) {
    try {
        buttonClick(button);
    } catch (Exception ignored) {
        System.out.println("Не нажато");
    }

}
 
开发者ID:alfa-laboratory,项目名称:colibri-ui,代码行数:11,代码来源:ButtonsSteps.java


示例19: listItemLongtap

import ru.yandex.qatools.allure.annotations.Step; //导入依赖的package包/类
@Step
@When("выполнен лонгтап на элемент \"$fieldName\" с индексом \"$index\"")
public void listItemLongtap(String fieldName, int index) {
    IElement element = getCurrentPage().getElementByName(fieldName);
    List<WebElement> elementsFound = finder.findWebElements(element);
    WebElement firstElement = elementsFound.get(index);
    new TouchAction(driver).longPress(firstElement).release().perform();
}
 
开发者ID:alfa-laboratory,项目名称:colibri-ui,代码行数:9,代码来源:ButtonsSteps.java


示例20: checkNoElement

import ru.yandex.qatools.allure.annotations.Step; //导入依赖的package包/类
@Step
@Then("на экране нет \"$elementName\"")
public void checkNoElement(@Named("$elementName") String elementName) {
    IElement element = getCurrentPage().getElementByName(elementName);
    try {
        finder.findWebElement(element);
        throw new ElementFoundOnPageException(elementName, getCurrentPage().getName());
    } catch (Exception ignored) {
    }
}
 
开发者ID:alfa-laboratory,项目名称:colibri-ui,代码行数:11,代码来源:IOSPageSteps.java



注:本文中的ru.yandex.qatools.allure.annotations.Step类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java KeyStoreResolver类代码示例发布时间:2022-05-21
下一篇:
Java ISerializer类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap