本文整理了Java中org.mozilla.zest.core.v1.ZestAssignFromElement.whereAttributeIs()
方法的一些代码示例,展示了ZestAssignFromElement.whereAttributeIs()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZestAssignFromElement.whereAttributeIs()
方法的具体详情如下:
包路径:org.mozilla.zest.core.v1.ZestAssignFromElement
类名称:ZestAssignFromElement
方法名:whereAttributeIs
暂无
代码示例来源:origin: mozilla/zest
public ZestAssignFromElement whereAttributeIs(
String attributeName, String attributeValueRegExp) {
return whereAttributeIs(attributeName, attributeValueRegExp, 0);
}
代码示例来源:origin: mozilla/zest
@Test(expected = ZestAssignFailException.class)
public void invalidRegExShouldThrowAZestAssignFailException() throws Exception {
// Given
ZestAssignFromElement fromElement =
new ZestAssignFromElement("Var")
.whereAttributeIs("title", "[")
.atIndex(0)
.selectContent();
// When
assign(fromElement, testPageB);
// Then = ZestAssignFailException
}
代码示例来源:origin: mozilla/zest
@Test
public void filterByValueIsStartingWithChoiceAndSelectContentOfSecondItem() throws Exception {
// Given
ZestAssignFromElement fromElement =
new ZestAssignFromElement("Var")
.whereAttributeIs("value", "Choice.*")
.atIndex(1)
.selectContent();
// When
String result = assign(fromElement, testPageB);
// Then
assertEquals("Choice 2", result);
}
代码示例来源:origin: mozilla/zest
@Test
public void filterByElementAndAttributeThenSelectTheFirstContent() throws Exception {
// Given
ZestAssignFromElement fromElement =
new ZestAssignFromElement("Var")
.whereElementIs("li")
.whereAttributeIs("id", "2")
.first()
.selectContent();
// When
String result = assign(fromElement, testPageA);
// Then
assertEquals("Aliquam tincidunt mauris eu risus.", result);
}
内容来源于网络,如有侵权,请联系作者删除!