@suffolklitlab/alkiln 3.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/.github/workflows/test_tests.yml +77 -0
  2. package/CHANGELOG.md +381 -0
  3. package/README.md +18 -0
  4. package/action.yml +158 -0
  5. package/lib/DOM.md.html +63 -0
  6. package/lib/github_integration/install-branch.js +84 -0
  7. package/lib/github_integration/puppeteer-utils.js +224 -0
  8. package/lib/github_integration/setup.js +4 -0
  9. package/lib/github_integration/takedown.js +4 -0
  10. package/lib/index.js +2 -0
  11. package/lib/scope.js +1632 -0
  12. package/lib/steps.js +878 -0
  13. package/lib/utils/env_vars.js +173 -0
  14. package/lib/utils/langs.js +51 -0
  15. package/lib/world.js +10 -0
  16. package/package.json +53 -0
  17. package/tests/features/assembly_line.feature +43 -0
  18. package/tests/features/establishing_steps.feature +22 -0
  19. package/tests/features/example_test.feature +11 -0
  20. package/tests/features/interactive_steps.feature +85 -0
  21. package/tests/features/observation_steps.feature +97 -0
  22. package/tests/features/reports.feature +482 -0
  23. package/tests/features/some_png_1.png +0 -0
  24. package/tests/features/some_png_2.png +0 -0
  25. package/tests/features/story_table_formats.feature +77 -0
  26. package/tests/features/story_tables.feature +88 -0
  27. package/tests/unit_tests/ensureSpecialRows.test.js +34 -0
  28. package/tests/unit_tests/env_vars.test.js +53 -0
  29. package/tests/unit_tests/fields.fixtures.js +904 -0
  30. package/tests/unit_tests/getAllFields.test.js +142 -0
  31. package/tests/unit_tests/getMatchingRows.test.js +261 -0
  32. package/tests/unit_tests/getSafeScenarioBaseFilename.fixtures.js +12 -0
  33. package/tests/unit_tests/getSafeScenarioBaseFilename.test.js +62 -0
  34. package/tests/unit_tests/getSafeScenarioFilename.test.js +83 -0
  35. package/tests/unit_tests/html.fixtures.js +861 -0
  36. package/tests/unit_tests/matches.fixtures.js +168 -0
  37. package/tests/unit_tests/names.fixtures.js +35 -0
  38. package/tests/unit_tests/normalizeTable.test.js +22 -0
  39. package/tests/unit_tests/special_rows.fixtures.js +101 -0
  40. package/tests/unit_tests/tables.fixtures.js +428 -0
