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


Java Step类代码示例

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


Step类属于com.thoughtworks.gauge包,在下文中一共展示了Step类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: showTheLogInStatusForUser

import com.thoughtworks.gauge.Step; //导入依赖的package包/类
@Step("Show the log in status for user <customer>")
public void showTheLogInStatusForUser(String customer) {
    WebDriver webDriver = Driver.webDriver;
    WebElement authenticatedInfo = webDriver.findElement(By.id("auth"));
    assertTrue(authenticatedInfo.isDisplayed());
    assertTrue(authenticatedInfo.getText().contains("Welcome " + customer + "! Not you?"));
}
 
开发者ID:getgauge-examples,项目名称:java-maven-selenium,代码行数:8,代码来源:LogIn.java

示例2: LoginAsCustomerDetails

import com.thoughtworks.gauge.Step; //导入依赖的package包/类
@Step("Login as name <name> and <password>")
public void LoginAsCustomerDetails(String name, String password) {
    WebDriver webDriver = Driver.webDriver;
    webDriver.findElement(By.linkText("Log in")).click();
    webDriver.findElement(By.name("login")).sendKeys(name);
    webDriver.findElement(By.name("password")).sendKeys(password);
    webDriver.findElement(By.name("commit")).click();
}
 
开发者ID:getgauge-examples,项目名称:java-maven-selenium,代码行数:9,代码来源:LogIn.java

示例3: registerCustomerWith

import com.thoughtworks.gauge.Step; //导入依赖的package包/类
@Step("Sign up as <customer> with email <[email protected]> and <password>")
public void registerCustomerWith(String customer, String email, String password) {
    WebDriver webDriver = Driver.webDriver;
    webDriver.findElement(By.linkText("Sign up")).click();
    WebElement form = webDriver.findElement(By.id("new_user"));
    form.findElement(By.name("user[username]")).sendKeys(customer);
    form.findElement(By.name("user[email]")).sendKeys(email);
    form.findElement(By.name("user[password]")).sendKeys(password);
    form.findElement(By.name("user[password_confirmation]")).sendKeys(password);
    form.findElement(By.name("commit")).click();
}
 
开发者ID:getgauge-examples,项目名称:java-maven-selenium,代码行数:12,代码来源:CustomerSignup.java

示例4: clearPreviousLogin

import com.thoughtworks.gauge.Step; //导入依赖的package包/类
@Step("Clear previous login")
public void clearPreviousLogin() {
    try {
        logOut();
    } catch (Exception ex) {
        System.out.println("no previously logged in Customers");
    }
}
 
开发者ID:getgauge-examples,项目名称:java-maven-selenium,代码行数:9,代码来源:LogOut.java

示例5: searchUser

import com.thoughtworks.gauge.Step; //导入依赖的package包/类
@Step("Fill in and send registration form")
public void searchUser() {
    String username = localPart();
    SignUpPage signUpPage = PageFactory.initElements(driver, SignUpPage.class);
    signUpPage.user_username.sendKeys(username);
    signUpPage.user_email.sendKeys(username.concat("@domain.com"));
    signUpPage.user_password.sendKeys("qweqwe");
    signUpPage.user_password_confirmation.sendKeys("qweqwe");
    signUpPage.commit.submit();
    // store generated username
    signUpPage.storeStringToScenarioDataStore("currentUser", username);
}
 
开发者ID:getgauge-examples,项目名称:java-gradle-selenium,代码行数:13,代码来源:UserSpec.java

示例6: verifyCustomers

import com.thoughtworks.gauge.Step; //导入依赖的package包/类
@Step("Search for customers <table>")
public void verifyCustomers(Table table) {
    List<TableRow> rows = table.getTableRows();
    List<String> columnNames = table.getColumnNames();
    for (TableRow row : rows) {
        searchUser(row.getCell(columnNames.get(0)));
        verifyUserIsListed(row.getCell(columnNames.get(0)));
    }
}
 
开发者ID:getgauge-examples,项目名称:java-gradle-selenium,代码行数:10,代码来源:CustomerSpec.java

示例7: CreateProduct

import com.thoughtworks.gauge.Step; //导入依赖的package包/类
@Step("Create a product <table>")
public void CreateProduct(Table table) {
    List<TableRow> rows = table.getTableRows();
    List<String> columnNames = table.getColumnNames();
    for (TableRow row : rows) {
        openNewProductsPage();
        CreateProductPage createProductPage = PageFactory.initElements(driver, CreateProductPage.class);
        createProductPage.create(row.getCell(columnNames.get(0)), row.getCell(columnNames.get(1)), row.getCell(columnNames.get(2)), row.getCell(columnNames.get(3)));
    }
}
 
