@suffolklitlab/alkiln 5.13.1-fix-download-name → 5.13.2
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.
|
@@ -52,8 +52,8 @@ jobs:
|
|
|
52
52
|
EMPTY_STRING: ""
|
|
53
53
|
NORMAL_USER_EMAIL: alkiln@example.com
|
|
54
54
|
NORMAL_USER_PASSWORD: User123^
|
|
55
|
-
WRONG_EMAIL
|
|
56
|
-
WRONG_PASSWORD
|
|
55
|
+
WRONG_EMAIL: wrong_email@example.com
|
|
56
|
+
WRONG_PASSWORD: wrong_password
|
|
57
57
|
|
|
58
58
|
steps:
|
|
59
59
|
# Place the root directory in this branch to access
|
|
@@ -160,7 +160,7 @@ jobs:
|
|
|
160
160
|
#### Developer note: You can probably leave the rest out
|
|
161
161
|
#### To learn more, see https://assemblyline.suffolklitlab.org/docs/alkiln/writing/#optional-inputs
|
|
162
162
|
ALKILN_TAG_EXPRESSION: "${{ env.ALKILN_TAG_EXPRESSION }}"
|
|
163
|
-
ALKILN_VERSION:
|
|
163
|
+
ALKILN_VERSION: download
|
|
164
164
|
|
|
165
165
|
#### Developer note: Example of making an issue when tests fail
|
|
166
166
|
#### that includes the text of the failure output file
|
|
@@ -47,8 +47,8 @@ jobs:
|
|
|
47
47
|
NORMAL_USER_PASSWORD: ${{ secrets.USER_NO_PERMISSIONS_PASSWORD }}
|
|
48
48
|
NORMAL_USER_API_KEY: ${{ secrets.USER_NO_PERMISSIONS_API_KEY }}
|
|
49
49
|
INVALID_API_KEY: invalidAPIkey
|
|
50
|
-
WRONG_EMAIL
|
|
51
|
-
WRONG_PASSWORD
|
|
50
|
+
WRONG_EMAIL: wrong_email@example.com
|
|
51
|
+
WRONG_PASSWORD: wrong_password
|
|
52
52
|
EMPTY_STRING: ""
|
|
53
53
|
SECRET_VAR1: secret-var1-value
|
|
54
54
|
SECRET_VAR2: secret-var2-value
|
|
@@ -81,4 +81,4 @@ jobs:
|
|
|
81
81
|
# want to check up on this.
|
|
82
82
|
ALKILN_TAG_EXPRESSION: "${{ env.ALKILN_TAG_EXPRESSION }}"
|
|
83
83
|
#### Developer note: You can probably leave this out
|
|
84
|
-
ALKILN_VERSION:
|
|
84
|
+
ALKILN_VERSION: download
|
package/CHANGELOG.md
CHANGED
|
@@ -45,7 +45,7 @@ Format:
|
|
|
45
45
|
|
|
46
46
|
## [Unreleased]
|
|
47
47
|
|
|
48
|
-
|
|
48
|
+
## [5.13.2] - 2024-11-23
|
|
49
49
|
|
|
50
50
|
### Fixed
|
|
51
51
|
- 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).
|
package/lib/scope.js
CHANGED
|
@@ -2781,7 +2781,7 @@ module.exports = {
|
|
|
2781
2781
|
await scope.afterStep(scope);
|
|
2782
2782
|
}, // Ends scope.steps.sign()
|
|
2783
2783
|
|
|
2784
|
-
download: async ( scope,
|
|
2784
|
+
download: async ( scope, full_or_partial_file_href ) => {
|
|
2785
2785
|
/* Taps the link that leads to the given filename to trigger downloading.
|
|
2786
2786
|
* and waits till the file has been downloaded before allowing the tests to continue.
|
|
2787
2787
|
* WARNING: Cannot download the same file twice in a single scenario.
|
|
@@ -2791,9 +2791,9 @@ module.exports = {
|
|
|
2791
2791
|
* TODO: Properly wait for download to complete. See notes in
|
|
2792
2792
|
* scope.js scope.detectDownloadComplete()
|
|
2793
2793
|
*/
|
|
2794
|
-
let [elem] = await scope.page.$$(`xpath/.//a[contains(@href, "${
|
|
2794
|
+
let [elem] = await scope.page.$$(`xpath/.//a[contains(@href, "${ full_or_partial_file_href }")]`);
|
|
2795
2795
|
|
|
2796
|
-
let msg = `"${
|
|
2796
|
+
let msg = `"${ full_or_partial_file_href }" seems to be missing on the page. Cannot find a link to that document.`;
|
|
2797
2797
|
if ( !elem ) { reports.addToReport(scope, { type: `error`, code: `ALK0152`, value: msg }); }
|
|
2798
2798
|
expect( elem, msg ).to.exist;
|
|
2799
2799
|
|
|
@@ -2818,7 +2818,7 @@ module.exports = {
|
|
|
2818
2818
|
|
|
2819
2819
|
err_msg = `could not get the actual name of the file from the response headers.`;
|
|
2820
2820
|
let actual_filename = await scope.steps.get_response_filename({
|
|
2821
|
-
disposition, default_name:
|
|
2821
|
+
disposition, default_name: full_or_partial_file_href
|
|
2822
2822
|
});
|
|
2823
2823
|
|
|
2824
2824
|
if (binaryStr !== '') {
|
|
@@ -2836,8 +2836,8 @@ module.exports = {
|
|
|
2836
2836
|
}
|
|
2837
2837
|
|
|
2838
2838
|
if (failed_to_download) {
|
|
2839
|
-
reports.addToReport(scope, { type: `warning`, code: `ALK0155`, value: `Could not download a file matching the name "${
|
|
2840
|
-
scope.toDownload =
|
|
2839
|
+
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.` });
|
|
2840
|
+
scope.toDownload = full_or_partial_file_href;
|
|
2841
2841
|
// Should this be using `scope.tapElement`?
|
|
2842
2842
|
await elem.evaluate( elem => { return elem.click(); });
|
|
2843
2843
|
await scope.detectDownloadComplete( scope );
|
package/package.json
CHANGED