testing library
Test support for DartRosa: build XForms in code and drive them.
Port of org.javarosa.test. Public so app developers can test their own
forms the same way the engine is tested.
Classes
- BindBuilderXFormsElement
-
A builder for a
<bind>element, configured with cascades. - EmptyXFormsElement
- A self-closing element with no content.
- Scenario
- Fills a form from tests: answer by XPath, navigate, add and remove repeat instances, and read answers, choices and prompts.
- StringLiteralXFormsElement
- An element whose content is a raw XML string.
- TagXFormsElement
- An element with child elements.
- XFormsElement
- A piece of an XForm document built in code.
Functions
-
bind(
String nodeset) → BindBuilderXFormsElement -
Starts a
<bind>fornodeset; configure it with cascades. -
body(
List< XFormsElement> children) → XFormsElement -
The
<h:body>element. -
data(
List< XFormsElement> children) → XFormsElement -
A
<data>root element with a random formid. -
formGroup(
String ref, [List< XFormsElement> children = const []]) → XFormsElement -
A
<group>. NamedformGroupso it doesn't clash withpackage:test'sgroup. -
getRef(
String xpath) → TreeReference -
Parses
xpathinto a TreeReference, turning numeric predicates into multiplicities:/data/child[2]refers to the secondchild(multiplicity 1),[-1]means unbound and[@template]the template. -
head(
List< XFormsElement> children) → XFormsElement -
The
<h:head>element. -
html(
XFormsElement head, XFormsElement body, {Map< String, String> additionalNamespaces = const {}}) → XFormsElement -
The
<h:html>root with the standard ODK namespaces plus anyadditionalNamespaces(prefix → URI). -
input(
String ref, [List< XFormsElement> children = const []]) → XFormsElement -
An
<input>control. -
instance(
String name, List< XFormsElement> children) → XFormsElement -
A secondary
<instance id="name">wrapping its items in<root>. -
item(
Object value, String label) → XFormsElement -
A static choice
<item>. -
label(
String innerXml) → XFormsElement -
A
<label>with raw XML content. -
mainInstance(
List< XFormsElement> children) → XFormsElement -
The primary
<instance>(no id). -
model(
List< XFormsElement> children, {Map<String, String> attributes = const {}}) → XFormsElement -
The
<model>element with optional extraattributes. -
repeat(
String nodeset, [List< XFormsElement> children = const [], String? count]) → XFormsElement -
A
<repeat>, optionally with ajr:countexpressioncount. -
select1(
String ref, [List< XFormsElement> children = const []]) → XFormsElement -
A
<select1>control. -
select1Dynamic(
String ref, String nodeset, {String valueRef = 'value', String labelRef = 'label'}) → XFormsElement -
A
<select1>whose choices come from an<itemset>atnodeset. -
setvalue(
String event, String ref, [String? value]) → XFormsElement -
A
<setvalue>action;valueis an XPath expression. -
setvalueLiteral(
String event, String ref, String innerXml) → XFormsElement -
A
<setvalue>action whose value is the literalinnerXml. -
t(
String spec, [List< XFormsElement> children = const []]) → XFormsElement -
Creates an element from
spec(name plus inline attributes) with optionalchildren. -
title(
[String? text]) → XFormsElement -
The
<h:title>element; a random title whentextis omitted. -
tText(
String spec, String innerXml) → XFormsElement -
Creates an element from
specwhose content isinnerXml.
Typedefs
- AnswerResult = AnswerStatus
-
The outcome of Scenario.answer. Port of
Scenario.AnswerResult.