本文整理匯總了Java中cucumber.api.java.en.Given類的典型用法代碼示例。如果您正苦於以下問題:Java Given類的具體用法?Java Given怎麽用?Java Given使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
Given類屬於cucumber.api.java.en包,在下文中一共展示了Given類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createSalesforceConnection
import cucumber.api.java.en.Given; //導入依賴的package包/類
@Given("^create SF connection")
public void createSalesforceConnection() {
final Account salesforceAccount = accountsDirectory.getAccount("salesforce").get();
final Connector salesforceConnector = connectorsEndpoint.get("salesforce");
final Connection salesforceConnection = new Connection.Builder()
.connector(salesforceConnector)
.connectorId(salesforceConnector.getId())
.id(RestConstants.getInstance().getSALESFORCE_CONNECTION_ID())
.icon("fa-puzzle-piece")
.name("New Fuse QE salesforce")
.configuredProperties(TestUtils.map(
"clientId", salesforceAccount.getProperty("clientId"),
"clientSecret", salesforceAccount.getProperty("clientSecret"),
"loginUrl", salesforceAccount.getProperty("loginUrl"),
"userName", salesforceAccount.getProperty("userName"),
"password", salesforceAccount.getProperty("password")))
.build();
log.info("Creating salesforce connection {}", salesforceConnection.getName());
connectionsEndpoint.create(salesforceConnection);
}
示例2: there_is_a_tile_with_an_unoccupied_Terrain_hex
import cucumber.api.java.en.Given; //導入依賴的package包/類
@Given("^There is a tile with an unoccupied Terrain hex$")
public void there_is_a_tile_with_an_unoccupied_Terrain_hex() throws Throwable {
ArrayList<Coordinate> coordinates = new ArrayList<>();
coordinates.add(new Coordinate(100,100));
coordinates.add(new Coordinate(101,101));
coordinates.add(new Coordinate(100,101));
ArrayList<TerrainType> terrains = new ArrayList<>();
terrains.add(TerrainType.VOLCANO);
terrains.add(TerrainType.GRASS);
terrains.add(TerrainType.LAKE);
Tile tile = new Tile(coordinates, terrains);
try{ game.placeTile(tile); }
catch (AssertionError e){ exceptionThrown = true; }
}
示例3: there_are_tiles_placed_on_the_board
import cucumber.api.java.en.Given; //導入依賴的package包/類
@Given("^there are tiles placed on the board$")
public void there_are_tiles_placed_on_the_board() throws Throwable {
gameBoard = new Grid(200);
ArrayList<Coordinate> coordinates = new ArrayList<Coordinate>();
coordinates.add(new Coordinate(100,100));
coordinates.add(new Coordinate(101,101));
coordinates.add(new Coordinate(100,101));
ArrayList<TerrainType> terrains = new ArrayList<TerrainType>();
terrains.add(TerrainType.VOLCANO);
terrains.add(TerrainType.GRASS);
terrains.add(TerrainType.LAKE);
Hex[] hexes = new Hex[3];
hexes[0] = new Hex(new Coordinate(100,100), TerrainType.VOLCANO);
hexes[1] = new Hex(new Coordinate(101,101), TerrainType.GRASS);
hexes[2] = new Hex(new Coordinate(100,101), TerrainType.LAKE);
Tile tile = new Tile(coordinates, terrains);
try {gameBoard.placeTile(tile);}
catch (AssertionError e) { exceptionThrown = true; }
}
示例4: a_list_of_users
import cucumber.api.java.en.Given; //導入依賴的package包/類
@Given("^the user is on the login page$")
public void a_list_of_users() throws Throwable {
driver.get(baseUrl+"/");
SeleniumUtils.entrarComoUsuario(driver);
SeleniumUtils.EsperaCargaPagina(driver, "id", "crear", 10);
SeleniumUtils.textoPresentePagina(driver, "Crea tu propuesta");
}
示例5: readBlog
import cucumber.api.java.en.Given; //導入依賴的package包/類
@RetryOnFailure(attempts = 3)
@Given("me any article, please. '(.*)' of '(.*)'.")
public void readBlog(String jsonArticles, String blog) throws FailureException {
Articles articles = new Articles();
articles.deserialize(jsonArticles);
for (Article article : articles) {
if ("anonymous".equals(article.getAuthor())) {
new Result.Failure<>("anonymous", "anonymous is prohibited in demo blog!!", true, this.demoPage.getCallBack());
} else {
logger.info("> " + blog);
logger.info(" > " + article.getTitle() + ": " + article.getText());
}
}
}
示例6: createSfTwStep
import cucumber.api.java.en.Given; //導入依賴的package包/類
@Given("^create SF step for TW SF test")
public void createSfTwStep() {
final Connector salesforceConnector = connectorsEndpoint.get("salesforce");
final Connection salesforceConnection = connectionsEndpoint.get(RestConstants.getInstance().getSALESFORCE_CONNECTION_ID());
final Step salesforceStep = new SimpleStep.Builder()
.stepKind("endpoint")
.connection(salesforceConnection)
.action(TestUtils.findConnectorAction(salesforceConnector, "salesforce-create-sobject"))
.build();
steps.getSteps().add(salesforceStep);
}
示例7: thePreviousEntries
import cucumber.api.java.en.Given; //導入依賴的package包/類
@Given("^the previous entries:$")
public void thePreviousEntries(List<Entry> entries) {
for (Entry entry : entries) {
calc.push(entry.first);
calc.push(entry.second);
calc.push(entry.operation);
}
}
示例8: double
import cucumber.api.java.en.Given; //導入依賴的package包/類
@Given("^a point on \"([^\"]*)\" \"([^\"]*)\" with a double (\\d+)$")
public void aPointOnWithADouble(String timestampState, String timestampUnitString, Double value) throws Throwable {
String sql = " INSERT INTO point (\"metric_id\", \"timestamp\", \"value\") VALUES (?, ?, ?) ";
try (Connection connection = pugTSDB.getDataSource().getConnection();
PreparedStatement statement = connection.prepareStatement(sql)) {
statement.setInt(1, metric.getId());
statement.setTimestamp(2, resolveTimestamp(timestampState, timestampUnitString));
statement.setBytes(3, metric.valueToBytes(value));
statement.execute();
}
}
示例9: there_is_an_OpenAffect_server
import cucumber.api.java.en.Given; //導入依賴的package包/類
@Given("^there is an OpenAffect server")
public void there_is_an_OpenAffect_server() throws Throwable {
Properties properties = new Properties();
properties.load(this.getClass().getClassLoader().getResourceAsStream("environment.properties"));
String url = properties.getProperty("io.openaffect.server.url");
api.getApiClient().setBasePath(url);
}
示例10: loadUserAccounts
import cucumber.api.java.en.Given; //導入依賴的package包/類
@Given("^I load predefined user accounts$")
public void loadUserAccounts() throws IOException {
try (final Stream<String> stream = Files.lines(Paths.get(jwalaUi.getProperties().getProperty("data.source.dir")
+ "/user-accounts.csv"))) {
stream.skip(1).forEach(item -> userAccounts.add(item.split(",")));
}
}
示例11: patient_Search_by_familyName_kanfeld
import cucumber.api.java.en.Given; //導入依賴的package包/類
@Given("^Patient Search by familyName kanfeld$")
public void patient_Search_by_familyName_kanfeld() throws Throwable {
// ourLog.info("GIVEN - Patient Search by familyName");
bundle = client.search().forResource(Patient.class)
.where(new StringClientParam("family").matches().value("kanfeld"))
.returnBundle(Bundle.class).execute();
Assert.assertNotNull(bundle);
}
開發者ID:nhsconnect,項目名稱:careconnect-reference-implementation,代碼行數:11,代碼來源:FHIRServerResourceRESTfulSteps.java
示例12: createGroup
import cucumber.api.java.en.Given; //導入依賴的package包/類
@Given("^I created a group with the name \"(.*)\"$")
public void createGroup(final String groupName) {
createGroupRunSteps.goToGroupTab();
createGroupRunSteps.clickAddGroupBtn();
createGroupRunSteps.checkIfAddGroupDialogBoxIsDisplayed();
createGroupRunSteps.setGroupName(groupName);
createGroupRunSteps.clickOkBtn();
createGroupRunSteps.checkIfGroupWasAdded(groupName);
}
示例13: after
import cucumber.api.java.en.Given; //導入依賴的package包/類
@Given("^I have a published publication with nominal date falling after (\\d+) weeks from now$")
public void iHaveAPublishedPublicationWithNominalDateFallingAfterWeeksFromNow(final int weeksFromNow)
throws Throwable {
final Publication publicationWithNominalDateBeforeCutOff = TestDataFactory.createBareMinimumPublication()
.withNominalDate(Instant.now()
.plus(DAYS_IN_WEEK * weeksFromNow, ChronoUnit.DAYS)
.plus(1, ChronoUnit.DAYS))
.build();
testDataRepo.setPublication(publicationWithNominalDateBeforeCutOff);
createPublishedPublication(publicationWithNominalDateBeforeCutOff);
}
示例14: theUserNavigatesTo
import cucumber.api.java.en.Given; //導入依賴的package包/類
@Given("^the user navigates to \"([^\"]*)\"$")
public void theUserNavigatesTo(String url) throws Throwable {
driver.get(baseUrl + "/");
assertTrue(su.isElementPresent(By.id(("email"))));
assertTrue(su.isElementPresent(By.id(("password"))));
}
示例15: a_multi_path_topology
import cucumber.api.java.en.Given; //導入依賴的package包/類
@Given("^a multi-path topology$")
public void a_multi_path_topology() throws Throwable {
ClassLoader classLoader = getClass().getClassLoader();
File file = new File(classLoader.getResource(fileName).getFile());
String json = new String(Files.readAllBytes(file.toPath()));
pre_start = System.currentTimeMillis();
assertTrue(TopologyHelp.CreateMininetTopology(json));
start = System.currentTimeMillis();
}