@suffolklitlab/alkiln 5.9.0-feat-url7 → 5.9.0-feat-url9

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.
package/CHANGELOG.md CHANGED
@@ -51,6 +51,7 @@ Format:
51
51
  - New navigation report messages.
52
52
  - Avoid waiting for "success" on sign in. Not everyone has it.
53
53
  - Allow non-local environments to get debug logs.
54
+ - Detect signature page variable names with the trigger variable name as a fallback to the `_save_as` input. If a server's config has its `restrict input variables` value set to `True`, the #trigger value is the only way for ALKiln to know which variable the signature is setting. Add an error to the report if ALKiln is unable to find either of those.
54
55
 
55
56
  ### Internal
56
57
 
package/lib/scope.js CHANGED
@@ -877,7 +877,29 @@ module.exports = {
877
877
  if ( $(`#dasigpage`).length > 0 && $(`#dasigpage`)[0].name ) {
878
878
  field_data.selector = `#daquestion canvas`;
879
879
  field_data.tag = `canvas`;
880
- not_decoded_name = $( `input[name="_save_as"]` ).attr( `value` );
880
+
881
+ // If da server's config value of `restrict input variables`
882
+ // set to True, `_save_as` should work to get the var name
883
+ if ( $( `input[name="_save_as"]` ).length > 0 ) {
884
+ not_decoded_name = $( `input[name="_save_as"]` ).attr( `value` );
885
+
886
+ // If not, the author will have to use the trigger var HTML element
887
+ // or we can't get the var name being set for the signature
888
+ } else if ( trigger !== `` ) {
889
+ not_decoded_name = trigger;
890
+
891
+ // If we have neither of those, we need to tell the user we can't
892
+ // set this variable this way. We can't test this without a
893
+ // server that has that special config value set to `True`
894
+ } else {
895
+ reports.addToReport(scope, {
896
+ type: `error`,
897
+ value: `You cannot sign a signature page this way because the `
898
+ + `interview's HTML is missing data. Use the "I sign" Step `
899
+ + `instead. You can also read documentation about `
900
+ + `how to create the "trigger" HTML.`
901
+ });
902
+ }
881
903
  }
882
904
 
883
905
  // The selector we'll use to set the DOM node's value later
@@ -1778,7 +1800,9 @@ module.exports = {
1778
1800
  // Authors should enter the time like 12:34 PM, but we shouldn't type ":", space, or M.
1779
1801
  let answer_time = answer.replace(":", "").replace(" ", "").replace("M", "");
1780
1802
  await handle.focus();
1781
- await handle.type( answer );
1803
+ let delay = 0;
1804
+ if ( session_vars.get_debug() ) { delay = 25; }
1805
+ await handle.type( answer, { delay });
1782
1806
  await handle.press(`Enter`);
1783
1807
  await scope.afterStep(scope, { waitForShowIf: true });
1784
1808
  } else {
@@ -1954,7 +1978,9 @@ module.exports = {
1954
1978
  // Set text in some kind of field (input text, input date, textarea, etc.)
1955
1979
  await handle.evaluate( el => { el.value = '' });
1956
1980
  await handle.focus();
1957
- await handle.type( answer );
1981
+ let delay = 0;
1982
+ if ( session_vars.get_debug() ) { delay = 25; }
1983
+ await handle.type( answer, { delay });
1958
1984
  },
1959
1985
 
1960
1986
  draw_signature: async function ( scope, name ) {
@@ -2080,6 +2106,8 @@ module.exports = {
2080
2106
  } // ends for every non-submit-button field on the page
2081
2107
  } // ends while fields are still being set
2082
2108
 
2109
+ if ( session_vars.get_debug() ) { await scope.page.waitForTimeout(2000); }
2110
+
2083
2111
  // Press a continue button with a story table variable name if it exists
2084
2112
  let did_navigate = false;
2085
2113
  let error = {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@suffolklitlab/alkiln",
3
- "version": "5.9.0-feat-url7",
3
+ "version": "5.9.0-feat-url9",
4
4
  "description": "Integrated automated end-to-end testing with docassemble, puppeteer, and cucumber.",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {