From e6783fd0fded00dca7a5d2afcc82c9832d75deb7 Mon Sep 17 00:00:00 2001 From: plocket <52798256+plocket@users.noreply.github.com> Date: Thu, 22 Feb 2024 18:10:19 -0500 Subject: [PATCH 1/2] Bump for new url and other improvements --- CHANGELOG.md | 4 +++- package.json | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 779fdf34..f38bad9d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -43,7 +43,9 @@ Format: - --> -## [Unreleased] + + +## [5.10.0] - 2024-02-22 ### Added diff --git a/package.json b/package.json index 4bef05e8..21afea52 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@suffolklitlab/alkiln", - "version": "5.9.0-feat-url9", + "version": "5.10.0", "description": "Integrated automated end-to-end testing with docassemble, puppeteer, and cucumber.", "main": "lib/index.js", "scripts": { From eb998024d25414c77abac6e7071c1cd1a48f55f0 Mon Sep 17 00:00:00 2001 From: plocket <52798256+plocket@users.noreply.github.com> Date: Thu, 22 Feb 2024 23:07:52 -0500 Subject: [PATCH 2/2] Speed up and slow down typing so ajax comboboxes have time to react --- CHANGELOG.md | 2 +- lib/scope.js | 13 +++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f38bad9d..5e220b05 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -62,7 +62,7 @@ Format: - Handle non-existence of `elem` more robustly when checking for `elem.disabled` - Add a pause between pull request tests and push tests when the PR is coming from our own repo -- Make getting page field values more robust by doing more to ensure that undefined values don't cause errors +- 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 ## [5.9.0] - 2024-02-11 diff --git a/lib/scope.js b/lib/scope.js index ac767fec..b4cb8125 100644 --- a/lib/scope.js +++ b/lib/scope.js @@ -1976,11 +1976,16 @@ module.exports = { setText: async function ( scope, { handle, answer }) { // Set text in some kind of field (input text, input date, textarea, etc.) - await handle.evaluate( el => { el.value = '' }); + // First set the value to part of the string + const to_set = answer.slice(0, -3); + const to_type = answer.slice(-3); + await handle.evaluate(( elem, text ) => { + elem.value = text; + }, to_set ); + // Then type the last three characters of the string with a + // good pause to let the field register the interaction await handle.focus(); - let delay = 0; - if ( session_vars.get_debug() ) { delay = 25; } - await handle.type( answer, { delay }); + await handle.type( to_type, { delay: 100 }); }, draw_signature: async function ( scope, name ) {