@suffolklitlab/alkiln 5.10.0 → 5.10.1

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
@@ -45,6 +45,12 @@ Format:
45
45
 
46
46
  <!-- ## [Unreleased] -->
47
47
 
48
+ ## [5.10.1] - 2024-02-23
49
+
50
+ ### Changed
51
+
52
+ - Fixes the issue that typing is too fast for some fields, like Ajax comboboxes. See [#857](https://github.com/SuffolkLITLab/ALKiln/issues/857).
53
+
48
54
  ## [5.10.0] - 2024-02-22
49
55
 
50
56
  ### Added
@@ -62,7 +68,7 @@ Format:
62
68
 
63
69
  - Handle non-existence of `elem` more robustly when checking for `elem.disabled`
64
70
  - Add a pause between pull request tests and push tests when the PR is coming from our own repo
65
- - Make getting page field values more robust by doing more to ensure that undefined values don't cause errors
71
+ - Make getting page field values more robust by doing more to ensure that undefined option `value`s don't cause errors. For example, ajax combobox `select` options don't always have `value`s
66
72
 
67
73
  ## [5.9.0] - 2024-02-11
68
74
 
package/lib/scope.js CHANGED
@@ -1976,11 +1976,16 @@ module.exports = {
1976
1976
 
1977
1977
  setText: async function ( scope, { handle, answer }) {
1978
1978
  // Set text in some kind of field (input text, input date, textarea, etc.)
1979
- await handle.evaluate( el => { el.value = '' });
1979
+ // First set the value to part of the string
1980
+ const to_set = answer.slice(0, -3);
1981
+ const to_type = answer.slice(-3);
1982
+ await handle.evaluate(( elem, text ) => {
1983
+ elem.value = text;
1984
+ }, to_set );
1985
+ // Then type the last three characters of the string with a
1986
+ // good pause to let the field register the interaction
1980
1987
  await handle.focus();
1981
- let delay = 0;
1982
- if ( session_vars.get_debug() ) { delay = 25; }
1983
- await handle.type( answer, { delay });
1988
+ await handle.type( to_type, { delay: 100 });
1984
1989
  },
1985
1990
 
1986
1991
  draw_signature: async function ( scope, name ) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@suffolklitlab/alkiln",
3
- "version": "5.10.0",
3
+ "version": "5.10.1",
4
4
  "description": "Integrated automated end-to-end testing with docassemble, puppeteer, and cucumber.",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {