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


Java ElementsCollection.size方法代码示例

本文整理汇总了Java中com.codeborne.selenide.ElementsCollection.size方法的典型用法代码示例。如果您正苦于以下问题:Java ElementsCollection.size方法的具体用法?Java ElementsCollection.size怎么用?Java ElementsCollection.size使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.codeborne.selenide.ElementsCollection的用法示例。


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

示例1: deleteRandomStepsAndCheckRest

import com.codeborne.selenide.ElementsCollection; //导入方法依赖的package包/类
@Then("^she delete \"(\\d+)\" random steps and check rest$")
public void deleteRandomStepsAndCheckRest(Integer numberOfSteps) {
	log.info("Deleting random steps");
	List<String> list = editPage.getFlowViewComponent().getStepsArray();
	ElementsCollection deletes = editPage.getFlowViewComponent().getAllTrashes().shouldBe(sizeGreaterThanOrEqual(1));
	int count = deletes.size();
	List<Integer> randomIndexes = new ArrayList<>();
	for (int i = 0; i < numberOfSteps; i++) {
		randomIndexes.add((int) Math.floor(Math.random() * (count - 2 - i)));
	}
	for (Integer randomIndex : randomIndexes) {
		deletes.get(randomIndex + 1).click();
		editPage.clickOnFirstVisibleButton("OK");
		list.remove(randomIndex);
	}
	List<String> list2 = editPage.getFlowViewComponent().getStepsArray();
	for (int i = 0; i < list.size(); i++) {
		log.info("assserting {} and {", list.get(i), list2.get(i));
		assertThat(list.get(i), is(list2.get(i)));
	}
}
 
开发者ID:syndesisio,项目名称:syndesis-qe,代码行数:22,代码来源:IntegrationSteps.java

示例2: getPathInputAllValues

import com.codeborne.selenide.ElementsCollection; //导入方法依赖的package包/类
public List<String> getPathInputAllValues() {
	ElementsCollection pathInputArray = this.getPathInputs();
	int count = pathInputArray.size();

	List<String> pathInputValues = new ArrayList<String>();

	for (int i = 0; i < count; i++) {
		String value = pathInputArray.get(i).getAttribute("value");
		pathInputValues.add(value);
	}

	return pathInputValues;
}
 
开发者ID:syndesisio,项目名称:syndesis-qe,代码行数:14,代码来源:BasicFilterStepComponent.java

示例3: getValueInputAllValues

import com.codeborne.selenide.ElementsCollection; //导入方法依赖的package包/类
public List<String> getValueInputAllValues() {
	ElementsCollection valueInputArray = this.getValueInputs();
	int count = valueInputArray.size();

	List<String> valueInputValues = new ArrayList<String>();

	for (int i = 0; i < count; i++) {
		String value = valueInputArray.get(i).getAttribute("value");
		valueInputValues.add(value);
	}

	return valueInputValues;
}
 
开发者ID:syndesisio,项目名称:syndesis-qe,代码行数:14,代码来源:BasicFilterStepComponent.java

示例4: getOpSelectAllValues

import com.codeborne.selenide.ElementsCollection; //导入方法依赖的package包/类
public List<String> getOpSelectAllValues() {
	log.debug("Searching basic filter op select checked options");

	ElementsCollection opSelectArray = this.getOpSelects();
	int size = opSelectArray.size();

	List<String> opSelectValues = new ArrayList<String>();

	for (int i = 0; i < size; i++) {
		String value = opSelectArray.get(i).shouldBe(visible).getText();
		opSelectValues.add(value.trim());
	}

	return opSelectValues;
}
 
开发者ID:syndesisio,项目名称:syndesis-qe,代码行数:16,代码来源:BasicFilterStepComponent.java

示例5: addRandomStepsAndCheckRest

import com.codeborne.selenide.ElementsCollection; //导入方法依赖的package包/类
@Then("^she adds \"(\\d+)\" random steps and then check the structure$")
public void addRandomStepsAndCheckRest(Integer numberOfSteps) {
	log.info("Adding random steps");
	List<String> list = editPage.getFlowViewComponent().getStepsArray();
	editPage.clickButton("Add a Step");
	ElementsCollection links = editPage.getLinks("Add a step");
	Integer count = links.size();
	List<Integer> randomIndexes = new ArrayList<>();
	for (int i = 0; i < numberOfSteps; i++) {
		randomIndexes.add((int) Math.floor((Math.random() * count)));
	}
	for (int randomIndex : randomIndexes) {
		links.get(randomIndex).click();
		String stepType = "Basic Filter";
		String stepParameter = "ANY of the following, pathx " + randomIndex + ", Contains, valuex " + randomIndex;
		editPage.getAddStepComponent().addStep(stepType);
		StepComponent stepComponent = editPage.getStepComponent(stepType, stepParameter);
		stepComponent.fillConfiguration();
		editPage.clickButton("Next");
		editPage.clickButton("Add a Step");
		list.add(randomIndex, stepParameter);
	}
	List<String> list2 = editPage.getFlowViewComponent().getStepsArray();
	for (int i = 0; i < list2.size(); i++) {
		log.info("assserting {} and {}", list.get(i), list2.get(i));
		assertThat(list.get(i), is(list2.get(i)));
	}
}
 
开发者ID:syndesisio,项目名称:syndesis-qe,代码行数:29,代码来源:IntegrationSteps.java

示例6: createConnections

import com.codeborne.selenide.ElementsCollection; //导入方法依赖的package包/类
@Given("^created connections$")
public void createConnections(DataTable connectionsData) {
	ConnectionSteps connectionSteps = new ConnectionSteps();
	ConnectionsListComponent connectionsListComponent = new ConnectionsListComponent();
	
	List<List<String>> dataTable = connectionsData.raw();
	
	for (List<String> dataRow : dataTable) {
		String connectionType = dataRow.get(0);
		String connectionCredentialsName = dataRow.get(1);		
		String connectionName = dataRow.get(2);
		String connectionDescription = dataRow.get(3);
		
		navigateTo("", "Connections");
		validatePage("", "Connections");

		ElementsCollection connections = connectionsListComponent.getAllConnections();
		connections = connections.filter(exactText(connectionName));

		if (connections.size() != 0) {
			log.warn("Connection {} already exists!", connectionName);
		} else {
			clickOnButton("Create Connection");

			connectionSteps.selectConnection(connectionType);
			connectionSteps.fillConnectionDetails(connectionCredentialsName);

			clickOnButton("Validate");
			successNotificationIsPresentWithError(connectionType + " has been successfully validated");

			scrollTo("top", "right");
			clickOnButton("Next");

			connectionSteps.typeConnectionName(connectionName);
			connectionSteps.typeConnectionDescription(connectionDescription);

			clickOnButton("Create");
		} 
	}
}
 
开发者ID:syndesisio,项目名称:syndesis-qe,代码行数:41,代码来源:CommonSteps.java

示例7: addAttributeValue

import com.codeborne.selenide.ElementsCollection; //导入方法依赖的package包/类
public PrismForm<T> addAttributeValue(String name, String value) {
    SelenideElement property = findProperty(name);

    ElementsCollection values = property.$$(By.className("prism-property-value"));
    if (values.size() == 1) {
        values.first().$(By.className("form-control")).setValue(value);
    }
    // todo implement
    return this;
}
 
开发者ID:Evolveum,项目名称:midpoint,代码行数:11,代码来源:PrismForm.java

示例8: moveThroughPages

import com.codeborne.selenide.ElementsCollection; //导入方法依赖的package包/类
private void moveThroughPages(int offsetFromActual) {
    SelenideElement ul = getParentElement().$(By.cssSelector(".pagination.pagination-sm.no-margin.pull-right"));

    ElementsCollection col = ul.$$x(".//li");
    SelenideElement active = col.find(Condition.cssClass("active"));
    int index = col.indexOf(active);

    index = index + offsetFromActual;
    if (index < 2 || index > col.size() - 2) {
        // it's <<, <, >, >>
        throw new SchrodingerException("Can't move through paging, page doesn't exist");
    }

    col.get(index).$x(".//a").click();
}
 
开发者ID:Evolveum,项目名称:midpoint,代码行数:16,代码来源:Paging.java

示例9: countConnections

import com.codeborne.selenide.ElementsCollection; //导入方法依赖的package包/类
public Integer countConnections() {
	ElementsCollection allConnections = this.getAllConnections();
	log.info("found {} connections", allConnections.size());
	return allConnections.size();
}
 
开发者ID:syndesisio,项目名称:syndesis-qe,代码行数:6,代码来源:ConnectionsListComponent.java

示例10: getStepsArray

import com.codeborne.selenide.ElementsCollection; //导入方法依赖的package包/类
public List<String> getStepsArray() {
	ElementsCollection steps = this.getRootElement().findAll(Element.STEP);

	List<String> stepsArray = new ArrayList<String>();

	for (int i = 1; i < (steps.size() - 1); i++) {
		steps.get(i).click();

		SelenideElement title = this.getRootElement().find(Element.ACTIVE_STEP);

		String type = title.getText();
		StepComponent stepComponent = stepComponentFactory.getStep(type, "");

		//wait for root element to be loaded
		stepComponent.getRootElement();
		stepComponent.initialize();

		stepsArray.add(stepComponent.getParameter());
	}

	this.clickOnFirstVisibleButton("Done");

	return stepsArray;
}
 
开发者ID:syndesisio,项目名称:syndesis-qe,代码行数:25,代码来源:IntegrationFlowViewComponent.java


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