From a7834c88b54bef42ff58a2368b2d4f0fdfcaa248 Mon Sep 17 00:00:00 2001 From: plocket <52798256+plocket@users.noreply.github.com> Date: Mon, 21 Oct 2024 17:37:32 -0400 Subject: [PATCH 1/6] Close #949, update local dev package.json commands --- README.md | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 7f486760..046ce295 100644 --- a/README.md +++ b/README.md @@ -41,25 +41,46 @@ Read about contributing in our [CONTRIBUTING.md document](CONTRIBUTING.md). Here ## Cheat sheet *Once you've already read the contributing documentation, you can use these as quick reminders for running our internal tests.* -To set up for the integration tests, create the project on the server: + +### `setup` before starting development of a feature/fix + +Set up for the cucumber integration tests. + +Add the feature branch name to your `.env` file: + +``` +BRANCH=42_feat_life_the_univers_and_everything +``` + +Then create the project on the server: ```bash npm run setup ``` -Use the syntax below to trigger specific tags: +### Run tests repeatedly + +Run all cucumber tests that are not currently blocked by upstream changes: + +```bash +npm run pass +``` + +Trigger cucumber tests with specific tags: ```bash -npm run cucumber -- "--tags" "@tagname" +npm run cucumber "@tagname" ``` -To run the unit tests in isolation: +Run the unit tests: ```bash npm run unit ``` -If you or someone else changes the interview code in `./docassemble`, you have to clean up the old data on the server before running `setup` again: +### Always run `takedown` before running `setup` again + +If you or someone else changes the interview code in our `./docassemble` directory, you have to delete the code currently on the testing server before running `setup` again. Also do this when you're done with the feature/fix or starting a new feature/fix. ```bash npm run takedown From 476c12e6a1a4130daa4527123189f78867e413cd Mon Sep 17 00:00:00 2001 From: plocket <52798256+plocket@users.noreply.github.com> Date: Wed, 23 Oct 2024 10:38:26 -0400 Subject: [PATCH 2/6] Close #952, update pdfjs-dist for node v20 and v22 Co-authored-by: CaroRob --- CHANGELOG.md | 1 + npm-shrinkwrap.json | 34 +++++++++++++++++++--------------- package.json | 4 ++-- 3 files changed, 22 insertions(+), 17 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2dc6991b..530c8679 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -52,6 +52,7 @@ Format: ### Fixed - Detects failed sign in. Closes [#918](https://github.com/SuffolkLITLab/ALKiln/issues/918). +- Updates pdfjs-dist for node v20 and v22. See [#952](https://github.com/SuffolkLITLab/ALKiln/issues/952). ### Internal diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 30576977..1f8120d1 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -22,7 +22,7 @@ "minimatch": "3.0.5", "minimist": "1.2.8", "mocha": "9.2.2", - "pdfjs-dist": "3.2.146", + "pdfjs-dist": "3.11.174", "puppeteer": "22.15.0", "qs": "6.10.3", "sanitize-filename": "1.6.3", @@ -2908,6 +2908,16 @@ "node": ">=0.10.0" } }, + "node_modules/path2d-polyfill": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path2d-polyfill/-/path2d-polyfill-2.0.1.tgz", + "integrity": "sha512-ad/3bsalbbWhmBo0D6FZ4RNMwsLsPpL6gnvhuSaU5Vm7b06Kr5ubSltQQ0T7YKsiJQO+g22zJ4dJKNTXIyOXtA==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">=8" + } + }, "node_modules/pathval": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", @@ -2917,14 +2927,16 @@ } }, "node_modules/pdfjs-dist": { - "version": "3.2.146", - "resolved": "https://registry.npmjs.org/pdfjs-dist/-/pdfjs-dist-3.2.146.tgz", - "integrity": "sha512-wy1OB/v75usRD1LqgxBUWC+ZOiKTmG5J8c2z9XVFrVSSWiVbSuseNojmvFa/TT0pYtcFmkL4zn6KaxvqfPYMRg==", - "dependencies": { - "web-streams-polyfill": "^3.2.1" + "version": "3.11.174", + "resolved": "https://registry.npmjs.org/pdfjs-dist/-/pdfjs-dist-3.11.174.tgz", + "integrity": "sha512-TdTZPf1trZ8/UFu5Cx/GXB7GZM30LT+wWUNfsi6Bq8ePLnb+woNKtDymI2mxZYBpMbonNFqKmiz684DIfnd8dA==", + "license": "Apache-2.0", + "engines": { + "node": ">=18" }, "optionalDependencies": { - "canvas": "^2.11.0" + "canvas": "^2.11.2", + "path2d-polyfill": "^2.0.1" } }, "node_modules/pend": { @@ -3782,14 +3794,6 @@ "extsprintf": "^1.2.0" } }, - "node_modules/web-streams-polyfill": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.3.3.tgz", - "integrity": "sha512-d2JWLCivmZYTSIoge9MsgFCZrt571BikcWGYkjC1khllbTeDlGqZ2D8vD8E/lJa8WGWbb7Plm8/XJYV7IJHZZw==", - "engines": { - "node": ">= 8" - } - }, "node_modules/webidl-conversions": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", diff --git a/package.json b/package.json index 5b5d3c76..0c34bbe4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@suffolklitlab/alkiln", - "version": "5.13.0", + "version": "5.13.1", "description": "Integrated automated end-to-end testing with docassemble, puppeteer, and cucumber.", "main": "lib/index.js", "scripts": { @@ -47,7 +47,7 @@ "minimatch": "3.0.5", "minimist": "1.2.8", "mocha": "9.2.2", - "pdfjs-dist": "3.2.146", + "pdfjs-dist": "3.11.174", "puppeteer": "22.15.0", "qs": "6.10.3", "sanitize-filename": "1.6.3", From 837934465f7ecd74cd808e0ce85ab72f763ce86c Mon Sep 17 00:00:00 2001 From: plocket <52798256+plocket@users.noreply.github.com> Date: Thu, 21 Nov 2024 10:13:02 -0500 Subject: [PATCH 3/6] Fix #725, partial filename match for downloading fails The failure is actually during the comparison - the file was being saved using the partial name the author gave in the Step when it should have been using the file's downloaded name. Note that our current download method will, in ideal cases, let an author re-name the downloaded file. Since it might not be consistent, we might still avoid implementing this at this point. Also, in ideal cases, the Step does already continue without waiting for the whole file to download, which addresses #492. That happened a while ago. It's worth considering closing that issue at this point. We have to research under what circumstances a file would fail to download with a `fetch` while still being able to download with a click. Maybe with an encrypted interview. Co-authored-by: ethanstrominger --- .github/workflows/github_server.yml | 6 +- .github/workflows/playground.yml | 6 +- CHANGELOG.md | 9 ++- .../data/sources/observation_steps.feature | 13 ++-- lib/scope.js | 61 +++++++++++++++---- lib/steps.js | 3 +- package.json | 2 +- 7 files changed, 74 insertions(+), 26 deletions(-) diff --git a/.github/workflows/github_server.yml b/.github/workflows/github_server.yml index d4cf9764..fb0ddd31 100644 --- a/.github/workflows/github_server.yml +++ b/.github/workflows/github_server.yml @@ -52,8 +52,8 @@ jobs: EMPTY_STRING: "" NORMAL_USER_EMAIL: alkiln@example.com NORMAL_USER_PASSWORD: User123^ - WRONG_EMAIL=wrong_email@example.com - WRONG_PASSWORD=wrong_password + WRONG_EMAIL: wrong_email@example.com + WRONG_PASSWORD: wrong_password steps: # Place the root directory in this branch to access @@ -160,7 +160,7 @@ jobs: #### Developer note: You can probably leave the rest out #### To learn more, see https://assemblyline.suffolklitlab.org/docs/alkiln/writing/#optional-inputs ALKILN_TAG_EXPRESSION: "${{ env.ALKILN_TAG_EXPRESSION }}" - ALKILN_VERSION: delete + ALKILN_VERSION: download #### Developer note: Example of making an issue when tests fail #### that includes the text of the failure output file diff --git a/.github/workflows/playground.yml b/.github/workflows/playground.yml index caa4f881..cca4ff6d 100644 --- a/.github/workflows/playground.yml +++ b/.github/workflows/playground.yml @@ -47,8 +47,8 @@ jobs: NORMAL_USER_PASSWORD: ${{ secrets.USER_NO_PERMISSIONS_PASSWORD }} NORMAL_USER_API_KEY: ${{ secrets.USER_NO_PERMISSIONS_API_KEY }} INVALID_API_KEY: invalidAPIkey - WRONG_EMAIL=wrong_email@example.com - WRONG_PASSWORD=wrong_password + WRONG_EMAIL: wrong_email@example.com + WRONG_PASSWORD: wrong_password EMPTY_STRING: "" SECRET_VAR1: secret-var1-value SECRET_VAR2: secret-var2-value @@ -81,4 +81,4 @@ jobs: # want to check up on this. ALKILN_TAG_EXPRESSION: "${{ env.ALKILN_TAG_EXPRESSION }}" #### Developer note: You can probably leave this out - ALKILN_VERSION: delete + ALKILN_VERSION: download diff --git a/CHANGELOG.md b/CHANGELOG.md index 530c8679..32685b88 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -45,6 +45,13 @@ Format: ## [Unreleased] + + +### Fixed +- Fixes download Step unable to use a partial filename match. The Step needed the whole name, including the extension. See [#725](https://github.com/SuffolkLITLab/ALKiln/issues/725). + +## [5.13.1] - 2024-10-23 + ### Changed - Moves "expected" status error to only be visible to internal test errors. Closes [#933](https://github.com/SuffolkLITLab/ALKiln/issues/933). @@ -52,7 +59,6 @@ Format: ### Fixed - Detects failed sign in. Closes [#918](https://github.com/SuffolkLITLab/ALKiln/issues/918). -- Updates pdfjs-dist for node v20 and v22. See [#952](https://github.com/SuffolkLITLab/ALKiln/issues/952). ### Internal @@ -63,6 +69,7 @@ Format: - Adds decision docs - Updated CONTRIBUTING.md - Added example.env, closes [#374](https://github.com/SuffolkLITLab/ALKiln/issues/374) +- Updates pdfjs-dist for node v20 and v22. See [#952](https://github.com/SuffolkLITLab/ALKiln/issues/952). ## [5.13.0] - 2024-07-11 diff --git a/docassemble/ALKilnTests/data/sources/observation_steps.feature b/docassemble/ALKilnTests/data/sources/observation_steps.feature index 6afeba9f..69875ffa 100644 --- a/docassemble/ALKilnTests/data/sources/observation_steps.feature +++ b/docassemble/ALKilnTests/data/sources/observation_steps.feature @@ -239,19 +239,19 @@ Scenario: I compare different PDFs Given the final Scenario status should be "failed" And the Scenario report should include: """ - Could not find the existing PDF at DOES_NOT_EXIST.pdf + ALK0156 """ And the Scenario report should include: """ - The PDFs were not the same. + ALK0157 """ - And the Scenario report should include: + And the Scenario report should include: """ - The new PDF added: + - diff """ And the Scenario report should include: """ - - diff + ALK0093 """ Given I start the interview at "test_pdf" Then the question id should be "proxy vars" @@ -268,6 +268,7 @@ Scenario: I compare different PDFs And I tap to continue # Next page Then the question id should be "2_signature download" - When I download "2_signature.pdf" + # Match a partial name + When I download "2_signatu" And I expect the baseline PDF "DOES_NOT_EXIST.pdf" and the new PDF "2_signature.pdf" to be the same And I expect the baseline PDF "linear_2_signature-Baseline.pdf" and the new PDF "2_signature.pdf" to be the same diff --git a/lib/scope.js b/lib/scope.js index 65cf65b2..65279c64 100644 --- a/lib/scope.js +++ b/lib/scope.js @@ -2781,7 +2781,7 @@ module.exports = { await scope.afterStep(scope); }, // Ends scope.steps.sign() - download: async ( scope, filename ) => { + download: async ( scope, full_or_partial_file_href ) => { /* Taps the link that leads to the given filename to trigger downloading. * and waits till the file has been downloaded before allowing the tests to continue. * WARNING: Cannot download the same file twice in a single scenario. @@ -2791,47 +2791,86 @@ module.exports = { * TODO: Properly wait for download to complete. See notes in * scope.js scope.detectDownloadComplete() */ - let [elem] = await scope.page.$$(`xpath/.//a[contains(@href, "${ filename }")]`); + let [elem] = await scope.page.$$(`xpath/.//a[contains(@href, "${ full_or_partial_file_href }")]`); - let msg = `"${ filename }" seems to be missing. Cannot find a link to that document.`; + let msg = `"${ full_or_partial_file_href }" seems to be missing on the page. Cannot find a link to that document.`; if ( !elem ) { reports.addToReport(scope, { type: `error`, code: `ALK0152`, value: msg }); } expect( elem, msg ).to.exist; let failed_to_download = false; let err_msg = ""; try { - const binaryStr = await scope.page.evaluate(el => { + + const { disposition, binaryStr } = await scope.page.evaluate(async function ( el ) { const url = el.getAttribute("href"); return new Promise(async (resolve, reject) => { const response = await fetch(url, {method: "GET"}); const reader = new FileReader(); reader.readAsBinaryString(await response.blob()); - reader.onload = () => resolve(reader.result); + // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition + reader.onload = () => resolve({ + disposition: response.headers.get(`Content-Disposition`), + binaryStr: reader.result + }); reader.onerror = () => reject(`šŸ¤• ALK0153 ERROR: Error occurred on page when downloading ${ url }: ${ reader.error }`); }); }, elem); + + err_msg = `could not get the actual name of the file from the response headers.`; + let actual_filename = await scope.steps.get_response_filename({ + disposition, default_name: full_or_partial_file_href + }); + if (binaryStr !== '') { + err_msg = `binary data for download was empty`; const fileData = Buffer.from(binaryStr, 'binary'); - fs.writeFileSync(`${ scope.paths.scenario }/${ filename }`, fileData); - reports.addToReport(scope, { type: `row info`, code: `ALK0154`, value: `Downloaded ${ filename } (${ fileData.length } bytes) to ${ scope.paths.scenario }`}); + fs.writeFileSync(`${ scope.paths.scenario }/${ actual_filename }`, fileData); + reports.addToReport(scope, { type: `row info`, code: `ALK0154`, value: `Downloaded "${ actual_filename }" (${ fileData.length } bytes) to ${ scope.paths.scenario }`}); } else { failed_to_download = true; - err_msg = `Couldn't download ${ filename }, binary data for download was empty`; } + } catch (error) { failed_to_download = true; err_msg = error; } if (failed_to_download) { - reports.addToReport(scope, { type: `warning`, code: `ALK0155`, value: `Could not download file using fetch (${ err_msg }). ALKiln will now fallback to the click download method.` }); - scope.toDownload = filename; + reports.addToReport(scope, { type: `warning`, code: `ALK0155`, value: `Could not download a file matching the name "${ full_or_partial_file_href }" using fetch (${ err_msg }). ALKiln will now fallback to the click download method.` }); + scope.toDownload = full_or_partial_file_href; // Should this be using `scope.tapElement`? await elem.evaluate( elem => { return elem.click(); }); await scope.detectDownloadComplete( scope ); } }, // Ends scope.steps.download() + get_response_filename: async function({ disposition, default_name=`found_no_file_name.pdf` }) { + /** Given a fetch response headers' Content-Disposition str, return the + * filename of the response's file. + * + * @return { string | null } - Name of fetched file + * */ + let filename = default_name; + if ( disposition ) { + filename = disposition.split(`;`)[1].split(`=`)[1]; + } + + // Handle potential UTF-8 encoded filenames + if ( filename.toLowerCase().startsWith( `utf-8''` )) { + filename = decodeURIComponent( filename.replace( /utf-8''/i, `` )); + } else { + // Replace starting and ending quotes if they exist + filename = filename.replace( /^['"]/, `` ).replace( /['"]$/, `` ); + } + + // TODO: Add debug log here + // console.log(`filename:`, filename); + + // TODO: Add to the report if we had to use the default name + + return filename; + }, // Ends scope.steps.get_response_filename() + compare_pdfs: async function (scope, {existing_pdf_path, new_pdf_path}) { let existing_paths = await scope.findFiles(scope, {to_find_names: [existing_pdf_path]}); if (existing_paths.length == 0) { @@ -2852,7 +2891,7 @@ module.exports = { let removed_str = diffs.filter(part => part.removed).reduce((err_str, part) => { return err_str + `- ${ part.value }\n` }, 'The new PDF removed: \n'); - let msg = `The PDFs were not the same.\n${ added_str }\n${removed_str}\n\n You can see the full PDFs at ${ full_existing_path } and ${ full_new_pdf_path}`; + let msg = `The PDFs were different.\nAdded:\n${ added_str }\nRemoved:\n${removed_str}\n\nThere might be more information if you actually look at the files. You can see the full PDFs at ${ full_existing_path } and ${ full_new_pdf_path}`; reports.addToReport(scope, { type: `error`, code: `ALK0157`, value: msg }); scope.failed_pdf_compares.push(msg); } diff --git a/lib/steps.js b/lib/steps.js index 54e2ee96..cd7e83a2 100644 --- a/lib/steps.js +++ b/lib/steps.js @@ -1285,10 +1285,11 @@ After(async function(scenario) { if ( scope.failed_pdf_compares.length > 0) { let msg = scope.failed_pdf_compares.reduce((str, new_msg) => `${ str }\nā€•ā€•ā€•\n${ new_msg }`) changeable_test_status = `FAILED`; + // TODO: This may be redundant and therefore confusing reports.addToReport(scope, { type: `error`, code: `ALK0093`, - value: `PDF comparison failed ${ scope.failed_pdf_compares.length } time(s)\nā€•ā€•ā€•\n${ msg }\nā€•ā€•ā€•\n` + value: `ALKiln ran into an error when it tried to compare ${ scope.failed_pdf_compares.length } PDF(s)\nā€•ā€•ā€•\n${ msg }\nā€•ā€•ā€•\n` }); } diff --git a/package.json b/package.json index 0c34bbe4..a35c539c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@suffolklitlab/alkiln", - "version": "5.13.1", + "version": "5.13.1-fix-download-name", "description": "Integrated automated end-to-end testing with docassemble, puppeteer, and cucumber.", "main": "lib/index.js", "scripts": { From b5ca9d16a85fce5ce2977975637c5e0f71938ecc Mon Sep 17 00:00:00 2001 From: plocket <52798256+plocket@users.noreply.github.com> Date: Sat, 23 Nov 2024 13:48:51 -0500 Subject: [PATCH 4/6] Fix for download file name partial match --- CHANGELOG.md | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 32685b88..02faf38e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -45,7 +45,7 @@ Format: ## [Unreleased] - +## [5.13.2] - 2024-11-23 ### Fixed - Fixes download Step unable to use a partial filename match. The Step needed the whole name, including the extension. See [#725](https://github.com/SuffolkLITLab/ALKiln/issues/725). diff --git a/package.json b/package.json index a35c539c..2c6fd53d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@suffolklitlab/alkiln", - "version": "5.13.1-fix-download-name", + "version": "5.13.2", "description": "Integrated automated end-to-end testing with docassemble, puppeteer, and cucumber.", "main": "lib/index.js", "scripts": { From e63f2a77de29af26d8b5962e39651f51dfcdef88 Mon Sep 17 00:00:00 2001 From: plocket <52798256+plocket@users.noreply.github.com> Date: Sun, 5 Jan 2025 19:58:03 -0500 Subject: [PATCH 5/6] Fixes #960. Updates to latest docassemble HTML. Fixes #960. This handles all appearances of `fieldset` even though that's not completely necessary. It may be more cruft to read, but it's also more consistent, so I went with consistency considering how challenging it already is to trace the various unique rules we have to apply to DOM parsing. --- .github/workflows/github_server.yml | 2 +- .github/workflows/playground.yml | 2 +- CHANGELOG.md | 5 +++++ lib/scope.js | 11 +++++++++-- package.json | 2 +- 5 files changed, 17 insertions(+), 5 deletions(-) diff --git a/.github/workflows/github_server.yml b/.github/workflows/github_server.yml index fb0ddd31..efd2321e 100644 --- a/.github/workflows/github_server.yml +++ b/.github/workflows/github_server.yml @@ -160,7 +160,7 @@ jobs: #### Developer note: You can probably leave the rest out #### To learn more, see https://assemblyline.suffolklitlab.org/docs/alkiln/writing/#optional-inputs ALKILN_TAG_EXPRESSION: "${{ env.ALKILN_TAG_EXPRESSION }}" - ALKILN_VERSION: download + ALKILN_VERSION: da_DOM_fieldset #### Developer note: Example of making an issue when tests fail #### that includes the text of the failure output file diff --git a/.github/workflows/playground.yml b/.github/workflows/playground.yml index cca4ff6d..a897bfb5 100644 --- a/.github/workflows/playground.yml +++ b/.github/workflows/playground.yml @@ -81,4 +81,4 @@ jobs: # want to check up on this. ALKILN_TAG_EXPRESSION: "${{ env.ALKILN_TAG_EXPRESSION }}" #### Developer note: You can probably leave this out - ALKILN_VERSION: download + ALKILN_VERSION: da_DOM_fieldset diff --git a/CHANGELOG.md b/CHANGELOG.md index 02faf38e..4799f101 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -45,9 +45,14 @@ Format: ## [Unreleased] +### Fixed + +- Updates to latest docassemble HTML. See [#960](https://github.com/SuffolkLITLab/ALKiln/issues/960). Changes all appearances of `fieldset` to keep the code consistent. + ## [5.13.2] - 2024-11-23 ### Fixed + - Fixes download Step unable to use a partial filename match. The Step needed the whole name, including the extension. See [#725](https://github.com/SuffolkLITLab/ALKiln/issues/725). ## [5.13.1] - 2024-10-23 diff --git a/lib/scope.js b/lib/scope.js index 65279c64..08d58e95 100644 --- a/lib/scope.js +++ b/lib/scope.js @@ -514,13 +514,17 @@ module.exports = { }, continue_button_selector: `fieldset.da-field-buttons button[type="submit"].btn-primary`, + continue_button_selector_backup: `.da-fieldset.da-field-buttons button[type="submit"].btn-primary`, signature_selector: `fieldset .dasigsave`, + signature_selector_backup: `.da-fieldset .dasigsave`, continue: async function ( scope ) { /* Presses whatever button it finds that might lead to the next page. */ // Any selectors I find seem somewhat precarious. let elem = await Promise.race([ scope.page.waitForSelector(scope.continue_button_selector), // other pages (this is the most consistent way) + scope.page.waitForSelector(scope.continue_button_selector_backup), scope.page.waitForSelector(scope.signature_selector), // signature page + scope.page.waitForSelector(scope.signature_selector_backup), ]); await elem.evaluate( el => { return el.className }); // Waits for navigation or user error @@ -540,9 +544,11 @@ module.exports = { // // `buttons:` can be used in question blocks as choices let regular = await scope.page.$(scope.continue_button_selector); + let regular_backup = await scope.page.$(scope.continue_button_selector_backup); let signature = await scope.page.$(scope.signature_selector); + let signature_backup = await scope.page.$(scope.signature_selector_backup); - return regular !== null || signature !== null; + return regular !== null || regular_backup !== null || signature !== null || signature_backup !== null; }, // Ends scope.continue_exists() @@ -916,7 +922,7 @@ module.exports = { // All the different types of fields // buttons, canvases, inputs of all kinds, selects (dropdowns), textareas. Are there more? // Will deal with `option` once inside `select` - let all_nodes = $( `#dasigpage, fieldset button, .daquestionactionbutton, fieldset input, .da-form-group input, .da-form-group select, form select, .da-form-group textarea` ); + let all_nodes = $( `#dasigpage, fieldset button, .da-fieldset button, .daquestionactionbutton, fieldset input, da-fieldset input, .da-form-group input, .da-form-group select, form select, .da-form-group textarea` ); for ( let node of all_nodes ) { // Decision: Do not abstract the below. There's too much data to pass around for it to make sense let $node = $( node ); @@ -2635,6 +2641,7 @@ module.exports = { let fullPage = true; let signature_elem = await scope.page.$(scope.signature_selector); + signature_elem = signature_elem || await scope.page.$(scope.signature_selector_backup); if ( signature_elem !== null ) { fullPage = false; } diff --git a/package.json b/package.json index 2c6fd53d..fe4305b0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@suffolklitlab/alkiln", - "version": "5.13.2", + "version": "5.13.2-fix-da-dom-fieldset-1", "description": "Integrated automated end-to-end testing with docassemble, puppeteer, and cucumber.", "main": "lib/index.js", "scripts": { From 02f7394d28b35e8670bf7c9dbe275a53573bfe50 Mon Sep 17 00:00:00 2001 From: plocket <52798256+plocket@users.noreply.github.com> Date: Sun, 5 Jan 2025 21:48:37 -0500 Subject: [PATCH 6/6] Bump version for da DOM update --- .github/workflows/github_server.yml | 2 +- .github/workflows/playground.yml | 2 +- CHANGELOG.md | 4 +++- package.json | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/github_server.yml b/.github/workflows/github_server.yml index efd2321e..4bc8d77d 100644 --- a/.github/workflows/github_server.yml +++ b/.github/workflows/github_server.yml @@ -160,7 +160,7 @@ jobs: #### Developer note: You can probably leave the rest out #### To learn more, see https://assemblyline.suffolklitlab.org/docs/alkiln/writing/#optional-inputs ALKILN_TAG_EXPRESSION: "${{ env.ALKILN_TAG_EXPRESSION }}" - ALKILN_VERSION: da_DOM_fieldset + # ALKILN_VERSION: da_DOM_fieldset #### Developer note: Example of making an issue when tests fail #### that includes the text of the failure output file diff --git a/.github/workflows/playground.yml b/.github/workflows/playground.yml index a897bfb5..7d93c1eb 100644 --- a/.github/workflows/playground.yml +++ b/.github/workflows/playground.yml @@ -81,4 +81,4 @@ jobs: # want to check up on this. ALKILN_TAG_EXPRESSION: "${{ env.ALKILN_TAG_EXPRESSION }}" #### Developer note: You can probably leave this out - ALKILN_VERSION: da_DOM_fieldset + # ALKILN_VERSION: da_DOM_fieldset diff --git a/CHANGELOG.md b/CHANGELOG.md index 4799f101..4615e572 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -43,7 +43,9 @@ Format: - --> -## [Unreleased] + + +## [5.13.3] - 2025-01-05 ### Fixed diff --git a/package.json b/package.json index fe4305b0..377cfd8b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@suffolklitlab/alkiln", - "version": "5.13.2-fix-da-dom-fieldset-1", + "version": "5.13.3", "description": "Integrated automated end-to-end testing with docassemble, puppeteer, and cucumber.", "main": "lib/index.js", "scripts": {