-
Notifications
You must be signed in to change notification settings - Fork 0
‐#4712 Section tests
Anyone who feels this PR is scantily documented will welcome the explanation now added above of the cryptic test IDs in SelectOneResetTest
.
For each variant section of the test form, SelectOneResetTest
performs ten distinct but logically related tests.
Each test is flagged in the code by an ID in a //
comment and traced in the log.
Expected results of the tests are given in the asserts support sheet of the source form.
IDs are encoded as ((AA?)?BC)|(DE))(1|2|3|4)(e|h)? where
-
1|2|3|4 is a logical test number
- would come first if C syntax permitted (during development the IDs were
enums
)
- would come first if C syntax permitted (during development the IDs were
-
(AA?)?BC tests a sequence of widgets in the (form)e(ntry) or h(ierarchy) views
- ie in blocks A to C of each section
-
DE tests the behaviour of widgets in a field list
- in blocks D and E
The purport of each test is defined by its number.
A quirk of the tests is that to simplify coding they're mostly executed in reverse order of how obvious they are, so here described in their natural order.
- When state is changed, are all cascade members reset, including after an interpolated field (here show-ward)?
- Confirms that a complete cascade will be reset following change in its (non-itemset) first member
- The most obvious check
- When city is changed, is ward as remaining cascade member reset, despite following show-ward?
- Confirms that remaining cascade members will be reset following change in a preceding (itemset) member
- Less obvious than 3 but just as critical
- If show-ward is set to hide ward and then city changed, is ward reset when unhidden?
- If a preceding member is changed while a question is hidden, then when the question is unhidden any existing answer will almost certainly be invalid
- The subtlest of the tests but addresses what looks like a frequently-occurring issue
- An important feature of the new algorithm
Each block tests a different widget context, the principal distinction being between
- A?BC - applied to widget sequences and their corresponding hierarchy views
- DE - applied to widgets in field lists
- Test widget sequences using conventional (form)e(ntry) assertions
- Where practical, apply corresponding h(ierarchy) assertions.
- Not practical for the hierarchy views of the top-level A groups.
- AA test only in block A
- Nothing is gained by testing both views as each displays all results.
- DE(1|2)e test by navigating the expected states of widgets in the field list.
- DE(3|4)h use the hierarchy view for ease of coding.