當前位置: 首頁>>代碼示例>>Java>>正文


Java Given類代碼示例

本文整理匯總了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);
}
 
開發者ID:syndesisio,項目名稱:syndesis-qe,代碼行數:24,代碼來源:ConnectionsGeneralSteps.java

示例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; }

}
 
開發者ID:jlhbaseball15,項目名稱:TigerIsland,代碼行數:20,代碼來源:SettlementFoundationStepDefs.java

示例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; }

}
 
開發者ID:jlhbaseball15,項目名稱:TigerIsland,代碼行數:24,代碼來源:GridStepDefs.java

示例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");
}
 
開發者ID:Arquisoft,項目名稱:participationSystem3b,代碼行數:9,代碼來源:AllTest.java

示例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());
        }
    }
}
 
開發者ID:NoraUi,項目名稱:NoraUi,代碼行數:15,代碼來源:HelloByeSteps.java

示例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);
}
 
開發者ID:syndesisio,項目名稱:syndesis-qe,代碼行數:13,代碼來源:SalesforceSteps.java

示例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);
    }
}
 
開發者ID:biblelamp,項目名稱:QAExercises,代碼行數:9,代碼來源:RpnCalculatorStepdefs.java

示例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();
    }
}
 
開發者ID:StefaniniInspiring,項目名稱:pugtsdb,代碼行數:13,代碼來源:RollUpGranularitySteps.java

示例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);
}
 
開發者ID:openaffect,項目名稱:openaffect-server,代碼行數:8,代碼來源:ReportMeauresSteps.java

示例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(",")));
    }
}
 
開發者ID:cerner,項目名稱:jwala,代碼行數:8,代碼來源:BatchLoginRunSteps.java

示例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);
}
 
開發者ID:cerner,項目名稱:jwala,代碼行數:10,代碼來源:CommonRunSteps.java

示例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);
}
 
開發者ID:NHS-digital-website,項目名稱:hippo,代碼行數:15,代碼來源:CmsSteps.java

示例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"))));
	
	
}
 
開發者ID:Arquisoft,項目名稱:dashboard1b,代碼行數:9,代碼來源:CucumberSteps.java

示例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();
}
 
開發者ID:telstra,項目名稱:open-kilda,代碼行數:11,代碼來源:FlowPathTest.java


注:本文中的cucumber.api.java.en.Given類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。