本文整理匯總了Java中cucumber.api.java.en.And類的典型用法代碼示例。如果您正苦於以下問題:Java And類的具體用法?Java And怎麽用?Java And使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
And類屬於cucumber.api.java.en包,在下文中一共展示了And類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: setJmsSubscribeData
import cucumber.api.java.en.And; //導入依賴的package包/類
@And("^sets jms subscribe inputs source data$")
public void setJmsSubscribeData(DataTable sourceMappingData) {
for (Map<String, String> source : sourceMappingData.asMaps(String.class, String.class)) {
for (String field : source.keySet()) {
SelenideElement element = editPage.getJmsSubscribeComponent().checkAndGetFieldType(field);
assertThat(element, notNullValue());
editPage.getJmsSubscribeComponent().setElementValue(source.get(field), element);
}
}
}
示例2: setJmsRequestData
import cucumber.api.java.en.And; //導入依賴的package包/類
@And("^sets jms request inputs source data$")
public void setJmsRequestData(DataTable sourceMappingData) {
for (Map<String, String> source : sourceMappingData.asMaps(String.class, String.class)) {
for (String field : source.keySet()) {
SelenideElement element = editPage.getJmsSubscribeComponent().checkAndGetFieldType(field);
assertThat(element, notNullValue());
editPage.getJmsSubscribeComponent().setElementValue(source.get(field), element);
}
}
}
示例3: setJmsPublishData
import cucumber.api.java.en.And; //導入依賴的package包/類
@And("^sets jms publish inputs source data$")
public void setJmsPublishData(DataTable sourceMappingData) {
for (Map<String, String> source : sourceMappingData.asMaps(String.class, String.class)) {
for (String field : source.keySet()) {
SelenideElement element = editPage.getJmsPublishComponent().checkAndGetFieldType(field);
assertThat(element, notNullValue());
editPage.getJmsPublishComponent().setElementValue(source.get(field), element);
}
}
}
示例4: iSearchForUnderUsedCars
import cucumber.api.java.en.And; //導入依賴的package包/類
@And("^I search for \"([^\"]*)\" under Used Cars$")
public void iSearchForUnderUsedCars(String carName) throws Throwable {
/* TODO - Assignment - Move the below statements to a page class */
appiumDriver.findElement(By.xpath("//android.widget.TextView[@text='Cars']")).click();
appiumDriver.findElement(By.id("cnb_hp_choose_et")).click();
appiumDriver.findElement(By.id("cnb_search_text_et")).sendKeys(carName);
List<WebElement> results = appiumDriver.findElements(By.id("text1"));
for (WebElement result : results) {
if (result.getText().contains(carName)) {
result.click();
break;
}
}
appiumDriver.findElement(By.id("cnb_search_button")).click();
}
示例5: configurationContainsDependencies
import cucumber.api.java.en.And; //導入依賴的package包/類
@And("^Project \"([^\"]*)\" contains dependencies:$")
public void configurationContainsDependencies(String projectName, List<List<String>> dependencies) throws Throwable {
this.projectName = projectName;
JsonObject reportForProject = report.getAsJsonObject(projectName);
assertThat(reportForProject).describedAs("Report for " + projectName).isNotNull();
Stream<List<String>> entries = reportForProject
.entrySet()
.stream()
.flatMap(configurationEntry -> StreamSupport
.stream(configurationEntry.getValue().getAsJsonArray().spliterator(), false)
.map(JsonObject.class::cast)
.map(dependency -> asList(
configurationEntry.getKey(),
dependency.get("coordinates").getAsString()
)));
assertThat(entries)
.containsOnly(dependencies.toArray(new List[]{}));
}
示例6: iSetParameters
import cucumber.api.java.en.And; //導入依賴的package包/類
@And("^I set template with parameters$")
public void iSetParameters() throws Throwable {
Parameter parameter = new Parameter();
parameter.setKey("title");
parameter.setValue("Monsieur");
email.addParametersItem(parameter);
parameter = new Parameter();
parameter.setKey("firstName");
parameter.setValue("Jérémie");
email.addParametersItem(parameter);
parameter = new Parameter();
parameter.setKey("lastName");
parameter.setValue("Zanone");
email.addParametersItem(parameter);
email.setTemplate(api.getTemplate(2l).getUrl());
}
示例7: enterAttributeInMetaData
import cucumber.api.java.en.And; //導入依賴的package包/類
@And("^I enter attribute in the file MetaData with the following parameters:$")
public void enterAttributeInMetaData(Map<String, String> parameters) {
navigationRunSteps.goToConfigurationTab();
navigationRunSteps.goToResourceTab();
uploadResourceRunSteps.expandNode(parameters.get("group"));
uploadResourceRunSteps.expandNode(parameters.get("componentType"));
uploadResourceRunSteps.clickNode(parameters.get("componentName"));
handleResourceRunSteps.clickResource(parameters.get("fileName"));
handleResourceRunSteps.clickTab("Meta Data");
handleResourceRunSteps.enterAttribute(parameters.get("attributeKey"), parameters.get("attributeValue"));
handleResourceRunSteps.clickSaveButton("Meta Data");
if(parameters.get("override").equals("true")){
handleResourceRunSteps.clickOk();
}
handleResourceRunSteps.waitForNotification("Saved");
}
示例8: iHaveCreatedATag
import cucumber.api.java.en.And; //導入依賴的package包/類
@And("^I have created a tag$")
public void iHaveCreatedATag() throws Throwable {
tag = new Tag();
tag.setName("Advertising");
tag.setTemplates(Collections.singletonList(template.getUrl()));
api.createTag(tag);
tag = api.getTags().get(api.getTags().size() - 1);
assertNotNull(tag);
}
示例9: iChooseToRegister
import cucumber.api.java.en.And; //導入依賴的package包/類
@And("^I choose to register$")
public void iChooseToRegister() throws Throwable {
appiumDriver.findElement(By.id("hamburger")).click();
Thread.sleep(5 * 1000);
appiumDriver.findElement(By.id("hamLoginLink")).click();
}
示例10: iChooseAsMyCity
import cucumber.api.java.en.And; //導入依賴的package包/類
@And("^I choose \"([^\"]*)\" as my city$")
public void iChooseAsMyCity(String city) throws Throwable {
new LandingPage(appiumDriver).skipToHomePage();
/* TODO - Assignment - Move the try catch logic to base page */
try {
if (appiumDriver.findElement(By.xpath("//android.widget.Button[@text='Later']")).isDisplayed())
appiumDriver.findElement(By.xpath("//android.widget.Button[@text='Later']")).click();
} catch (Exception e) {
//do nothing
}
new HomePage(appiumDriver).selectCity(city);
}
示例11: iChangeTemplateSBody
import cucumber.api.java.en.And; //導入依賴的package包/類
@And("^I change template's body$")
public void iChangeTemplateSBody() throws Throwable {
body = "<span th:text=\\\" 'Hello ' + ${title} + ',\n" +
"My name is ' + ${firstName} + ' ' + ${lastName} + '.\n'" +
"'Do you want to come to ' + ${place} + ' the ' + ${date} + ' ?\n'" +
"\\\"></span>";
template.setBody(body);
assertEquals(body, template.getBody());
}
示例12: iGetIDOfLastTemplate
import cucumber.api.java.en.And; //導入依賴的package包/類
@And("^I get ID of last template")
public void iGetIDOfLastTemplate() throws Throwable {
int size = api.getTemplates().size();
String url = api.getTemplates().get(size - 1).getUrl();
int indexOfId = url.lastIndexOf('/');
id = Long.valueOf(Integer.parseInt(url.substring(indexOfId + 1, url.length())));
assertNotEquals(0, (long) id);
}
示例13: generateAndStartWebserver
import cucumber.api.java.en.And; //導入依賴的package包/類
@And("^I generate and start the webserver with the following parameters:$")
public void generateAndStartWebserver(Map<String, String> parameters) {
navigationRunSteps.goToOperationsTab();
navigationRunSteps.expandGroupInOperationsTab(parameters.get("group"));
generateWebServerRunSteps.generateIndividualWebserver(parameters.get("webserverName"), parameters.get("group"));
generateWebServerRunSteps.checkForSuccessfulGenerationOfAWebserver();
startWebServersOfGroup(parameters.get("webserverName"), parameters.get("group"));
startWebServerRunSteps.checkIfWebServerStateIsStarted(parameters.get("webserverName"), parameters.get("group"));
}
示例14: generateAndStartJvm
import cucumber.api.java.en.And; //導入依賴的package包/類
@And("^I generate and start the jvm with the following parameters:$")
public void generateAndStartJvm(Map<String, String> parameters) {
navigationRunSteps.goToOperationsTab();
navigationRunSteps.expandGroupInOperationsTab(parameters.get("group"));
generateJvmRunSteps.generateIndividualJvm(parameters.get("jvmName"), parameters.get("group"));
generateJvmRunSteps.checkForSuccessfulGenerationIndividualJvm();
startJvmOfGroup(parameters.get("jvmName"), parameters.get("group"));
startJvmRunSteps.checkIfJvmStateIsStarted(parameters.get("jvmName"), parameters.get("group"));
}
示例15: goToResourceWebappUnderJvm
import cucumber.api.java.en.And; //導入依賴的package包/類
@And("^I go to the web-app file in resources under individual jvm with the following parameters:$")
public void goToResourceWebappUnderJvm(Map<String, String> parameters) {
navigationRunSteps.goToConfigurationTab();
navigationRunSteps.goToResourceTab();
uploadResourceRunSteps.expandNode(parameters.get("group"));
uploadResourceRunSteps.expandNode("JVMs");
uploadResourceRunSteps.expandNode(parameters.get("jvmName"));
uploadResourceRunSteps.clickNode(parameters.get("app"));
handleResourceRunSteps.selectFile(parameters.get("file"));
}