• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java ElementsCollection类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: deleteStepOnPositionAndCheckRest

import com.codeborne.selenide.ElementsCollection; //导入依赖的package包/类
@Then("^she delete step on position \"(\\d+)\" and check rest$")
public void deleteStepOnPositionAndCheckRest(Integer positionOfStep) {
	log.info("Deleting step on position {}", positionOfStep);
	List<String> list = editPage.getFlowViewComponent().getStepsArray();
	ElementsCollection deletes = this.editPage.getFlowViewComponent().getAllTrashes().shouldBe(sizeGreaterThanOrEqual(1));
	Integer indexOfStep = positionOfStep + 1;
	deletes.get(indexOfStep).click();
	editPage.clickOnFirstVisibleButton("OK");
	list.remove(positionOfStep);
	//NOW CHECK:
	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,代码行数:17,代码来源:IntegrationSteps.java


示例2: clickOnAllKebabButtons

import com.codeborne.selenide.ElementsCollection; //导入依赖的package包/类
public void clickOnAllKebabButtons() {
	ElementsCollection kebabButtons = this.getAllKebabButtons().shouldBe(sizeGreaterThan(0));
	for (SelenideElement kebabButton : kebabButtons) {
		log.debug("clicking on kebab button {}", kebabButton.getText());
		kebabButton.click();
	}
}
 
开发者ID:syndesisio,项目名称:syndesis-qe,代码行数:8,代码来源:ConnectionsListComponent.java


示例3: clickDeleteIntegration

import com.codeborne.selenide.ElementsCollection; //导入依赖的package包/类
public void clickDeleteIntegration(String integrationName) {
	log.info("clicking delete link for integration {}", integrationName);

	this.getRootElement().find(Element.ITEM).shouldBe(visible);

	SelenideElement parentElement = null;
	ElementsCollection parentElements = this.getAllIntegrations();

	for (SelenideElement element : parentElements) {
		String name = getIntegrationName(element);
		if (name.equals(integrationName)) {
			parentElement = element;
			break;
		}
	}

	if (parentElement != null) {
		parentElement.find(Button.KEBAB_DROPDOWN).shouldBe(visible).click();
	}

	this.getRootElement().find(Link.KEBAB_DELETE).shouldBe(visible).click();

	SelenideElement okButton = this.getRootElement().find(Button.OK);

	okButton.shouldBe(visible).click();
}
 
开发者ID:syndesisio,项目名称:syndesis-qe,代码行数:27,代码来源:IntegrationsListComponent.java


示例4: checkAllIntegrationsKebabButtons

import com.codeborne.selenide.ElementsCollection; //导入依赖的package包/类
public void checkAllIntegrationsKebabButtons() {
	ElementsCollection integrationsItems = getAllIntegrations();

	for (SelenideElement item : integrationsItems) {
		String status = this.getIntegrationItemStatus(item);

		if (status.equals("Deleted")) {
			this.getKebabButtonFromItem(item).shouldBe(hidden);
		} else {
			SelenideElement kebabB = this.getKebabButtonFromItem(item);
			kebabB.shouldBe(visible).click();

			this.checkIfKebabHasWhatShouldHave(item, status);
		}
	}
}
 
开发者ID:syndesisio,项目名称:syndesis-qe,代码行数:17,代码来源:IntegrationsListComponent.java


示例5: goTrouhListAndCheckDetails

import com.codeborne.selenide.ElementsCollection; //导入依赖的package包/类
@Then("^she go trough whole list of integrations and check on detail if status match and appropriate actions are available$")
public void goTrouhListAndCheckDetails() {
	ElementsCollection integrations = listPage.getListComponent().getAllIntegrations();

	for (SelenideElement integration : integrations) {
		String status = listPage.getListComponent().getIntegrationItemStatus(integration);
		log.info("Status: {}", status);
		integration.shouldBe(visible).click();
		IntegrationDetailPage detailPageSpecific = detailPage.getDetailPage(status);
		for (String action : detailPageSpecific.actionsSet) {
			log.info("Action: {}", action);
			log.info("There should by button for {} action on {} status", action, status);
			detailPageSpecific.getActionButton(action).shouldBe(visible);
		}
		log.info("Status on detail editPage should be equal to expected status:");
		assertThat(detailPageSpecific.getStatus(), is(status));
		detailPageSpecific.done();
	}
}
 
开发者ID:syndesisio,项目名称:syndesis-qe,代码行数:20,代码来源:IntegrationSteps.java


示例6: 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


示例7: decorate

import com.codeborne.selenide.ElementsCollection; //导入依赖的package包/类
@Override
public Object decorate(ClassLoader loader, Field field) {
  By selector = new Annotations(field).buildBy();
  if (selector instanceof ByIdOrName) {
    // throw new IllegalArgumentException("Please define locator for " + field);
    return decorateWithAppium(loader, field);
  } else if (WebElement.class.isAssignableFrom(field.getType())) {
    return ElementFinder.wrap(searchContext, selector, 0);
  } else if (ElementsCollection.class.isAssignableFrom(field.getType())) {
    return new ElementsCollection(new BySelectorCollection(searchContext, selector));
  } else if (ElementsContainer.class.isAssignableFrom(field.getType())) {
    return createElementsContainer(selector, field);
  } else if (isDecoratableList(field, ElementsContainer.class)) {
    return createElementsContainerList(field);
  } else if (isDecoratableList(field, SelenideElement.class)) {
    return SelenideElementListProxy.wrap(factory.createLocator(field));
  }

  return decorateWithAppium(loader, field);
}
 
开发者ID:codeborne,项目名称:selenide-appium,代码行数:21,代码来源:SelenideAppiumFieldDecorator.java


示例8: getSelectedOptions

import com.codeborne.selenide.ElementsCollection; //导入依赖的package包/类
public ElementsCollection getSelectedOptions() {
        //TODO WebElementsCollection should be correctly initialized
        throw new NotImplementedException("TODO");
/*        Select selectField = new Select(getWebElement());
        return new ElementsCollection(new WebElementsCollection() {

            
            public List<WebElement> getActualElements() {
                return selectField.getAllSelectedOptions();
            }

            
            public String description() {
                return null;
            }
        });*/
    }
 
开发者ID:epam,项目名称:JDI,代码行数:18,代码来源:JList.java


示例9: getSelectedOptions

import com.codeborne.selenide.ElementsCollection; //导入依赖的package包/类
public ElementsCollection getSelectedOptions() {
    //TODO WebElementsCollection should be correctly initialized
    throw new NotImplementedException("TODO");
    /*
    Select selectField = new Select(getWebElement());
    return new ElementsCollection(new WebElementsCollection() {

        
        public List<WebElement> getActualElements() {
            return selectField.getAllSelectedOptions();
        }

        
        public String description() {
            return null;
        }
    });*/
}
 
开发者ID:epam,项目名称:JDI,代码行数:19,代码来源:J.java


示例10: getElementContainingText

import com.codeborne.selenide.ElementsCollection; //导入依赖的package包/类
public SelenideElement getElementContainingText(By by, String text) {
	ElementsCollection elements = getRootElement().findAll(by).shouldBe(sizeGreaterThan(0));
	log.info("I found " + elements.size() + " elements.");

	elements = elements.filter(exactText(text));
	log.info("Elements after filter: " + elements.size());
	SelenideElement element = elements.shouldBe(sizeGreaterThan(0)).first();
	return element;
}
 
开发者ID:syndesisio,项目名称:syndesis-qe,代码行数:10,代码来源:SyndesisPageObject.java


示例11: checkAllKebabElementsAreDisplayed

import com.codeborne.selenide.ElementsCollection; //导入依赖的package包/类
public void checkAllKebabElementsAreDisplayed(Boolean shoulBeOpen, List<String> properActions) {
	ElementsCollection kebabElements = this.getAllKebabElements(shoulBeOpen).shouldBe(sizeGreaterThan(0));
	for (SelenideElement kebabElement : kebabElements) {
		kebabElement.shouldBe(visible);
		log.info("checking kebab menu");
		for (String pa : properActions) {
			log.info("testing action:searching for connection {}", pa);
			kebabElement.find(By.linkText(pa)).shouldBe(visible);
		}
	}
}
 
开发者ID:syndesisio,项目名称:syndesis-qe,代码行数:12,代码来源:ConnectionsListComponent.java


示例12: setLatestOpSelect

import com.codeborne.selenide.ElementsCollection; //导入依赖的package包/类
public void setLatestOpSelect(String op) {
	log.info("setting basic filter step op to option number {}", op);
	ElementsCollection opInputArray = this.getRootElement().findAll(Select.OP);
	SelenideElement opInput = opInputArray.get(opInputArray.size() - 1);

	this.selectOption(opInput, op);
}
 
开发者ID:syndesisio,项目名称:syndesis-qe,代码行数:8,代码来源:BasicFilterStepComponent.java


示例13: setLatestPathInput

import com.codeborne.selenide.ElementsCollection; //导入依赖的package包/类
public void setLatestPathInput(String path) {
	log.info("setting basic filter step path to {}", path);
	ElementsCollection pathInputArray = this.getRootElement().findAll(Input.PATH);
	SelenideElement pathInput = pathInputArray.get(pathInputArray.size() - 1);
	
	pathInput.shouldBe(visible).clear();
	pathInput.shouldBe(visible).sendKeys(path);
}
 
开发者ID:syndesisio,项目名称:syndesis-qe,代码行数:9,代码来源:BasicFilterStepComponent.java


示例14: setLatestValueInput

import com.codeborne.selenide.ElementsCollection; //导入依赖的package包/类
public void  setLatestValueInput(String value) {
	log.info("Setting basic filter step value to {}", value);
	ElementsCollection valueInputArray = this.getRootElement().findAll(Input.VALUE);
	SelenideElement valueInput = valueInputArray.get(valueInputArray.size() - 1);

	valueInput.shouldBe(visible).clear();
	valueInput.shouldBe(visible).sendKeys(value);
}
 
开发者ID:syndesisio,项目名称:syndesis-qe,代码行数:9,代码来源:BasicFilterStepComponent.java


示例15: 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


示例16: 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


示例17: 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


示例18: dataMapperColumns

import com.codeborne.selenide.ElementsCollection; //导入依赖的package包/类
/**
 * Find proper source and target datamapper columns.
 *
 * @returns ElementsCollection div elements
 */
private ElementsCollection dataMapperColumns() {
	log.info("searching for columns");
	//loadSelector should be visible:
	this.getRootElement().$(Element.LOADER_SELECTOR).shouldBe(visible);
	log.info("datamapper has been loaded");
	ElementsCollection dmColumns = this.getRootElement().findAll(Element.DM_COLLUMNS).shouldBe(size(2));
	log.info("found {} datamapper columns", dmColumns.size());
	return dmColumns;
}
 
开发者ID:syndesisio,项目名称:syndesis-qe,代码行数:15,代码来源:DataMapperComponent.java


示例19: fieldsCount

import com.codeborne.selenide.ElementsCollection; //导入依赖的package包/类
/**
 * Eventually returns count of found datamapper fields.
 *
 * @returns count of fields
 */
public Integer fieldsCount() {
	ElementsCollection dmColumns = this.dataMapperColumns();
	SelenideElement countElement = dmColumns.get(0).$(Element.LOADER_SELECTOR).shouldBe(visible);
	String countText = countElement.getText();
	// "77 fields" -> 77
	String[] found = countText.split(" ");
	if (found.length != 2) {
		throw new IllegalArgumentException(String.format("failed to get files number from %s", countText));
	}
	return Integer.parseInt(found[0]);
}
 
开发者ID:syndesisio,项目名称:syndesis-qe,代码行数:17,代码来源:DataMapperComponent.java


示例20: createMapping

import com.codeborne.selenide.ElementsCollection; //导入依赖的package包/类
public void createMapping(String source, String target) {
	log.info("creating mapping from {} to {}", source, target);
	ElementsCollection dmColumns = this.dataMapperColumns();
	SelenideElement src = dmColumns.get(0);
	SelenideElement dest = dmColumns.get(1);

	this.selectMapping(source, src);
	this.selectMapping(target, dest);
}
 
开发者ID:syndesisio,项目名称:syndesis-qe,代码行数:10,代码来源:DataMapperComponent.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Properties类代码示例发布时间:2022-05-22
下一篇:
Java LogLevel类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap