Skip to content

Commit

Permalink
Merge branch 'v5' into 706_loops
Browse files Browse the repository at this point in the history
  • Loading branch information
plocket authored Jul 17, 2023
2 parents b27c2df + 29199a4 commit 2fdcd09
Show file tree
Hide file tree
Showing 6 changed files with 581 additions and 1,179 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ Format:
- Shorten path names to try to accommodate limitations of windows systems while still keeping enough useful information to help devs identify the test outputs. https://github.com/SuffolkLITLab/ALKiln/issues/618
- Updated field decoding to handle new object field encoding. See [#711](https://github.com/SuffolkLITLab/ALKiln/issues/711)
- Allow multiple languages to be tested again. See [#713](https://github.com/SuffolkLITLab/ALKiln/issues/713).
- Fill in time fields correctly. See [#726](https://github.com/SuffolkLITLab/ALKiln/pull/726).
- Allow `.target_number` to be 0. See https://github.com/SuffolkLITLab/ALKiln/issues/706.
- Use the right number of loops for `.target_number`. See https://github.com/SuffolkLITLab/ALKiln/issues/706.

Expand All @@ -74,6 +75,7 @@ Format:
- Parameters to certain HTTP requests are printed directly in docassemble's
uWSGI log, leaking API keys to actors with log access on your docassemble
server
- Update dependencies. See [#727](https://github.com/SuffolkLITLab/ALKiln/pull/727).

## [4.11.1] - 2023-03-21
### Changed
Expand Down
34 changes: 34 additions & 0 deletions docassemble/ALKilnTests/data/questions/test_date_and_time.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
metadata:
title: Test testing library - date and time
short title: Test ALKiln
---
features:
css:
- styles.css
---
# Necessary to tell us what the sought var is on each page
# Every interview that wants testing will need to have an element like this
default screen parts:
post: |
<div data-variable="${ encode_name(str( user_info().variable )) }" id="trigger" aria-hidden="true" style="display: none;"></div>
---
mandatory: True
id: interview order
code: |
date_and_time
end
---
id: date and time
continue button field: date_and_time
question: |
Date and time
fields:
- date field: date_input
datatype: date
- time field: time_input
datatype: time
---
id: the end
event: end
question: |
Congratulations! Tests have passed!
Original file line number Diff line number Diff line change
Expand Up @@ -164,3 +164,11 @@ Scenario: I take a screenshot of the signature
And I sign
And I take a screenshot
Then I tap to continue

@fast @o14 @date @time
Scenario: I enter the date and time
Given I start the interview at "test_date_and_time.yml"
And I get to "the end" with this data:
| date_input | today | |
| time_input | 12:34 PM | |

7 changes: 7 additions & 0 deletions lib/scope.js
Original file line number Diff line number Diff line change
Expand Up @@ -1761,6 +1761,13 @@ module.exports = {
}
await scope.setText( scope, { handle, answer: answer_date });
await scope.afterStep(scope, { waitForShowIf: true });
} else if (type == `time`) {
// Authors should enter the time like 12:34 PM, but we shouldn't type ":", space, or M.
let answer_time = answer.replace(":", "").replace(" ", "").replace("M", "");
await handle.focus();
await handle.type( answer );
await handle.press("Enter");
await scope.afterStep(scope, { waitForShowIf: true });
} else {
await scope.setText( scope, { handle, answer });
await scope.afterStep(scope, { waitForShowIf: true });
Expand Down
Loading

0 comments on commit 2fdcd09

Please sign in to comment.