@@ -0,0 +1,482 @@
1
+ @reports
2
+ Feature: Reports show the right things
3
+
4
+ # rf for report failing
5
+ # rw for report warning
6
+ # rp for report pass
7
+
8
+ # ===============================
9
+ # Reoprts for "failed" Scenarios
10
+ # ===============================
11
+
12
+ # ---- Exceptions in steps.js ----
13
+
14
+ @fast @rf1 @error
15
+ Scenario: Fail with missng language link
16
+ Given the final Scenario status should be "failed"
17
+ Given the Scenario report should include:
18
+ """
19
+ Could not find the link with the text "Latin"
20
+ """
21
+ And I start the interview at "all_tests" in lang "Latin"
22
+
23
+ ## This screen has not yet been created in the testing interview
24
+ #@fast @rf2 @error
25
+ #Scenario: Fail with found no page id
26
+ # Given the final Scenario status should be "failed"
27
+ # Given the Scenario report should include:
28
+ # """
29
+ # Did not find any question id.
30
+ # """
31
+ # And I start the interview at "all_tests"
32
+ # Then the question id should be "any question id"
33
+
34
+ @fast @rf3 @error
35
+ Scenario: Fail with wrong page id
36
+ Given the final Scenario status should be "failed"
37
+ Given the Scenario report should include:
38
+ """
39
+ The question id was supposed to be
40
+ """
41
+ And I start the interview at "all_tests"
42
+ Then the question id should be "wrong question id"
43
+
44
+ @fast @rf4 @error
45
+ Scenario: Fail with a missing phrase
46
+ Given the final Scenario status should be "failed"
47
+ Given the Scenario report should include:
48
+ """
49
+ SHOULD be on this page, but it's NOT
50
+ """
51
+ And I start the interview at "all_tests"
52
+ Then I SHOULD see the phrase "phrase missing"
53
+
54
+ @fast @rf5 @error
55
+ Scenario: Fail with incorrectly present phrase
56
+ Given the final Scenario status should be "failed"
57
+ Given the Scenario report should include:
58
+ """
59
+ should NOT be on this page, but it IS here
60
+ """
61
+ And I start the interview at "all_tests"
62
+ Then I should NOT see the phrase "e"
63
+
64
+ @fast @rf6 @error
65
+ Scenario: Fail with missing element id
66
+ Given the final Scenario status should be "failed"
67
+ Given the Scenario report should include:
68
+ """
69
+ No element on this page has the ID
70
+ """
71
+ And I start the interview at "all_tests"
72
+ Then an element should have the id "wrong element id"
73
+
74
+ @fast @rf7 @error
75
+ Scenario: Fail with unexpectedly able to continue
76
+ Given the final Scenario status should be "failed"
77
+ Given the Scenario report should include:
78
+ """
79
+ The page should have stopped the user from continuing, but the user was able to continue.
80
+ """
81
+ And I start the interview at "all_tests"
82
+ Then the question id should be "upload files"
83
+ And I tap to continue
84
+ Then I can't continue
85
+
86
+ @fast @rf8 @error
87
+ Scenario: Fail with missing error message
88
+ Given the final Scenario status should be "failed"
89
+ Given the Scenario report should include:
90
+ """
91
+ No error message was found on the page
92
+ """
93
+ And I start the interview at "all_tests"
94
+ And I will be told an answer is invalid
95
+
96
+ ## Not sure how to trigger this at the moment
97
+ #@fast @rf9 @error
98
+ #Scenario: Fail with missing user error message
99
+ # Given the final Scenario status should be "failed"
100
+ # Given the Scenario report should include:
101
+ # """
102
+ # The error was a system error, not an error message to the user.
103
+ # """
104
+ # And I start the interview at "all_tests"
105
+ # And I will be told an answer is invalid
106
+
107
+ # TODO: Check this with validation code failure too
108
+ @fast @rf10 @error
109
+ Scenario: Fail with was uexepctedly not able to continue for invalid field input message
110
+ Given the final Scenario status should be "failed"
111
+ Given the Scenario report should include:
112
+ """
113
+ User did not arrive at the next page.
114
+ """
115
+ And I start the interview at "all_tests"
116
+ And I tap to continue
117
+ And I tap to continue
118
+ And I tap to continue
119
+ Then I arrive at the next page
120
+
121
+ @fast @rf11 @error
122
+ Scenario: Fail with link text not visible
123
+ Given the final Scenario status should be "failed"
124
+ Given the Scenario report should include:
125
+ """
126
+ Cannot find a link with the text
127
+ """
128
+ And I start the interview at "all_tests"
129
+ Then I should see the link "Missing link"
130
+
131
+ @fast @rf12 @error
132
+ Scenario: Fail with missing link with url
133
+ Given the final Scenario status should be "failed"
134
+ Given the Scenario report should include:
135
+ """
136
+ Cannot find a link to
137
+ """
138
+ And I start the interview at "all_tests"
139
+ Then I should see the link to "http://missing-url.com"
140
+
141
+ @slow @rf13 @error
142
+ Scenario: Fail with link with given text does not lead to correct url
143
+ Given the final Scenario status should be "failed"
144
+ Given the Scenario report should include:
145
+ """
146
+ Cannot find a link with the text "Link to external page" leading to http://wrong-url.com.
147
+ """
148
+   Given I start the interview at "all_tests"
149
+ And I tap to continue
150
+   And I get to "showifs" with this data:
151
+ | var | value | trigger |
152
+ | double_quote_dict["double_quote_key"]['dq_two'] | true | |
153
+ | checkboxes_other['checkbox_other_opt_1'] | true | |
154
+ | dropdown_test | dropdown_opt_2 | |
155
+ | radio_yesno | False | false |
156
+ | radio_other | radio_other_opt_3 | |
157
+ | single_quote_dict['single_quote_key']['sq_two'] | true | |
158
+ | text_input | Regular text input field value | |
159
+ | textarea | Multiline text\narea value | |
160
+ Then I arrive at the next page
161
+   Then I get to "screen features" with this data:
162
+ | var | value | trigger |
163
+ | button_continue | True | |
164
+ | buttons_other | button_2 | |
165
+ | buttons_yesnomaybe | True | |
166
+ And I should see the link to "http://ecosia.org/"
167
+ Then the "Link to external page" link leads to "http://wrong-url.com"
168
+
169
+ @slow @rf14 @error
170
+ Scenario: Fail with link unexpectedly opens in same window
171
+ Given the final Scenario status should be "failed"
172
+ Given the Scenario report should include:
173
+ """
174
+ The link "Link to external page" does NOT open in the same window
175
+ """
176
+   Given I start the interview at "all_tests"
177
+ And I tap to continue
178
+   And I get to "showifs" with this data:
179
+ | var | value | trigger |
180
+ | double_quote_dict["double_quote_key"]['dq_two'] | true | |
181
+ | checkboxes_other['checkbox_other_opt_1'] | true | |
182
+ | dropdown_test | dropdown_opt_2 | |
183
+ | radio_yesno | False | false |
184
+ | radio_other | radio_other_opt_3 | |
185
+ | single_quote_dict['single_quote_key']['sq_two'] | true | |
186
+ | text_input | Regular text input field value | |
187
+ | textarea | Multiline text\narea value | |
188
+ Then I arrive at the next page
189
+   Then I get to "screen features" with this data:
190
+ | var | value | trigger |
191
+ | button_continue | True | |
192
+ | buttons_other | button_2 | |
193
+ | buttons_yesnomaybe | True | |
194
+ And I should see the link to "http://ecosia.org/"
195
+ Then the "Link to external page" link opens in the same window
196
+
197
+ @fast @rf15 @error
198
+ Scenario: Fail with link unexpectedly opens in a new window
199
+ Given the final Scenario status should be "failed"
200
+ Given the Scenario report should include:
201
+ """
202
+ The link "Link: reload the page" does NOT open in a new window
203
+ """
204
+   Given I start the interview at "all_tests"
205
+ And I tap to continue
206
+   And I get to "showifs" with this data:
207
+ | var | value | trigger |
208
+ | double_quote_dict["double_quote_key"]['dq_two'] | true | |
209
+ | checkboxes_other['checkbox_other_opt_1'] | true | |
210
+ | dropdown_test | dropdown_opt_2 | |
211
+ | radio_yesno | False | false |
212
+ | radio_other | radio_other_opt_3 | |
213
+ | single_quote_dict['single_quote_key']['sq_two'] | true | |
214
+ | text_input | Regular text input field value | |
215
+ | textarea | Multiline text\narea value | |
216
+ Then I arrive at the next page
217
+   Then I get to "screen features" with this data:
218
+ | var | value | trigger |
219
+ | button_continue | True | |
220
+ | buttons_other | button_2 | |
221
+ | buttons_yesnomaybe | True | |
222
+ And I should see the link to "http://ecosia.org/"
223
+ Then the "Link: reload the page" link opens in a new window
224
+
225
+ ## Don't currently have a broken link to test and this Step is not officially supported
226
+ #@fast @rf16 @error
227
+ #Scenario: Fail with link leads to a broken page
228
+ # Given the final Scenario status should be "failed"
229
+ # Given the Scenario report should include:
230
+ # """
231
+ # link is broken
232
+ # """
233
+ #  Given I start the interview at "all_tests"
234
+ # And I tap to continue
235
+ #  And I get to "showifs" with this data:
236
+ # | var | value | trigger |
237
+ # | double_quote_dict["double_quote_key"]['dq_two'] | true | |
238
+ # | checkboxes_other['checkbox_other_opt_1'] | true | |
239
+ # | dropdown_test | dropdown_opt_2 | |
240
+ # | radio_yesno | False | false |
241
+ # | radio_other | radio_other_opt_3 | |
242
+ # | single_quote_dict['single_quote_key']['sq_two'] | true | |
243
+ # | text_input | Regular text input field value | |
244
+ # | textarea | Multiline text\narea value | |
245
+ # Then I arrive at the next page
246
+ #  Then I get to "screen features" with this data:
247
+ # | var | value | trigger |
248
+ # | button_continue | True | |
249
+ # | buttons_other | button_2 | |
250
+ # | buttons_yesnomaybe | True | |
251
+ # And I should see the link to "http://ecosia.org/"
252
+ # Then the "Link to external page" link opens a working page
253
+
254
+ # 'I tap to continue'
255
+ # Tapping to continue should not ever fail for its own sake. We
256
+ # have Steps that check the consequences of tapping to continue.
257
+
258
+ # Below is test from scope.js, which makes this of place. Maybe this is the
259
+ # wrong way to organize things. Or maybe we shouldn't give tests unique ids
260
+ # at all.
261
+
262
+ # Not testing: missing var independently, missing value independently.
263
+ # Cannot auto test that multiple vars get detected because it's not currently
264
+ # possible to hand in multiple vars and require that all rows be used, but it
265
+ # has been confirmed by hand for now.
266
+ @fast @rf17 @error
267
+ Scenario: Fail with var not on page
268
+ Given the final Scenario status should be "failed"
269
+ Given the Scenario report should include:
270
+ """
271
+ Did not find a field on this page for the variable
272
+ """
273
+ And the Scenario report should include:
274
+ """
275
+ Missing variable or variables on page
276
+ """
277
+ And I start the interview at "all_tests"
278
+ And I set the var "missing_var_1" to "missing value 1"
279
+
280
+ @fast @rf18 @error
281
+ Scenario: Fail with missing term with the given text
282
+ Given the final Scenario status should be "failed"
283
+ Given the Scenario report should include:
284
+ """
285
+ The term "wrong term" seems to be missing
286
+ """
287
+ And I start the interview at "all_tests"
288
+ Then I tap the defined text link "wrong term"
289
+
290
+ @fast @rf19 @error
291
+ Scenario: Fail with cannot find missing document
292
+ Given the final Scenario status should be "failed"
293
+ Given the Scenario report should include:
294
+ """
295
+ Cannot find a link to that document
296
+ """
297
+ And I start the interview at "all_tests"
298
+ Then I download "missing-doc.pdf"
299
+
300
+
301
+ # ---- Exceptions in scope.js ----
302
+
303
+ # This can have a ton of different error messages depending on the DA error
304
+ # that was triggered. We'll make do with one for now.
305
+ @fast @rf20 @error
306
+ Scenario: Fail with system error after Step using wrong file name as trigger
307
+ Given the final Scenario status should be "failed"
308
+ Given the Scenario report should include:
309
+ """
310
+ Reference to invalid playground path
311
+ """
312
+ And I start the interview at "wrong_yaml_filename"
313
+
314
+ ## Not sure how to trigger this. I think we'd need the server to be down.
315
+ #@fast @rf21 @error
316
+ #Scenario: Fail with interview does not load after multiple tries
317
+ # Given the final Scenario status should be "failed"
318
+ # Given the Scenario report should include:
319
+ # """
320
+ # The interview at ${ interview_url } did not load after
321
+ # """
322
+ # And I start the interview at "wrong_yaml_filename"
323
+
324
+ #@fast @rf22 @error
325
+ #Scenario: Fail with
326
+ # Given the final Scenario status should be "failed"
327
+ # Given the Scenario report should include:
328
+ # """
329
+ #
330
+ # """
331
+ # And I start the interview at "wrong_yaml_filename"
332
+
333
+
334
+
335
+ # scope.js
336
+ # I upload "___" to "___"
337
+ # No need to test wrong var name
338
+ # Test non-existant file?
339
+ # How to test non-existant directory?
340
+ #
341
+ # I sign
342
+
343
+ # ===============================
344
+ # Reoprts for "passed" Scenarios
345
+ # ===============================
346
+
347
+ @fast @rp1
348
+ Scenario: Report still shows page id when I tap to continue without setting any fields
349
+ Given the final Scenario status should be "passed"
350
+ Given the Scenario report should include:
351
+ """
352
+ ---------------
353
+ Scenario: Report still shows page id when I tap to continue without setting any fields
354
+ Tags: @reports @fast @rp1
355
+ ---------------
356
+ screen id: upload-files
357
+ screen id: group-of-complex-fields
358
+ | double_quote_dict['double_quote_key']['dq_two'] | true | |
359
+ | single_quote_dict['single_quote_key']['sq_two'] | true | |
360
+ screen id: direct-standard-fields
361
+ | checkboxes_yesno | True | |
362
+ | checkboxes_other['checkbox_other_opt_1'] | true | |
363
+ | dropdown_test | dropdown_opt_2 | |
364
+ | radio_yesno | False | |
365
+ | radio_other | radio_other_opt_3 | |
366
+ | text_input | Regular text input field value | |
367
+ | textarea | Multiline text\narea value | |
368
+ screen id: showifs
369
+
370
+ """
371
+ And I start the interview at "all_tests"
372
+ And I tap to continue
373
+ # Next page
374
+ And I set the var "double_quote_dict['double_quote_key']['dq_two']" to "true"
375
+ And I set the var "single_quote_dict['single_quote_key']['sq_two']" to "true"
376
+ And I tap to continue
377
+ Then the question id should be "direct standard fields"
378
+ # Next page
379
+ When I set the var "checkboxes_yesno" to "True"
380
+ And I set the var "checkboxes_other['checkbox_other_opt_1']" to "true"
381
+ And I set the var "dropdown_test" to "dropdown_opt_2"
382
+ And I set the var "radio_yesno" to "False"
383
+ And I set the var "radio_other" to "radio_other_opt_3"
384
+ And I set the var "text_input" to "Regular text input field value"
385
+ And I set the var "textarea" to "Multiline text\narea value"
386
+ When I tap to continue
387
+ # Next page
388
+ Then the question id should be "showifs"
389
+ When I tap to continue
390
+ # Next page (showifs ID SHOULD BE SHOWN IN REPORT)
391
+ Then the question id should be "buttons yesnomaybe"
392
+
393
+ @slow @rp2
394
+ Scenario: Report lists unused table rows
395
+ Given the final Scenario status should be "passed"
396
+ Given the Scenario report should include:
397
+ """
398
+
399
+ ---------------
400
+ Scenario: Report lists unused table rows
401
+ Tags: @reports @slow @rp2
402
+ ---------------
403
+ screen id: upload-files
404
+ screen id: group-of-complex-fields
405
+ | single_quote_dict['single_quote_key']['sq_two'] | true | |
406
+ | double_quote_dict[\"double_quote_key\"]['dq_two'] | true | |
407
+
408
+ Rows that got set:
409
+ And I get the question id "direct standard fields" with this data:
410
+ | var | value | trigger |
411
+ | double_quote_dict[\"double_quote_key\"]['dq_two'] | true | |
412
+ | single_quote_dict['single_quote_key']['sq_two'] | true | |
413
+ Unused rows:
414
+ | extra_2 | extra 2 | |
415
+ | extra_out_of_alphabetical_order | extra 1 | |
416
+
417
+ screen id: direct-standard-fields
418
+ | checkboxes_other['checkbox_other_opt_1'] | true | |
419
+ | radio_yesno | False | false |
420
+ | radio_other | radio_other_opt_3 | |
421
+ | text_input | Regular text input field value | |
422
+ | textarea | Multiline text\narea value | |
423
+ | dropdown_test | dropdown_opt_2 | |
424
+
425
+ Rows that got set:
426
+ And I get the question id "showifs" with this data:
427
+ | var | value | trigger |
428
+ | checkboxes_other['checkbox_other_opt_1'] | true | |
429
+ | dropdown_test | dropdown_opt_2 | |
430
+ | radio_other | radio_other_opt_3 | |
431
+ | radio_yesno | False | false |
432
+ | text_input | Regular text input field value | |
433
+ | textarea | Multiline text\narea value | |
434
+ Unused rows:
435
+ | extra_3 | extra 3 | |
436
+ | extra_4 | extra 4 | |
437
+ | extra_5 | extra 5 | |
438
+
439
+ screen id: showifs
440
+ screen id: buttons-yesnomaybe
441
+ | buttons_yesnomaybe | True | |
442
+ screen id: buttons-other
443
+ | buttons_other | button_2 | |
444
+ screen id: button-continue
445
+ | button_continue | True | |
446
+
447
+ Rows that got set:
448
+ And I get the question id "screen features" with this data:
449
+ | var | value | trigger |
450
+ | button_continue | True | |
451
+ | buttons_other | button_2 | |
452
+ | buttons_yesnomaybe | True | |
453
+ Unused rows:
454
+ | extra_6 | extra 6 | |
455
+ | extra_7 | extra 7 | |
456
+
457
+ """
458
+ And I start the interview at "all_tests"
459
+   And I get to "direct standard fields" with this data:
460
+ | var | value | trigger |
461
+ | double_quote_dict["double_quote_key"]['dq_two'] | true | |
462
+ | single_quote_dict['single_quote_key']['sq_two'] | true | |
463
+ | extra_out_of_alphabetical_order | extra 1 | |
464
+ | extra_2 | extra 2 | |
465
+   And I get to "showifs" with this data:
466
+ | var | value | trigger |
467
+ | extra_3 | extra 3 | |
468
+ | checkboxes_other['checkbox_other_opt_1'] | true | |
469
+ | dropdown_test | dropdown_opt_2 | |
470
+ | radio_yesno | False | false |
471
+ | extra_4 | extra 4 | |
472
+ | radio_other | radio_other_opt_3 | |
473
+ | text_input | Regular text input field value | |
474
+ | textarea | Multiline text\narea value | |
475
+ | extra_5 | extra 5 | |
476
+   Then I get to "screen features" with this data:
477
+ | var | value | trigger |
478
+ | extra_6 | extra 6 | |
479
+ | extra_7 | extra 7 | |
480
+ | button_continue | True | |
481
+ | buttons_other | button_2 | |
482
+ | buttons_yesnomaybe | True | |
Binary file
Binary file
@@ -0,0 +1,77 @@
1
+ @story_tables_formats
2
+ Feature: Supported story table formats
3
+
4
+ NOTE:
5
+ Unsupported formats:
6
+ - Arrays (see https://github.com/plocket/docassemble-cucumber/issues/257)
7
+ - Format 1 and 2 tables (permanent) (see https://github.com/plocket/docassemble-cucumber/issues/264)
8
+
9
+ NOTE:
10
+ x[i].name.first is the string in the YAML for this variable name, and it's the info that will be in the DOM.
11
+ https://github.com/plocket/docassemble-ALAutomatedTestingTests/blob/ad1232049d7ca7a9b97b22f8ca3915dd3dae8114/docassemble/ALAutomatedTestingTests/data/questions/all_tests.yml#L80
12
+
13
+ NOTE:
14
+ The `trigger` column does not require a value. That way simple interviews
15
+ don't have to deal with it. They don't even need a trigger column (see tests below).
16
+
17
+ ### Here for reference. See note above about formats 1 and 2 being unsupported
18
+ ## TODO: Test og table with `trigger` col added?
19
+ #@fast @stf1
20
+ #Scenario: Table is format 1 (og three cols)
21
+ #  Given I start the interview at "all_tests"
22
+ #  And I get to "showifs" with this data:
23
+ # | var | choice | value |
24
+ # | checkboxes_other['checkbox_other_opt_1'] | | true |
25
+ # | checkboxes_yesno | True | true |
26
+ # | dropdown_test | | dropdown_opt_2 |
27
+ # | radio_other | | radio_other_opt_3 |
28
+ # | radio_yesno | False | true |
29
+ # | text_input | | Regular text input field value |
30
+ # | textarea | | Multiline text\narea value |
31
+ #
32
+ #@fast @stf2
33
+ #Scenario: Table is format 2 (no trigger column)
34
+ #  Given I start the interview at "all_tests"
35
+ #  And I get to "showifs" with this data:
36
+ # | var | value | checked |
37
+ # | checkboxes_other['checkbox_other_opt_2'] | true | |
38
+ # | checkboxes_yesno | True | true |
39
+ # | dropdown_test | dropdown_opt_2 | |
40
+ # | radio_other | radio_other_opt_3 | |
41
+ # | radio_yesno | False | false |
42
+ # | text_input | Regular text input field value | |
43
+ # | textarea | Multiline text\narea value | |
44
+
45
+ # TODO: Only go up to the x[i] pages
46
+ @slow @stf3
47
+ Scenario: Table has trigger column
48
+   Given I start the interview at "all_tests"
49
+   And I get to "showifs" with this data:
50
+ | var | value | trigger |
51
+ | double_quote_dict["double_quote_key"]['dq_two'] | true | |
52
+ | checkboxes_other['checkbox_other_opt_1'] | true | |
53
+ | checkboxes_other['checkbox_other_opt_2'] | true | |
54
+ | checkboxes_other['checkbox_other_opt_3'] | false | |
55
+ | checkboxes_yesno | True | |
56
+ | dropdown_test | dropdown_opt_2 | |
57
+ | radio_other | radio_other_opt_3 | |
58
+ | radio_yesno | False | |
59
+ | single_quote_dict['single_quote_key']['sq_two'] | true | |
60
+ | text_input | Regular text input field value | |
61
+ | textarea | Multiline text\narea value | |
62
+
63
+ # TODO: Only go up to the x[i] pages
64
+ @slow @stf4
65
+ Scenario: Table MISSING trigger column
66
+   Given I start the interview at "all_tests"
67
+   And I get to "showifs" with this data:
68
+ | var | value |
69
+ | double_quote_dict["double_quote_key"]['dq_two'] | true |
70
+ | checkboxes_other['checkbox_other_opt_2'] | true |
71
+ | checkboxes_yesno | True |
72
+ | dropdown_test | dropdown_opt_2 |
73
+ | radio_other | radio_other_opt_3 |
74
+ | radio_yesno | False |
75
+ | single_quote_dict['single_quote_key']['sq_two'] | true |
76
+ | text_input | Regular text input field value |
77
+ | textarea | Multiline text\narea value |
@@ -0,0 +1,88 @@
1
+ @story_tables
2
+ Feature: Story tables
3
+
4
+ NOTE:
5
+ Unit tests make sure that all things that are supposed to match do match.
6
+
7
+ @fast @st1 @mixed
8
+ Scenario: Proxy and regular vars are mixed
9
+   Given I start the interview at "AL_tests"
10
+   And I get to "end" with this data:
11
+ | var | value | trigger |
12
+ | users[0].name.first | Uli1 | users[0].name.first |
13
+ | users[0].name.last | User1 | users[0].name.first |
14
+ | users[0].address.address | 120 Tremont Street | users[0].name.first |
15
+ | users[0].address.unit | Unit 2 | users[0].name.first |
16
+ | users[0].address.city | Boston | users[0].name.first |
17
+ | users[0].address.state | MA | users[0].name.first |
18
+ | users[0].address.zip | 02108 | users[0].name.first |
19
+ | users[1].name.first | Uli2 | users[1].name.first |
20
+ | users[1].name.last | User2 | users[1].name.first |
21
+ | users[i].proxy_var | Index var value | users[1].name.first |
22
+
23
+ @slow @st2 @out_of_order
24
+ Scenario: Fields are listed out of order
25
+
26
+ Covers story table tests for:
27
+ - [x] Trigger action
28
+ - [x] Basic direct fields
29
+ - [x] Able to select first choice (not thorough)
30
+ - [x] Able to select second choice (not thorough)
31
+ - [x] Able to select third choice (not thorough)
32
+ - [x] Hidden fields
33
+ - [x] Nested hidden fields listed out of order
34
+ - [x] Continue button field listed before unrequired fields
35
+
36
+   Given I start the interview at "all_tests"
37
+   And I get to "the end" with this data:
38
+ | var | value | trigger |
39
+ | direct_showifs | True | |
40
+ | double_quote_dict["double_quote_key"]['dq_two'] | true | |
41
+ | button_continue | True | |
42
+ | buttons_other | button_2 | |
43
+ | buttons_yesnomaybe | True | |
44
+ | checkboxes_other['checkbox_other_opt_1'] | true | |
45
+ | checkboxes_other['checkbox_other_opt_2'] | true | |
46
+ | checkboxes_other['checkbox_other_opt_3'] | false | |
47
+ | checkboxes_yesno | True | |
48
+ | direct_standard_fields | True | |
49
+ | dropdown_test | dropdown_opt_2 | |
50
+ | radio_other | radio_other_opt_3 | |
51
+ | radio_yesno | False | |
52
+ | screen_features | True | |
53
+ | showif_checkbox_yesno | False | |
54
+ | showif_checkboxes_other['showif_checkboxes_nota_1'] | false | |
55
+ | showif_checkboxes_other['showif_checkboxes_nota_2'] | true | |
56
+ | showif_checkboxes_other['showif_checkboxes_nota_3'] | false | |
57
+ | showif_dropdown | showif_dropdown_1 | |
58
+ | showif_radio_other | showif_radio_multi_2 | |
59
+     | showif_text_input | Show if text input value | |
60
+     | showif_textarea | Show if\nmultiline text\narea value | |
61
+ | showif_yesnoradio | True | |
62
+ | text_input | Regular text input field value | |
63
+ | textarea | Multiline text\narea value | |
64
+ | show_3 | True | |
65
+ | show_2 | True | |
66
+ | signature_1 | | |
67
+ | signature_2 | | |
68
+ | single_quote_dict['single_quote_key']['sq_two'] | true | |
69
+ | x[i].name.first | Proxyname1 | proxy_list[0].name.first |
70
+ | x[i].name.first | Proxyname2 | proxy_list[1].name.first |
71
+ | x.target_number | 2 | proxy_list.target_number |
72
+
73
+ @fast @st3 @quotes
74
+ Scenario: Story table accidentally uses the opposite double or single quotes
75
+   Given I start the interview at "all_tests"
76
+   And I get to "direct standard fields" with this data:
77
+ | var | value | trigger |
78
+ | double_quote_dict['double_quote_key']["dq_two"] | true | |
79
+ | single_quote_dict["single_quote_key"]['sq_two'] | true | |
80
+
81
+ @fast @st4 @quotes
82
+ Scenario: I upload files with a table
83
+   Given I start the interview at "all_tests"
84
+ And I get to "group of complex fields" with this data:
85
+ | var | value | trigger |
86
+ | upload_files_visible | some_png_1.png, some_png_2.png | |
87
+ | show_upload | True | |
88
+ | upload_files_hidden | some_png_2.png | |
@@ -0,0 +1,34 @@
1
+ const chai = require('chai');
2
+ const expect = chai.expect;
3
+
4
+
5
+ const special_rows = require('./special_rows.fixtures.js');
6
+ const scope = require('../../lib/scope.js');
7
+ const ensureSpecialRows = scope.ensureSpecialRows;
8
+
9
+ // TODO: Add tests for reports
10
+
11
+ // ============================
12
+ // `.target_number`
13
+ // ============================
14
+ describe("For a `.target_number` === 3 story table row", async function() {
15
+ it( `returns the right rows for the 1st \`.there_is_another\` question`, async function() {
16
+ let result = await ensureSpecialRows( scope, { var_data: special_rows.target_num_first_input, from_table: true });
17
+ expect( result ).to.deep.equal( special_rows.target_num_first_output );
18
+ });
19
+ it( `returns the right rows for the 2nd \`.there_is_another\` question`, async function() {
20
+ let result = await ensureSpecialRows( scope, { var_data: special_rows.target_num_half_way_input, from_table: true });
21
+ expect( result ).to.deep.equal( special_rows.target_num_half_way_output );
22
+ });
23
+ it( `returns the right rows for the 3rd \`.there_is_another\` question`, async function() {
24
+ let result = await ensureSpecialRows( scope, { var_data: special_rows.target_num_last_input, from_table: true });
25
+ expect( result ).to.deep.equal( special_rows.target_num_last_output );
26
+ });
27
+ });
28
+
29
+ describe(`For a \`.target_number\` trigger column`, async function() {
30
+ it( `it preserves the trigger`, async function() {
31
+ let result = await ensureSpecialRows( scope, { var_data: special_rows.target_number_trigger_input, from_table: true });
32
+ expect( result ).to.deep.equal( special_rows.target_number_trigger_output );
33
+ });
34
+ });