Skip to content

Commit

Permalink
Add FillBlankForm regression tests (getodk#3598)
Browse files Browse the repository at this point in the history
* Add fill blank form tests

* Add FillBlankForm regression tests

* Add regression FillBlankForm tests

* Improve test names
  • Loading branch information
kkrawczyk123 authored and grzesiek2010 committed Jan 21, 2020
1 parent abf7be1 commit edb3d8c
Show file tree
Hide file tree
Showing 17 changed files with 1,805 additions and 1 deletion.
198 changes: 198 additions & 0 deletions collect_app/src/androidTest/assets/forms/3403.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,198 @@
<?xml version="1.0"?>
<h:html
xmlns="http://www.w3.org/2002/xforms"
xmlns:ev="http://www.w3.org/2001/xml-events"
xmlns:h="http://www.w3.org/1999/xhtml"
xmlns:jr="http://openrosa.org/javarosa"
xmlns:odk="http://www.opendatakit.org/xforms"
xmlns:orx="http://openrosa.org/xforms"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<h:head>
<h:title>3403_ODK Version 1.23.3 Tester</h:title>
<model>
<itext>
<translation default="true()" lang="English">
<text id="/ODK-1.23/farmer_activityselect/farmer_individualnote:label">
<value>FARM ACTIVITIES TO PERFORM:

Please select below the activities you are going to perform at this FARM.
The activities that appear in the list are the ones you have rights to perform.</value>
</text>
<text id="/ODK-1.23/farmer_activityselect/form_farmextraactivities:label">
<value>&lt;br&gt;Please select the FARM EXTRA activities you are going to perform</value>
</text>
<text id="/ODK-1.23/farmer_activityselect/staff_doescalfmonitoringactivities:label">
<value>If selected staff does CALF MONITORING activities</value>
</text>
<text id="/ODK-1.23/farmer_activityselect/staff_doesbreedingactivities:label">
<value>If selected staff does breeding activities</value>
</text>
<text id="/ODK-1.23/farmer_activityselect/form_registrationactivities/activity_code:label">
<value>activity_name</value>
</text>
<text id="/ODK-1.23/farmer_activityselect/form_breedingactivities/activity_code:label">
<value>activity_name</value>
</text>
<text id="/ODK-1.23/farmer_activityselect/form_calfmonitoringactivities/activity_code:label">
<value>activity_name</value>
</text>
<text id="/ODK-1.23/farmer_activityselect/staff_doesfarmextraactivities:label">
<value>If selected staff does farm extra activities</value>
</text>
<text id="/ODK-1.23/farmer_activityselect/form_cattlemgmtactivities/activity_code:label">
<value>activity_name</value>
</text>
<text id="/ODK-1.23/farmer_activityselect/form_farmmonitoringactivities:label">
<value>&lt;br&gt;Please select the FARM/HERD MONITORING activities you are going to perform</value>
</text>
<text id="/ODK-1.23/farmer_activityselect/form_cattlemgmtactivities:label">
<value>&lt;br&gt;Please select the ANIMAL GENERAL MANAGEMENT activities you are going to perform</value>
</text>
<text id="/ODK-1.23/farmer_activityselect/staff_doesregistrationactivities:label">
<value>If selected staff does registration activities</value>
</text>
<text id="/ODK-1.23/farmer_activityselect/form_registrationactivities:label">
<value>&lt;br&gt;Please select the REGISTRATION activities you are going to perform</value>
</text>
<text id="/ODK-1.23/farmer_activityselect/form_monitoringactivities:label">
<value>&lt;br&gt;Please select the COW/HEIFER MONITORING activities you are going to perform</value>
</text>
<text id="/ODK-1.23/farmer_activityselect/form_monitoringactivities/activity_code:label">
<value>activity_name</value>
</text>
<text id="/ODK-1.23/farmer_activityselect/staff_doesmonitoringactivities:label">
<value>If selected staff does COW/HEIFER MONITORING activities</value>
</text>
<text id="/ODK-1.23/farmer_activityselect/form_breedingactivities:label">
<value>&lt;br&gt;Please select the ANIMAL BREEDING activities you are going to perform &lt;br&gt;FOR ANIMALS REGISTERED BEFORE TODAY</value>
</text>
<text id="/ODK-1.23/farmer_activityselect/form_farmextraactivities/activity_code:label">
<value>activity_name</value>
</text>
<text id="/ODK-1.23/farmer_activityselect/form_farmmonitoringactivities/activity_code:label">
<value>activity_name</value>
</text>
<text id="/ODK-1.23/farmer_activityselect/staff_doescattlemgmtactivities:label">
<value>If selected staff does animal general management activities</value>
</text>
<text id="/ODK-1.23/farmer_activityselect/form_calfmonitoringactivities:label">
<value>&lt;br&gt;Please select the CALF MONITORING activities you are going to perform</value>
</text>
<text id="/ODK-1.23/farmer_activityselect/staff_doesfarmmonitoringactivities:label">
<value>If selected staff does FARM/HERD MONITORING activities</value>
</text>
<text id="/ODK-1.23/farmer_activityselect/form_breedingactivities:hint">
<value>NOT for newly registered animals</value>
</text>
</translation>
</itext>
<instance>
<ODK-1.23 id="303_ODK_1_23_3" version="Ver 1.3">
<farmer_activityselect>
<farmer_individualnote/>
<staff_doesregistrationactivities/>
<form_registrationactivities/>
<staff_doesbreedingactivities/>
<form_breedingactivities/>
<staff_doesmonitoringactivities/>
<form_monitoringactivities/>
<staff_doescalfmonitoringactivities/>
<form_calfmonitoringactivities/>
<staff_doesfarmmonitoringactivities/>
<form_farmmonitoringactivities/>
<staff_doesfarmextraactivities/>
<form_farmextraactivities/>
<staff_doescattlemgmtactivities/>
<form_cattlemgmtactivities/>
</farmer_activityselect>
<meta>
<instanceID/>
<instanceName/>
</meta>
</ODK-1.23>
</instance>
<instance id="staff_list" src="jr://file-csv/staff_list.csv">
<root>
<item>
<name>_</name>
<label>_</label>
</item>
</root>
</instance>
<bind nodeset="/ODK-1.23/farmer_activityselect/farmer_individualnote" readonly="true()" type="string"/>
<bind calculate="pulldata('staff_list', 'does_registration_activities', 'staff_code','4')" nodeset="/ODK-1.23/farmer_activityselect/staff_doesregistrationactivities" required="true()" type="string"/>
<bind nodeset="/ODK-1.23/farmer_activityselect/form_registrationactivities" relevant=" /ODK-1.23/farmer_activityselect/staff_doesregistrationactivities =1" required="true()" type="select"/>
<bind calculate="pulldata('staff_list', 'does_breeding_activities', 'staff_code','4')" nodeset="/ODK-1.23/farmer_activityselect/staff_doesbreedingactivities" required="true()" type="string"/>
<bind nodeset="/ODK-1.23/farmer_activityselect/form_breedingactivities" relevant=" /ODK-1.23/farmer_activityselect/staff_doesbreedingactivities =1" required="true()" type="select"/>
<bind calculate="pulldata('staff_list', 'does_monitoring_activities', 'staff_code','4')" nodeset="/ODK-1.23/farmer_activityselect/staff_doesmonitoringactivities" required="true()" type="string"/>
<bind nodeset="/ODK-1.23/farmer_activityselect/form_monitoringactivities" relevant=" /ODK-1.23/farmer_activityselect/staff_doesmonitoringactivities =1" required="true()" type="select"/>
<bind calculate="pulldata('staff_list', 'does_calfmonitoring_activities', 'staff_code','4')" nodeset="/ODK-1.23/farmer_activityselect/staff_doescalfmonitoringactivities" required="true()" type="string"/>
<bind nodeset="/ODK-1.23/farmer_activityselect/form_calfmonitoringactivities" relevant=" /ODK-1.23/farmer_activityselect/staff_doescalfmonitoringactivities =1" required="true()" type="select"/>
<bind calculate="pulldata('staff_list', 'does_farmmonitoring_activities', 'staff_code','4')" nodeset="/ODK-1.23/farmer_activityselect/staff_doesfarmmonitoringactivities" required="true()" type="string"/>
<bind nodeset="/ODK-1.23/farmer_activityselect/form_farmmonitoringactivities" relevant=" /ODK-1.23/farmer_activityselect/staff_doesfarmmonitoringactivities =1" required="true()" type="select"/>
<bind calculate="pulldata('staff_list', 'does_farmextra_activities', 'staff_code','4')" nodeset="/ODK-1.23/farmer_activityselect/staff_doesfarmextraactivities" required="true()" type="string"/>
<bind nodeset="/ODK-1.23/farmer_activityselect/form_farmextraactivities" relevant=" /ODK-1.23/farmer_activityselect/staff_doesfarmextraactivities =1" required="true()" type="select"/>
<bind calculate="pulldata('staff_list', 'does_cattlemgmt_activities', 'staff_code','4')" nodeset="/ODK-1.23/farmer_activityselect/staff_doescattlemgmtactivities" required="true()" type="string"/>
<bind nodeset="/ODK-1.23/farmer_activityselect/form_cattlemgmtactivities" relevant=" /ODK-1.23/farmer_activityselect/staff_doescattlemgmtactivities =1" required="true()" type="select"/>
<bind jr:preload="uid" nodeset="/ODK-1.23/meta/instanceID" readonly="true()" type="string"/>
<bind calculate="concat('ODK_1_23_3')" nodeset="/ODK-1.23/meta/instanceName" type="string"/>
</model>
</h:head>
<h:body>
<group appearance="field-list" ref="/ODK-1.23/farmer_activityselect">
<input ref="/ODK-1.23/farmer_activityselect/farmer_individualnote">
<label ref="jr:itext('/ODK-1.23/farmer_activityselect/farmer_individualnote:label')"/>
</input>
<select appearance="search('staff_rights', 'matches', 'staff_code', '4', 'activity_type', '2')" ref="/ODK-1.23/farmer_activityselect/form_registrationactivities">
<label ref="jr:itext('/ODK-1.23/farmer_activityselect/form_registrationactivities:label')"/>
<item>
<label ref="jr:itext('/ODK-1.23/farmer_activityselect/form_registrationactivities/activity_code:label')"/>
<value>activity_code</value>
</item>
</select>
<select appearance="search('staff_rights', 'matches', 'staff_code', '4', 'activity_type', '5')" ref="/ODK-1.23/farmer_activityselect/form_breedingactivities">
<label ref="jr:itext('/ODK-1.23/farmer_activityselect/form_breedingactivities:label')"/>
<hint ref="jr:itext('/ODK-1.23/farmer_activityselect/form_breedingactivities:hint')"/>
<item>
<label ref="jr:itext('/ODK-1.23/farmer_activityselect/form_breedingactivities/activity_code:label')"/>
<value>activity_code</value>
</item>
</select>
<select appearance="search('staff_rights', 'matches', 'staff_code', '4', 'activity_type', '6')" ref="/ODK-1.23/farmer_activityselect/form_monitoringactivities">
<label ref="jr:itext('/ODK-1.23/farmer_activityselect/form_monitoringactivities:label')"/>
<item>
<label ref="jr:itext('/ODK-1.23/farmer_activityselect/form_monitoringactivities/activity_code:label')"/>
<value>activity_code</value>
</item>
</select>
<select appearance="search('staff_rights', 'matches', 'staff_code', '4', 'activity_type', '8')" ref="/ODK-1.23/farmer_activityselect/form_calfmonitoringactivities">
<label ref="jr:itext('/ODK-1.23/farmer_activityselect/form_calfmonitoringactivities:label')"/>
<item>
<label ref="jr:itext('/ODK-1.23/farmer_activityselect/form_calfmonitoringactivities/activity_code:label')"/>
<value>activity_code</value>
</item>
</select>
<select appearance="search('staff_rights', 'matches', 'staff_code', '4', 'activity_type', '9')" ref="/ODK-1.23/farmer_activityselect/form_farmmonitoringactivities">
<label ref="jr:itext('/ODK-1.23/farmer_activityselect/form_farmmonitoringactivities:label')"/>
<item>
<label ref="jr:itext('/ODK-1.23/farmer_activityselect/form_farmmonitoringactivities/activity_code:label')"/>
<value>activity_code</value>
</item>
</select>
<select appearance="search('staff_rights', 'matches', 'staff_code', '4', 'activity_type', '3')" ref="/ODK-1.23/farmer_activityselect/form_farmextraactivities">
<label ref="jr:itext('/ODK-1.23/farmer_activityselect/form_farmextraactivities:label')"/>
<item>
<label ref="jr:itext('/ODK-1.23/farmer_activityselect/form_farmextraactivities/activity_code:label')"/>
<value>activity_code</value>
</item>
</select>
<select appearance="search('staff_rights', 'matches', 'staff_code', '4', 'activity_type', '4')" ref="/ODK-1.23/farmer_activityselect/form_cattlemgmtactivities">
<label ref="jr:itext('/ODK-1.23/farmer_activityselect/form_cattlemgmtactivities:label')"/>
<item>
<label ref="jr:itext('/ODK-1.23/farmer_activityselect/form_cattlemgmtactivities/activity_code:label')"/>
<value>activity_code</value>
</item>
</select>
</group>
</h:body>
</h:html>
153 changes: 153 additions & 0 deletions collect_app/src/androidTest/assets/forms/CalcTest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
<?xml version="1.0"?>
<h:html
xmlns="http://www.w3.org/2002/xforms"
xmlns:ev="http://www.w3.org/2001/xml-events"
xmlns:h="http://www.w3.org/1999/xhtml"
xmlns:jr="http://openrosa.org/javarosa"
xmlns:odk="http://www.opendatakit.org/xforms"
xmlns:orx="http://openrosa.org/xforms"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<h:head>
<h:title>CalcTest</h:title>
<model>
<instance>
<f9b8151086797041b0c935152c991891fd87d4ca id="CalcTest" version="2019043001">
<GearTypes jr:template="">
<Gear_ID/>
<Gear_IDLabel/>
<MeshSize_ID/>
<calc_Mesh/>
<calc_MG/>
<Note1/>
</GearTypes>
<Note2/>
<Note3/>
<meta>
<instanceID/>
</meta>
</f9b8151086797041b0c935152c991891fd87d4ca>
</instance>
<bind nodeset="/f9b8151086797041b0c935152c991891fd87d4ca/GearTypes/Gear_ID" required="true()" type="select1"/>
<bind calculate="if(string-length( ../Gear_ID )!=0,jr:choice-name( ../Gear_ID ,' ../Gear_ID '),'above equipment')" nodeset="/f9b8151086797041b0c935152c991891fd87d4ca/GearTypes/Gear_IDLabel" required="true()" type="string"/>
<bind nodeset="/f9b8151086797041b0c935152c991891fd87d4ca/GearTypes/MeshSize_ID" required="true()" type="select1"/>
<bind calculate="if(string-length( ../MeshSize_ID )!=0,jr:choice-name( ../MeshSize_ID ,' ../MeshSize_ID '),'mm ')" nodeset="/f9b8151086797041b0c935152c991891fd87d4ca/GearTypes/calc_Mesh" required="true()" type="string"/>
<bind calculate="concat( ../calc_Mesh ,' ', ../Gear_IDLabel )" nodeset="/f9b8151086797041b0c935152c991891fd87d4ca/GearTypes/calc_MG" required="true()" type="string"/>
<bind nodeset="/f9b8151086797041b0c935152c991891fd87d4ca/GearTypes/Note1" readonly="true()" type="string"/>
<bind nodeset="/f9b8151086797041b0c935152c991891fd87d4ca/Note2" readonly="true()" type="string"/>
<bind nodeset="/f9b8151086797041b0c935152c991891fd87d4ca/Note3" readonly="true()" type="string"/>
<bind jr:preload="uid" nodeset="/f9b8151086797041b0c935152c991891fd87d4ca/meta/instanceID" readonly="true()" type="string"/>
</model>
</h:head>
<h:body>
<group ref="/f9b8151086797041b0c935152c991891fd87d4ca/GearTypes">
<label>Fishing gear type</label>
<repeat nodeset="/f9b8151086797041b0c935152c991891fd87d4ca/GearTypes">
<select1 ref="/f9b8151086797041b0c935152c991891fd87d4ca/GearTypes/Gear_ID">
<label>7.1 Select the type of fishing equipment used today to catch the fish present</label>
<item>
<label>Gillnet</label>
<value>1</value>
</item>
<item>
<label>Seinenet</label>
<value>2</value>
</item>
</select1>
<select1 ref="/f9b8151086797041b0c935152c991891fd87d4ca/GearTypes/MeshSize_ID">
<label>7.2 What is the size of the mesh for the &lt;span style=&quot;color:red&quot;&gt;
<output value=" ../Gear_IDLabel "/>&lt;/span&gt; ?
</label>
<item>
<label>20 mm</label>
<value>1</value>
</item>
<item>
<label>25 mm</label>
<value>2</value>
</item>
<item>
<label>30 mm</label>
<value>3</value>
</item>
<item>
<label>35 mm</label>
<value>4</value>
</item>
<item>
<label>40 mm</label>
<value>5</value>
</item>
<item>
<label>45 mm</label>
<value>6</value>
</item>
<item>
<label>50 mm</label>
<value>7</value>
</item>
<item>
<label>55 mm</label>
<value>8</value>
</item>
<item>
<label>60 mm</label>
<value>9</value>
</item>
<item>
<label>65 mm</label>
<value>10</value>
</item>
<item>
<label>70 mm</label>
<value>11</value>
</item>
<item>
<label>75 mm</label>
<value>12</value>
</item>
<item>
<label>80 mm</label>
<value>13</value>
</item>
<item>
<label>85 mm</label>
<value>14</value>
</item>
<item>
<label>90 mm</label>
<value>15</value>
</item>
<item>
<label>95 mm</label>
<value>16</value>
</item>
<item>
<label>100 mm</label>
<value>17</value>
</item>
</select1>
<input ref="/f9b8151086797041b0c935152c991891fd87d4ca/GearTypes/Note1">
<label>GearCode:
<output value=" ../Gear_ID "/> MeshCode:
<output value=" ../MeshSize_ID "/> GearNameCalculated:
<output value=" ../Gear_IDLabel "/>
</label>
</input>
</repeat>
</group>
<input ref="/f9b8151086797041b0c935152c991891fd87d4ca/Note2">
<label>GearCode:
<output value=" /f9b8151086797041b0c935152c991891fd87d4ca/GearTypes/Gear_ID "/> MeshCode:
<output value=" /f9b8151086797041b0c935152c991891fd87d4ca/GearTypes/MeshSize_ID "/> GearNameCalculated:
<output value=" /f9b8151086797041b0c935152c991891fd87d4ca/GearTypes/Gear_IDLabel "/>
</label>
</input>
<input ref="/f9b8151086797041b0c935152c991891fd87d4ca/Note3">
<label>GearNameCalculated:
<output value=" /f9b8151086797041b0c935152c991891fd87d4ca/GearTypes/Gear_IDLabel "/> Gear Mesh Calc:
<output value=" /f9b8151086797041b0c935152c991891fd87d4ca/GearTypes/calc_Mesh "/> Gear Mesh Name Calc:
<output value=" /f9b8151086797041b0c935152c991891fd87d4ca/GearTypes/calc_MG "/>
</label>
</input>
</h:body>
</h:html>
Loading

0 comments on commit edb3d8c

Please sign in to comment.