本文整理了Java中org.mozilla.zest.core.v1.ZestFieldDefinition
类的一些代码示例,展示了ZestFieldDefinition
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZestFieldDefinition
类的具体详情如下:
包路径:org.mozilla.zest.core.v1.ZestFieldDefinition
类名称:ZestFieldDefinition
[英]The Class ZestFieldDefinition.
[中]类ZestFieldDefinition。
代码示例来源:origin: mozilla/zest
@Override
public ZestFieldDefinition deepCopy() {
ZestFieldDefinition ze = new ZestFieldDefinition(this.formName, this.fieldName);
ze.setFormIndex(this.getFormIndex());
return ze;
}
代码示例来源:origin: mozilla/zest
/**
* Gets the key.
*
* @return the key
*/
public String getKey() {
if (this.formName != null) {
return this.getFormName() + ":" + this.getFieldName();
} else {
return this.getFormIndex() + ":" + this.getFieldName();
}
}
}
代码示例来源:origin: mozilla/zest
@Test(expected = ZestAssignFailException.class)
public void shouldFailTheAssignIfResponseIsNotProvided() throws Exception {
// Given
ZestResponse response = null;
ZestAssignFieldValue assignFieldValue =
new ZestAssignFieldValue("Var", new ZestFieldDefinition(0, "Field"));
// When
assignFieldValue.assign(response, new TestRuntime());
// Then = ZestAssignFailException
}
}
代码示例来源:origin: mozilla/zest
@Override
public String assign(ZestResponse response, ZestRuntime runtime)
throws ZestAssignFailException {
if (response == null) {
throw new ZestAssignFailException(this, "Null response");
}
Source src = new Source(response.getHeaders() + response.getBody());
List<Element> formElements = src.getAllElements(HTMLElementName.FORM);
if (formElements != null && fieldDefinition.getFormIndex() < formElements.size()) {
Element form = formElements.get(fieldDefinition.getFormIndex());
List<Element> inputElements = form.getAllElements(HTMLElementName.INPUT);
for (Element inputElement : inputElements) {
if (fieldDefinition.getFieldName().equals(inputElement.getAttributeValue("ID"))
|| fieldDefinition
.getFieldName()
.equals(inputElement.getAttributeValue("NAME"))) {
// Got it
return inputElement.getAttributeValue("VALUE");
}
}
}
return null;
}
}
代码示例来源:origin: mozilla/zest
@Override
public ZestAssignFieldValue deepCopy() {
ZestAssignFieldValue copy =
new ZestAssignFieldValue(this.getVariableName(), this.fieldDefinition.deepCopy());
copy.setEnabled(this.isEnabled());
return copy;
}
代码示例来源:origin: mozilla/zest
zc2.addIf(req2);
checkOrder(new ZestStatement[] {zc1, req1, zc2, req2, null});
xfrm1.setFieldDefinition(new ZestFieldDefinition(1, "xxx"));
checkOrder(new ZestStatement[] {zc1, req1, zc2, req2, req3, zc3, req4, req5, zc4, null});
zc4.addElse(req6);
xfrm2.setFieldDefinition(new ZestFieldDefinition(1, "xxx"));
内容来源于网络,如有侵权,请联系作者删除!