@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,904 @@
1
+ let fields = {};
2
+
3
+ // ============================
4
+ // Standard fields - no proxies, no showifs.
5
+ // ============================
6
+ // TODO: Add more complex fields. E.g `object_checkboxes` and dropdown with `object`.
7
+ fields.standard = [
8
+ {
9
+ "selector": "#daquestion input[name=\"Y2hlY2tib3hlc195ZXNubw\"][value=\"True\"][id=\"Y2hlY2tib3hlc195ZXNubw\"][class=\"da-to-labelauty checkbox-icon dauncheckable labelauty da-active-invisible dafullwidth\"]",
10
+ "tag": "input",
11
+ "guesses": [
12
+ {
13
+ "var": "checkboxes_yesno",
14
+ "value": "True"
15
+ }
16
+ ],
17
+ "type": "checkbox",
18
+ "trigger": "direct_standard_fields"
19
+ },
20
+ {
21
+ "selector": "#daquestion input[name=\"Y2hlY2tib3hlc19vdGhlcltCJ1kyaGxZMnRpYjNoZmIzUm9aWEpmYjNCMFh6RSdd\"][value=\"True\"][id=\"Y2hlY2tib3hlc19vdGhlcg_0\"][class=\"dafield1 danon-nota-checkbox da-to-labelauty checkbox-icon labelauty da-active-invisible dafullwidth\"]",
22
+ "tag": "input",
23
+ "guesses": [
24
+ {
25
+ "var": "checkboxes_other['checkbox_other_opt_1']",
26
+ "value": "True"
27
+ },
28
+ {
29
+ "var": "checkboxes_other['r\u0017���1��az����']",
30
+ "value": "True"
31
+ }
32
+ ],
33
+ "type": "checkbox",
34
+ "trigger": "direct_standard_fields"
35
+ },
36
+ {
37
+ "selector": "#daquestion input[name=\"Y2hlY2tib3hlc19vdGhlcltCJ1kyaGxZMnRpYjNoZmIzUm9aWEpmYjNCMFh6SSdd\"][value=\"True\"][id=\"Y2hlY2tib3hlc19vdGhlcg_1\"][class=\"dafield1 danon-nota-checkbox da-to-labelauty checkbox-icon labelauty da-active-invisible dafullwidth\"]",
38
+ "tag": "input",
39
+ "guesses": [
40
+ {
41
+ "var": "checkboxes_other['checkbox_other_opt_2']",
42
+ "value": "True"
43
+ },
44
+ {
45
+ "var": "checkboxes_other['r\u0017���1��az����']",
46
+ "value": "True"
47
+ }
48
+ ],
49
+ "type": "checkbox",
50
+ "trigger": "direct_standard_fields"
51
+ },
52
+ {
53
+ "selector": "#daquestion input[name=\"Y2hlY2tib3hlc19vdGhlcltCJ1kyaGxZMnRpYjNoZmIzUm9aWEpmYjNCMFh6TSdd\"][value=\"True\"][id=\"Y2hlY2tib3hlc19vdGhlcg_2\"][class=\"dafield1 danon-nota-checkbox da-to-labelauty checkbox-icon labelauty da-active-invisible dafullwidth\"]",
54
+ "tag": "input",
55
+ "guesses": [
56
+ {
57
+ "var": "checkboxes_other['checkbox_other_opt_3']",
58
+ "value": "True"
59
+ },
60
+ {
61
+ "var": "checkboxes_other['r\u0017���1��az����']",
62
+ "value": "True"
63
+ }
64
+ ],
65
+ "type": "checkbox",
66
+ "trigger": "direct_standard_fields"
67
+ },
68
+ {
69
+ "selector": "#daquestion input[name=\"_ignore1\"][id=\"labelauty-294201\"][class=\"dafield1 danota-checkbox da-to-labelauty checkbox-icon labelauty da-active-invisible dafullwidth\"]",
70
+ "tag": "input",
71
+ "guesses": [
72
+ {
73
+ "var": "checkboxes_other['None']",
74
+ "value": ""
75
+ }
76
+ ],
77
+ "type": "checkbox",
78
+ "trigger": "direct_standard_fields"
79
+ },
80
+ {
81
+ "selector": "#daquestion input[name=\"cmFkaW9feWVzbm8\"][value=\"True\"][id=\"cmFkaW9feWVzbm8_0\"][class=\"da-to-labelauty labelauty da-active-invisible dafullwidth\"]",
82
+ "tag": "input",
83
+ "guesses": [
84
+ {
85
+ "var": "radio_yesno",
86
+ "value": "True"
87
+ }
88
+ ],
89
+ "type": "radio",
90
+ "trigger": "direct_standard_fields"
91
+ },
92
+ {
93
+ "selector": "#daquestion input[name=\"cmFkaW9feWVzbm8\"][value=\"False\"][id=\"cmFkaW9feWVzbm8_1\"][class=\"da-to-labelauty labelauty da-active-invisible dafullwidth\"]",
94
+ "tag": "input",
95
+ "guesses": [
96
+ {
97
+ "var": "radio_yesno",
98
+ "value": "False"
99
+ }
100
+ ],
101
+ "type": "radio",
102
+ "trigger": "direct_standard_fields"
103
+ },
104
+ {
105
+ "selector": "#daquestion input[name=\"cmFkaW9fb3RoZXI\"][value=\"radio_other_opt_1\"][id=\"cmFkaW9fb3RoZXI_0\"][class=\"da-to-labelauty labelauty da-active-invisible dafullwidth\"]",
106
+ "tag": "input",
107
+ "guesses": [
108
+ {
109
+ "var": "radio_other",
110
+ "value": "radio_other_opt_1"
111
+ }
112
+ ],
113
+ "type": "radio",
114
+ "trigger": "direct_standard_fields"
115
+ },
116
+ {
117
+ "selector": "#daquestion input[name=\"cmFkaW9fb3RoZXI\"][value=\"radio_other_opt_2\"][id=\"cmFkaW9fb3RoZXI_1\"][class=\"da-to-labelauty labelauty da-active-invisible dafullwidth\"]",
118
+ "tag": "input",
119
+ "guesses": [
120
+ {
121
+ "var": "radio_other",
122
+ "value": "radio_other_opt_2"
123
+ }
124
+ ],
125
+ "type": "radio",
126
+ "trigger": "direct_standard_fields"
127
+ },
128
+ {
129
+ "selector": "#daquestion input[name=\"cmFkaW9fb3RoZXI\"][value=\"radio_other_opt_3\"][id=\"cmFkaW9fb3RoZXI_2\"][class=\"da-to-labelauty labelauty da-active-invisible dafullwidth\"]",
130
+ "tag": "input",
131
+ "guesses": [
132
+ {
133
+ "var": "radio_other",
134
+ "value": "radio_other_opt_3"
135
+ }
136
+ ],
137
+ "type": "radio",
138
+ "trigger": "direct_standard_fields"
139
+ },
140
+ {
141
+ "selector": "#daquestion input[name=\"dGV4dF9pbnB1dA\"][id=\"dGV4dF9pbnB1dA\"][class=\"form-control\"]",
142
+ "tag": "input",
143
+ "guesses": [
144
+ {
145
+ "var": "text_input",
146
+ "value": ""
147
+ }
148
+ ],
149
+ "type": "text",
150
+ "trigger": "direct_standard_fields"
151
+ },
152
+ {
153
+ "selector": "#daquestion textarea[name=\"dGV4dGFyZWE\"][id=\"dGV4dGFyZWE\"][class=\"form-control\"]",
154
+ "tag": "textarea",
155
+ "guesses": [
156
+ {
157
+ "var": "textarea",
158
+ "value": ""
159
+ }
160
+ ],
161
+ "type": "",
162
+ "trigger": "direct_standard_fields"
163
+ },
164
+ {
165
+ "selector": "#daquestion input[name=\"ZGF0ZV9pbnB1dA\"][id=\"ZGF0ZV9pbnB1dA\"][class=\"form-control\"]",
166
+ "tag": "input",
167
+ "guesses": [
168
+ {
169
+ "var": "date_input",
170
+ "value": ""
171
+ }
172
+ ],
173
+ "type": "date",
174
+ "trigger": "direct_standard_fields"
175
+ },
176
+ {
177
+ "selector": "#daquestion select[name=\"ZHJvcGRvd25fdGVzdA\"][id=\"ZHJvcGRvd25fdGVzdA\"][class=\"form-select dasingleselect\"]",
178
+ "tag": "select",
179
+ "guesses": [
180
+ {
181
+ "var": "dropdown_test",
182
+ "value": ""
183
+ },
184
+ {
185
+ "var": "dropdown_test",
186
+ "value": ""
187
+ },
188
+ {
189
+ "var": "dropdown_test",
190
+ "value": "dropdown_opt_1"
191
+ },
192
+ {
193
+ "var": "dropdown_test",
194
+ "value": "v�)v�'��m�"
195
+ },
196
+ {
197
+ "var": "dropdown_test",
198
+ "value": "dropdown_opt_2"
199
+ },
200
+ {
201
+ "var": "dropdown_test",
202
+ "value": "v�)v�'��m�"
203
+ },
204
+ {
205
+ "var": "dropdown_test",
206
+ "value": "dropdown_opt_3"
207
+ },
208
+ {
209
+ "var": "dropdown_test",
210
+ "value": "v�)v�'��m�"
211
+ }
212
+ ],
213
+ "type": "",
214
+ "trigger": "direct_standard_fields"
215
+ },
216
+ {
217
+ "selector": "#daquestion button[name=\"ZGlyZWN0X3N0YW5kYXJkX2ZpZWxkcw\"][value=\"True\"][class=\"btn btn-da btn-primary\"]",
218
+ "tag": "button",
219
+ "guesses": [
220
+ {
221
+ "var": "direct_standard_fields",
222
+ "value": "True"
223
+ }
224
+ ],
225
+ "type": "submit",
226
+ "trigger": "direct_standard_fields"
227
+ }
228
+ ]; // ends fields.standard
229
+
230
+
231
+ // ============================
232
+ // Simple show if fields - no proxies
233
+ // ============================
234
+ fields.show_if = [
235
+ {
236
+ "selector": "#daquestion input[name=\"c2hvd18y\"][value=\"True\"][id=\"c2hvd18y\"][class=\"da-to-labelauty checkbox-icon dauncheckable labelauty da-active-invisible dafullwidth\"]",
237
+ "tag": "input",
238
+ "guesses": [
239
+ {
240
+ "var": "show_2",
241
+ "value": "True"
242
+ }
243
+ ],
244
+ "type": "checkbox",
245
+ "trigger": "direct_showifs"
246
+ },
247
+ {
248
+ "selector": "#daquestion input[name=\"X2ZpZWxkXzE\"][value=\"True\"][id=\"X2ZpZWxkXzE\"][class=\"da-to-labelauty checkbox-icon dauncheckable labelauty da-active-invisible dafullwidth\"]",
249
+ "tag": "input",
250
+ "guesses": [
251
+ {
252
+ "var": "show_3",
253
+ "value": "True"
254
+ }
255
+ ],
256
+ "type": "checkbox",
257
+ "trigger": "direct_showifs"
258
+ },
259
+ {
260
+ "selector": "#daquestion input[name=\"X2ZpZWxkXzI\"][value=\"True\"][id=\"X2ZpZWxkXzI\"][class=\"da-to-labelauty checkbox-icon dauncheckable labelauty da-active-invisible dafullwidth\"]",
261
+ "tag": "input",
262
+ "guesses": [
263
+ {
264
+ "var": "showif_checkbox_yesno",
265
+ "value": "True"
266
+ }
267
+ ],
268
+ "type": "checkbox",
269
+ "trigger": "direct_showifs"
270
+ },
271
+ {
272
+ "selector": "#daquestion input[name=\"X2ZpZWxkXzNbQidjMmh2ZDJsbVgyTm9aV05yWW05NFpYTmZibTkwWVY4eCdd\"][value=\"True\"][id=\"X2ZpZWxkXzM_0\"][class=\"dafield3 danon-nota-checkbox da-to-labelauty checkbox-icon labelauty da-active-invisible dafullwidth\"]",
273
+ "tag": "input",
274
+ "guesses": [
275
+ {
276
+ "var": "showif_checkboxes_other['showif_checkboxes_nota_1']",
277
+ "value": "True"
278
+ },
279
+ {
280
+ "var": "showif_checkboxes_other['�\u001a0��܅�$n�^��赯�']",
281
+ "value": "True"
282
+ }
283
+ ],
284
+ "type": "checkbox",
285
+ "trigger": "direct_showifs"
286
+ },
287
+ {
288
+ "selector": "#daquestion input[name=\"X2ZpZWxkXzNbQidjMmh2ZDJsbVgyTm9aV05yWW05NFpYTmZibTkwWVY4eSdd\"][value=\"True\"][id=\"X2ZpZWxkXzM_1\"][class=\"dafield3 danon-nota-checkbox da-to-labelauty checkbox-icon labelauty da-active-invisible dafullwidth\"]",
289
+ "tag": "input",
290
+ "guesses": [
291
+ {
292
+ "var": "showif_checkboxes_other['showif_checkboxes_nota_2']",
293
+ "value": "True"
294
+ },
295
+ {
296
+ "var": "showif_checkboxes_other['�\u001a0��܅�$n�^��赯�']",
297
+ "value": "True"
298
+ }
299
+ ],
300
+ "type": "checkbox",
301
+ "trigger": "direct_showifs"
302
+ },
303
+ {
304
+ "selector": "#daquestion input[name=\"X2ZpZWxkXzNbQidjMmh2ZDJsbVgyTm9aV05yWW05NFpYTmZibTkwWVY4eidd\"][value=\"True\"][id=\"X2ZpZWxkXzM_2\"][class=\"dafield3 danon-nota-checkbox da-to-labelauty checkbox-icon labelauty da-active-invisible dafullwidth\"]",
305
+ "tag": "input",
306
+ "guesses": [
307
+ {
308
+ "var": "showif_checkboxes_other['showif_checkboxes_nota_3']",
309
+ "value": "True"
310
+ },
311
+ {
312
+ "var": "showif_checkboxes_other['�\u001a0��܅�$n�^��赯�']",
313
+ "value": "True"
314
+ }
315
+ ],
316
+ "type": "checkbox",
317
+ "trigger": "direct_showifs"
318
+ },
319
+ {
320
+ "selector": "#daquestion input[name=\"_ignore3\"][id=\"labelauty-67439\"][class=\"dafield3 danota-checkbox da-to-labelauty checkbox-icon labelauty da-active-invisible dafullwidth\"]",
321
+ "tag": "input",
322
+ "guesses": [
323
+ {
324
+ "var": "showif_checkboxes_other['None']",
325
+ "value": ""
326
+ }
327
+ ],
328
+ "type": "checkbox",
329
+ "trigger": "direct_showifs"
330
+ },
331
+ {
332
+ "selector": "#daquestion input[name=\"X2ZpZWxkXzQ\"][value=\"True\"][id=\"X2ZpZWxkXzQ_0\"][class=\"da-to-labelauty labelauty da-active-invisible dafullwidth\"]",
333
+ "tag": "input",
334
+ "guesses": [
335
+ {
336
+ "var": "showif_yesnoradio",
337
+ "value": "True"
338
+ }
339
+ ],
340
+ "type": "radio",
341
+ "trigger": "direct_showifs"
342
+ },
343
+ {
344
+ "selector": "#daquestion input[name=\"X2ZpZWxkXzQ\"][value=\"False\"][id=\"X2ZpZWxkXzQ_1\"][class=\"da-to-labelauty labelauty da-active-invisible dafullwidth\"]",
345
+ "tag": "input",
346
+ "guesses": [
347
+ {
348
+ "var": "showif_yesnoradio",
349
+ "value": "False"
350
+ }
351
+ ],
352
+ "type": "radio",
353
+ "trigger": "direct_showifs"
354
+ },
355
+ {
356
+ "selector": "#daquestion input[name=\"X2ZpZWxkXzU\"][value=\"showif_radio_multi_1\"][id=\"X2ZpZWxkXzU_0\"][class=\"da-to-labelauty labelauty da-active-invisible dafullwidth\"]",
357
+ "tag": "input",
358
+ "guesses": [
359
+ {
360
+ "var": "showif_radio_other",
361
+ "value": "showif_radio_multi_1"
362
+ }
363
+ ],
364
+ "type": "radio",
365
+ "trigger": "direct_showifs"
366
+ },
367
+ {
368
+ "selector": "#daquestion input[name=\"X2ZpZWxkXzU\"][value=\"showif_radio_multi_2\"][id=\"X2ZpZWxkXzU_1\"][class=\"da-to-labelauty labelauty da-active-invisible dafullwidth\"]",
369
+ "tag": "input",
370
+ "guesses": [
371
+ {
372
+ "var": "showif_radio_other",
373
+ "value": "showif_radio_multi_2"
374
+ }
375
+ ],
376
+ "type": "radio",
377
+ "trigger": "direct_showifs"
378
+ },
379
+ {
380
+ "selector": "#daquestion input[name=\"X2ZpZWxkXzU\"][value=\"showif_radio_multi_3\"][id=\"X2ZpZWxkXzU_2\"][class=\"da-to-labelauty labelauty da-active-invisible dafullwidth\"]",
381
+ "tag": "input",
382
+ "guesses": [
383
+ {
384
+ "var": "showif_radio_other",
385
+ "value": "showif_radio_multi_3"
386
+ }
387
+ ],
388
+ "type": "radio",
389
+ "trigger": "direct_showifs"
390
+ },
391
+ {
392
+ "selector": "#daquestion input[name=\"X2ZpZWxkXzY\"][id=\"X2ZpZWxkXzY\"][class=\"form-control\"]",
393
+ "tag": "input",
394
+ "guesses": [
395
+ {
396
+ "var": "showif_text_input",
397
+ "value": ""
398
+ }
399
+ ],
400
+ "type": "text",
401
+ "trigger": "direct_showifs"
402
+ },
403
+ {
404
+ "selector": "#daquestion textarea[name=\"X2ZpZWxkXzc\"][id=\"X2ZpZWxkXzc\"][class=\"form-control\"]",
405
+ "tag": "textarea",
406
+ "guesses": [
407
+ {
408
+ "var": "showif_textarea",
409
+ "value": ""
410
+ }
411
+ ],
412
+ "type": "",
413
+ "trigger": "direct_showifs"
414
+ },
415
+ {
416
+ "selector": "#daquestion select[name=\"X2ZpZWxkXzg\"][id=\"X2ZpZWxkXzg\"][class=\"form-select dasingleselect\"]",
417
+ "tag": "select",
418
+ "guesses": [
419
+ {
420
+ "var": "showif_dropdown",
421
+ "value": ""
422
+ },
423
+ {
424
+ "var": "showif_dropdown",
425
+ "value": ""
426
+ },
427
+ {
428
+ "var": "showif_dropdown",
429
+ "value": "showif_dropdown_1"
430
+ },
431
+ {
432
+ "var": "showif_dropdown",
433
+ "value": "�\u001a0��ݮ�]�\t�"
434
+ },
435
+ {
436
+ "var": "showif_dropdown",
437
+ "value": "showif_dropdown_2"
438
+ },
439
+ {
440
+ "var": "showif_dropdown",
441
+ "value": "�\u001a0��ݮ�]�\t�"
442
+ },
443
+ {
444
+ "var": "showif_dropdown",
445
+ "value": "showif_dropdown_3"
446
+ },
447
+ {
448
+ "var": "showif_dropdown",
449
+ "value": "�\u001a0��ݮ�]�\t�"
450
+ },
451
+ {
452
+ "var": "showif_dropdown",
453
+ "value": "showif_dropdown_4"
454
+ },
455
+ {
456
+ "var": "showif_dropdown",
457
+ "value": "�\u001a0��ݮ�]�\t�"
458
+ }
459
+ ],
460
+ "type": "",
461
+ "trigger": "direct_showifs"
462
+ },
463
+ {
464
+ "selector": "#daquestion button[name=\"ZGlyZWN0X3Nob3dpZnM\"][value=\"True\"][class=\"btn btn-da btn-primary\"]",
465
+ "tag": "button",
466
+ "guesses": [
467
+ {
468
+ "var": "direct_showifs",
469
+ "value": "True"
470
+ }
471
+ ],
472
+ "type": "submit",
473
+ "trigger": "direct_showifs"
474
+ }
475
+ ]; // ends fields.show_if
476
+
477
+
478
+ // ============================
479
+ // Buttons
480
+ // ============================
481
+ // `continue button field:`
482
+ fields.button_continue = [
483
+ {
484
+ "trigger": "button_continue",
485
+ "selector": "#daquestion button[name=\"YnV0dG9uX2NvbnRpbnVl\"][value=\"True\"][class=\"btn btn-da btn-primary\"]",
486
+ "tag": "button",
487
+ "guesses": [
488
+ { "var": "button_continue", "value": "True" }
489
+ ],
490
+ "type": "submit"
491
+ }
492
+ ];
493
+
494
+ // `yesnomaybe:`
495
+ // TODO: Shall we allow 'maybe' in the table as a value for `None`?
496
+ fields.buttons_yesnomaybe = [
497
+ {
498
+ "selector": "#daquestion button[name=\"YnV0dG9uc195ZXNub21heWJl\"][value=\"True\"][class=\"btn btn-primary btn-da\"]",
499
+ "tag": "button",
500
+ "guesses": [
501
+ {
502
+ "var": "buttons_yesnomaybe",
503
+ "value": "True"
504
+ }
505
+ ],
506
+ "type": "submit",
507
+ "trigger": "buttons_yesnomaybe"
508
+ },
509
+ {
510
+ "selector": "#daquestion button[name=\"YnV0dG9uc195ZXNub21heWJl\"][value=\"False\"][class=\"btn btn-secondary btn-da\"]",
511
+ "tag": "button",
512
+ "guesses": [
513
+ {
514
+ "var": "buttons_yesnomaybe",
515
+ "value": "False"
516
+ }
517
+ ],
518
+ "type": "submit",
519
+ "trigger": "buttons_yesnomaybe"
520
+ },
521
+ {
522
+ "selector": "#daquestion button[name=\"YnV0dG9uc195ZXNub21heWJl\"][value=\"None\"][class=\"btn btn-warning btn-da\"]",
523
+ "tag": "button",
524
+ "guesses": [
525
+ {
526
+ "var": "buttons_yesnomaybe",
527
+ "value": "None"
528
+ }
529
+ ],
530
+ "type": "submit",
531
+ "trigger": "buttons_yesnomaybe"
532
+ }
533
+ ];
534
+
535
+ // Multiple choice 'continue' button fields that are not yesnomaybe
536
+ // `field:` and `buttons:`
537
+ fields.buttons_other = [
538
+ {
539
+ "trigger": "buttons_other",
540
+ "selector": "#daquestion button[name=\"YnV0dG9uc19vdGhlcg\"][value=\"button_1\"][class=\"btn btn-da btn-primary\"]",
541
+ "tag": "button",
542
+ "guesses": [
543
+ { "var": "buttons_other", "value": "button_1" }
544
+ ],
545
+ "type": "submit"
546
+ },
547
+ {
548
+ "trigger": "buttons_other",
549
+ "selector": "#daquestion button[name=\"YnV0dG9uc19vdGhlcg\"][value=\"button_2\"][class=\"btn btn-da btn-primary\"]",
550
+ "tag": "button",
551
+ "guesses": [
552
+ { "var": "buttons_other", "value": "button_2" }
553
+ ],
554
+ "type": "submit"
555
+ },
556
+ {
557
+ "trigger": "buttons_other",
558
+ "selector": "#daquestion button[name=\"YnV0dG9uc19vdGhlcg\"][value=\"button_3\"][class=\"btn btn-da btn-primary\"]",
559
+ "tag": "button",
560
+ "guesses": [
561
+ { "var": "buttons_other", "value": "button_3" }
562
+ ],
563
+ "type": "submit"
564
+ }
565
+ ];
566
+
567
+ // `field:` and `action buttons:`
568
+ fields.buttons_event_action = [
569
+ {
570
+ "trigger": "button_event_action",
571
+ "selector": "#daquestion button[name=\"YnV0dG9uX2V2ZW50X2FjdGlvbg\"][value=\"True\"][class=\"btn btn-da btn-primary\"]",
572
+ "tag": "button",
573
+ "guesses": [
574
+ { "var": "button_event_action", "value": "True" }
575
+ ],
576
+ "type": "submit"
577
+ },
578
+ {
579
+ "trigger": "button_event_action",
580
+ "selector": "#daquestion a[class=\"btn btn-primary btn-da daquestionactionbutton danonsubmit\"][data-linknum=\"1\"]",
581
+ "tag": "a",
582
+ "guesses": [
583
+ { "var": "end", "value": "" }
584
+ ],
585
+ "type": ""
586
+ }
587
+ ];
588
+
589
+
590
+ // ============================
591
+ // Proxy vars (x, i, j, ...)
592
+ // ============================
593
+ // x[i].name.first
594
+ fields.proxies_xi = [
595
+ {
596
+ "selector": "#daquestion input[name=\"eFtpXS5uYW1lLmZpcnN0\"][id=\"eFtpXS5uYW1lLmZpcnN0\"][class=\"form-control\"]",
597
+ "tag": "input",
598
+ "guesses": [
599
+ {
600
+ "var": "x[i].name.first",
601
+ "value": ""
602
+ }
603
+ ],
604
+ "type": "text",
605
+ "trigger": "proxy_list[0].name.first"
606
+ },
607
+ {
608
+ "selector": "#daquestion button[class=\"btn btn-da btn-primary\"]",
609
+ "tag": "button",
610
+ "guesses": [],
611
+ "type": "submit",
612
+ "trigger": "proxy_list[0].name.first"
613
+ }
614
+ ];
615
+
616
+ // Multiple proxies by the same name are in the story table (because of a loop)
617
+ // Second loop (second page where this question is asked)
618
+ // x[i].name.first
619
+ fields.proxies_multi = [
620
+ {
621
+ "selector": "#daquestion input[name=\"eFtpXS5uYW1lLmZpcnN0\"][id=\"eFtpXS5uYW1lLmZpcnN0\"][class=\"form-control\"]",
622
+ "tag": "input",
623
+ "guesses": [
624
+ {
625
+ "var": "x[i].name.first",
626
+ "value": ""
627
+ }
628
+ ],
629
+ "type": "text",
630
+ "trigger": "proxy_list[1].name.first"
631
+ },
632
+ {
633
+ "selector": "#daquestion button[class=\"btn btn-da btn-primary\"]",
634
+ "tag": "button",
635
+ "guesses": [],
636
+ "type": "submit",
637
+ "trigger": "proxy_list[1].name.first"
638
+ }
639
+ ];
640
+
641
+
642
+ // ============================
643
+ // Signature
644
+ // ============================
645
+ // Signature page continue buttons are contained in a different DOM structure than regular ones
646
+ // Also, there's an additional hidden continue button on the page with similar selectors
647
+ fields.signature = [
648
+ {
649
+ "trigger": "signature_1",
650
+ "selector": "#daquestion canvas",
651
+ "tag": "canvas",
652
+ "guesses": [
653
+ {
654
+ "var": "signature_1",
655
+ "value": "/sign",
656
+ }
657
+ ],
658
+ "type": ""
659
+ },
660
+
661
+ ];
662
+
663
+
664
+ // ============================
665
+ // `choices:`
666
+ // ============================
667
+ // `field:` and `choices:`
668
+ // ```
669
+ // field: favorite_fruit
670
+ // choices:
671
+ // - Apple
672
+ // - Orange
673
+ // ```
674
+ fields.choices = [
675
+ {
676
+ "selector": "#daquestion input[name=\"ZmllbGRfYW5kX2Nob2ljZXM\"][value=\"Choice 1\"][id=\"ZmllbGRfYW5kX2Nob2ljZXM_0\"][class=\"da-to-labelauty labelauty da-active-invisible dafullwidth\"]",
677
+ "tag": "input",
678
+ "guesses": [
679
+ {
680
+ "var": "field_and_choices",
681
+ "value": "Choice 1"
682
+ }
683
+ ],
684
+ "type": "radio",
685
+ "trigger": "field_and_choices"
686
+ },
687
+ {
688
+ "selector": "#daquestion input[name=\"ZmllbGRfYW5kX2Nob2ljZXM\"][value=\"Choice 2\"][id=\"ZmllbGRfYW5kX2Nob2ljZXM_1\"][class=\"da-to-labelauty labelauty da-active-invisible dafullwidth\"]",
689
+ "tag": "input",
690
+ "guesses": [
691
+ {
692
+ "var": "field_and_choices",
693
+ "value": "Choice 2"
694
+ }
695
+ ],
696
+ "type": "radio",
697
+ "trigger": "field_and_choices"
698
+ },
699
+ {
700
+ "selector": "#daquestion button[class=\"btn btn-da btn-primary\"]",
701
+ "tag": "button",
702
+ "guesses": [],
703
+ "type": "submit",
704
+ "trigger": "field_and_choices"
705
+ }
706
+ ];
707
+
708
+
709
+ // ============================
710
+ // dropdowns created with objects
711
+ // ============================
712
+ // ```
713
+ // - Something: some_var
714
+ // datatype: object
715
+ // choices:
716
+ // - obj1
717
+ // - obj2
718
+ // ```
719
+ fields.object_dropdown = [
720
+ {
721
+ "selector": "#daquestion select[name=\"b2JqZWN0X2Ryb3Bkb3du\"][id=\"b2JqZWN0X2Ryb3Bkb3du\"][class=\"form-select dasingleselect daobject\"]",
722
+ "tag": "select",
723
+ "guesses": [
724
+ {
725
+ "var": "object_dropdown",
726
+ "value": ""
727
+ },
728
+ {
729
+ "var": "object_dropdown",
730
+ "value": ""
731
+ },
732
+ {
733
+ "var": "object_dropdown",
734
+ "value": "b2JqX29wdF8x"
735
+ },
736
+ {
737
+ "var": "object_dropdown",
738
+ "value": "obj_opt_1"
739
+ },
740
+ {
741
+ "var": "object_dropdown",
742
+ "value": "b2JqX29wdF8y"
743
+ },
744
+ {
745
+ "var": "object_dropdown",
746
+ "value": "obj_opt_2"
747
+ },
748
+ {
749
+ "var": "object_dropdown",
750
+ "value": "b2JqX29wdF8z"
751
+ },
752
+ {
753
+ "var": "object_dropdown",
754
+ "value": "obj_opt_3"
755
+ }
756
+ ],
757
+ "type": "",
758
+ "trigger": "object_dropdown"
759
+ },
760
+ {
761
+ "selector": "#daquestion button[class=\"btn btn-da btn-primary\"]",
762
+ "tag": "button",
763
+ "guesses": [],
764
+ "type": "submit",
765
+ "trigger": "object_dropdown"
766
+ }
767
+ ];
768
+
769
+
770
+ // ============================
771
+ // mixed quotes
772
+ // ============================
773
+ fields.mixed_quotes = [
774
+ {
775
+ "selector": "#daquestion input[name=\"c2luZ2xlX3F1b3RlX2RpY3RbJ3NpbmdsZV9xdW90ZV9rZXknXVtCJ2MzRmZiMjVsJ10\"][value=\"True\"][id=\"c2luZ2xlX3F1b3RlX2RpY3RbJ3NpbmdsZV9xdW90ZV9rZXknXQ_0\"][class=\"dafield0 danon-nota-checkbox da-to-labelauty checkbox-icon labelauty da-active-invisible dafullwidth\"]",
776
+ "tag": "input",
777
+ "guesses": [
778
+ {
779
+ "var": "single_quote_dict['single_quote_key']['sq_one']",
780
+ "value": "True"
781
+ },
782
+ {
783
+ "var": "single_quote_dict['single_quote_key']['���']",
784
+ "value": "True"
785
+ }
786
+ ],
787
+ "type": "checkbox",
788
+ "trigger": "double_quote_dict['double_quote_key']"
789
+ },
790
+ {
791
+ "selector": "#daquestion input[name=\"c2luZ2xlX3F1b3RlX2RpY3RbJ3NpbmdsZV9xdW90ZV9rZXknXVtCJ2MzRmZkSGR2J10\"][value=\"True\"][id=\"c2luZ2xlX3F1b3RlX2RpY3RbJ3NpbmdsZV9xdW90ZV9rZXknXQ_1\"][class=\"dafield0 danon-nota-checkbox da-to-labelauty checkbox-icon labelauty da-active-invisible dafullwidth\"]",
792
+ "tag": "input",
793
+ "guesses": [
794
+ {
795
+ "var": "single_quote_dict['single_quote_key']['sq_two']",
796
+ "value": "True"
797
+ },
798
+ {
799
+ "var": "single_quote_dict['single_quote_key']['����']",
800
+ "value": "True"
801
+ }
802
+ ],
803
+ "type": "checkbox",
804
+ "trigger": "double_quote_dict['double_quote_key']"
805
+ },
806
+ {
807
+ "selector": "#daquestion input[name=\"c2luZ2xlX3F1b3RlX2RpY3RbJ3NpbmdsZV9xdW90ZV9rZXknXVtCJ2MzRmZkR2h5WldVJ10\"][value=\"True\"][id=\"c2luZ2xlX3F1b3RlX2RpY3RbJ3NpbmdsZV9xdW90ZV9rZXknXQ_2\"][class=\"dafield0 danon-nota-checkbox da-to-labelauty checkbox-icon labelauty da-active-invisible dafullwidth\"]",
808
+ "tag": "input",
809
+ "guesses": [
810
+ {
811
+ "var": "single_quote_dict['single_quote_key']['sq_three']",
812
+ "value": "True"
813
+ },
814
+ {
815
+ "var": "single_quote_dict['single_quote_key']['��톷�']",
816
+ "value": "True"
817
+ }
818
+ ],
819
+ "type": "checkbox",
820
+ "trigger": "double_quote_dict['double_quote_key']"
821
+ },
822
+ {
823
+ "selector": "#daquestion input[name=\"_ignore0\"][id=\"labelauty-647679\"][class=\"dafield0 danota-checkbox da-to-labelauty checkbox-icon labelauty da-active-invisible dafullwidth\"]",
824
+ "tag": "input",
825
+ "guesses": [
826
+ {
827
+ "var": "single_quote_dict['single_quote_key']['None']",
828
+ "value": ""
829
+ }
830
+ ],
831
+ "type": "checkbox",
832
+ "trigger": "double_quote_dict['double_quote_key']"
833
+ },
834
+ {
835
+ "selector": "#daquestion input[name=\"ZG91YmxlX3F1b3RlX2RpY3RbImRvdWJsZV9xdW90ZV9rZXkiXVtCJ1pIRmZiMjVsJ10\"][value=\"True\"][id=\"ZG91YmxlX3F1b3RlX2RpY3RbImRvdWJsZV9xdW90ZV9rZXkiXQ_0\"][class=\"dafield1 danon-nota-checkbox da-to-labelauty checkbox-icon labelauty da-active-invisible dafullwidth\"]",
836
+ "tag": "input",
837
+ "guesses": [
838
+ {
839
+ "var": "double_quote_dict[\"double_quote_key\"]['dq_one']",
840
+ "value": "True"
841
+ },
842
+ {
843
+ "var": "double_quote_dict[\"double_quote_key\"]['v��']",
844
+ "value": "True"
845
+ }
846
+ ],
847
+ "type": "checkbox",
848
+ "trigger": "double_quote_dict['double_quote_key']"
849
+ },
850
+ {
851
+ "selector": "#daquestion input[name=\"ZG91YmxlX3F1b3RlX2RpY3RbImRvdWJsZV9xdW90ZV9rZXkiXVtCJ1pIRmZkSGR2J10\"][value=\"True\"][id=\"ZG91YmxlX3F1b3RlX2RpY3RbImRvdWJsZV9xdW90ZV9rZXkiXQ_1\"][class=\"dafield1 danon-nota-checkbox da-to-labelauty checkbox-icon labelauty da-active-invisible dafullwidth\"]",
852
+ "tag": "input",
853
+ "guesses": [
854
+ {
855
+ "var": "double_quote_dict[\"double_quote_key\"]['dq_two']",
856
+ "value": "True"
857
+ },
858
+ {
859
+ "var": "double_quote_dict[\"double_quote_key\"]['v���']",
860
+ "value": "True"
861
+ }
862
+ ],
863
+ "type": "checkbox",
864
+ "trigger": "double_quote_dict['double_quote_key']"
865
+ },
866
+ {
867
+ "selector": "#daquestion input[name=\"ZG91YmxlX3F1b3RlX2RpY3RbImRvdWJsZV9xdW90ZV9rZXkiXVtCJ1pIRmZkR2h5WldVJ10\"][value=\"True\"][id=\"ZG91YmxlX3F1b3RlX2RpY3RbImRvdWJsZV9xdW90ZV9rZXkiXQ_2\"][class=\"dafield1 danon-nota-checkbox da-to-labelauty checkbox-icon labelauty da-active-invisible dafullwidth\"]",
868
+ "tag": "input",
869
+ "guesses": [
870
+ {
871
+ "var": "double_quote_dict[\"double_quote_key\"]['dq_three']",
872
+ "value": "True"
873
+ },
874
+ {
875
+ "var": "double_quote_dict[\"double_quote_key\"]['v�톷�']",
876
+ "value": "True"
877
+ }
878
+ ],
879
+ "type": "checkbox",
880
+ "trigger": "double_quote_dict['double_quote_key']"
881
+ },
882
+ {
883
+ "selector": "#daquestion input[name=\"_ignore1\"][id=\"labelauty-382460\"][class=\"dafield1 danota-checkbox da-to-labelauty checkbox-icon labelauty da-active-invisible dafullwidth\"]",
884
+ "tag": "input",
885
+ "guesses": [
886
+ {
887
+ "var": "double_quote_dict[\"double_quote_key\"]['None']",
888
+ "value": ""
889
+ }
890
+ ],
891
+ "type": "checkbox",
892
+ "trigger": "double_quote_dict['double_quote_key']"
893
+ },
894
+ {
895
+ "selector": "#daquestion button[class=\"btn btn-da btn-primary\"]",
896
+ "tag": "button",
897
+ "guesses": [],
898
+ "type": "submit",
899
+ "trigger": "double_quote_dict['double_quote_key']"
900
+ }
901
+ ];
902
+
903
+
904
+ module.exports = fields;