开发者ID:getgauge-examples,项目名称:java-gradle-selenium,代码行数:11,代码来源:ProductSpec.java

示例8: updateProductValue

import com.thoughtworks.gauge.Step; //导入依赖的package包/类
@Step("Update product specifier to new value <table>")
public void updateProductValue(Table table) {
    List<TableRow> rows = table.getTableRows();
    List<String> columnNames = table.getColumnNames();
    for (TableRow row : rows) {
        openProductEditPage();
        EditProductPage editProductPage = PageFactory.initElements(driver, EditProductPage.class);
        editProductPage.updateProductValue(row.getCell(columnNames.get(0)), row.getCell(columnNames.get(1)));
    }
}
 
开发者ID:getgauge-examples,项目名称:java-gradle-selenium,代码行数:11,代码来源:ProductSpec.java

示例9: verifyProductValue

import com.thoughtworks.gauge.Step; //导入依赖的package包/类
@Step("Check product specifier has new value <table>")
public void verifyProductValue(Table table) {
    List<TableRow> rows = table.getTableRows();
    List<String> columnNames = table.getColumnNames();
    for (TableRow row : rows) {
        ProductPage productPage = PageFactory.initElements(driver, ProductPage.class);
        WebElement specifier = productPage.getWebElementByName((row.getCell(columnNames.get(0))));
        productPage.verifyProductSpecifier(specifier, row.getCell(columnNames.get(1)));
    }
}
 
开发者ID:getgauge-examples,项目名称:java-gradle-selenium,代码行数:11,代码来源:ProductSpec.java

示例10: stepWithTable

import com.thoughtworks.gauge.Step; //导入依赖的package包/类
@Step("Step that takes a table <table>")
public void stepWithTable(Table table) {
    System.out.println(table.getColumnNames());

    for (TableRow tableRow : table.getTableRows()) {
        System.out.println(tableRow.getCell("Product") + " " + tableRow.getCell("Description"));
    }
}
 
开发者ID:manupsunny,项目名称:gauge-gradle-plugin,代码行数:9,代码来源:StepImplementation.java

示例11: setLanguageVowels

import com.thoughtworks.gauge.Step; //导入依赖的package包/类
@Step("Vowels in English language are <vowelString>.")
public void setLanguageVowels(String vowelString) {
    vowels = new HashSet<>();
    for (char ch : vowelString.toCharArray()) {
        vowels.add(ch);
    }
}
 
开发者ID:getgauge,项目名称:gauge-maven-plugin,代码行数:8,代码来源:StepImplementation.java

示例12: verifyVowelsCountInMultipleWords

import com.thoughtworks.gauge.Step; //导入依赖的package包/类
@Step("Almost all words have vowels <wordsTable>")
public void verifyVowelsCountInMultipleWords(Table wordsTable) {
    for (TableRow row : wordsTable.getTableRows()) {
        String word = row.getCell("Word");
        int expectedCount = Integer.parseInt(row.getCell("Vowel Count"));
        int actualCount = countVowels(word);

        assertEquals(expectedCount, actualCount);
    }
}
 
开发者ID:getgauge,项目名称:gauge-maven-plugin,代码行数:11,代码来源:StepImplementation.java

示例13: addItemToTheBasket

import com.thoughtworks.gauge.Step; //导入依赖的package包/类
@Step("Add item <item> to the cart.")
public void addItemToTheBasket(String item) {
    WebDriver webDriver = Driver.webDriver;
    webDriver.findElement(By.linkText(item)).click();
    webDriver.findElement(By.linkText("Add to Card")).click();
}
 
开发者ID:getgauge-examples,项目名称:java-maven-selenium,代码行数:7,代码来源:PlaceOrder.java

示例14: placeTheOrder

import com.thoughtworks.gauge.Step; //导入依赖的package包/类
@Step("Checkout now")
public void placeTheOrder() {
    WebDriver webDriver = Driver.webDriver;
    webDriver.findElement(By.xpath("//input[@value='Checkout Now!']")).click();
}
 
开发者ID:getgauge-examples,项目名称:java-maven-selenium,代码行数:6,代码来源:PlaceOrder.java

示例15: cartNowContains

import com.thoughtworks.gauge.Step; //导入依赖的package包/类
@Step("Cart now contains <itemCount> number of items")
public void cartNowContains(int numberOfItems) {
    WebDriver webDriver = Driver.webDriver;
    List<WebElement> products = webDriver.findElements(By.xpath("//table/tbody/tr"));
    assertEquals(numberOfItems,products.size()-2);
}
 
开发者ID:getgauge-examples,项目名称:java-maven-selenium,代码行数:7,代码来源:PlaceOrder.java


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