当前位置: 首页>>代码示例>>Java>>正文


Java Step类代码示例

本文整理汇总了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"));
    }
}
 
开发者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


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