Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Close #857, typing is too fast for some fields #858

Merged
merged 2 commits into from
Feb 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ Format:
-
-->

## [Unreleased]
<!-- ## [Unreleased] -->

## [5.10.0] - 2024-02-22

### Added

Expand All @@ -60,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

Expand Down
13 changes: 9 additions & 4 deletions lib/scope.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
Loading