当前位置: 首页>>代码示例>>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;未经允许,请勿转载。