@suffolklitlab/alkiln 4.0.0-pre-api.8 → 4.1.0
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.
- package/CHANGELOG.md +69 -11
- package/README.md +10 -2
- package/action.yml +7 -5
- package/lib/docassemble/docassemble_api_interface.js +3 -2
- package/lib/docassemble/get_base_interview_url.js +19 -0
- package/lib/index.js +0 -2
- package/lib/scope.js +170 -99
- package/lib/steps.js +22 -22
- package/lib/utils/langs.js +3 -3
- package/lib/utils/session_vars.js +56 -82
- package/package.json +4 -5
- package/tests/features/establishing_steps.feature +2 -2
- package/tests/features/observation_steps.feature +1 -1
- package/tests/features/reports.feature +23 -55
- package/tests/features/story_table_formats.feature +1 -1
- package/tests/features/story_tables.feature +1 -1
- package/tests/unit_tests/getMatchingRows.test.js +28 -0
- package/tests/unit_tests/matches.fixtures.js +13 -1
- package/tests/unit_tests/session_vars.test.js +46 -0
- package/tests/unit_tests/tables.fixtures.js +12 -2
- package/lib/utils/env_vars.js +0 -177
- package/tests/unit_tests/env_vars.test.js +0 -53
package/CHANGELOG.md
CHANGED
|
@@ -38,12 +38,15 @@ Format:
|
|
|
38
38
|
### Security
|
|
39
39
|
-
|
|
40
40
|
-->
|
|
41
|
-
<!--
|
|
41
|
+
<!-- ## [Unreleased] -->
|
|
42
|
+
## [4.1.0] - 2022-04-01
|
|
43
|
+
### Added
|
|
44
|
+
- Step to set vars to secret variables. That is, using environment variables while hiding the names of those variables in the report, errors, and console logs.
|
|
42
45
|
|
|
43
|
-
## [
|
|
46
|
+
## [4.0.0] - 2022-03-30
|
|
44
47
|
### Added
|
|
45
|
-
- Add
|
|
46
|
-
- Add
|
|
48
|
+
- BREAKING: Add package.json creation/overwriting to action.yml. Simplify package.json.
|
|
49
|
+
- BREAKING: Add action.yml that runs most of what users' workflows run now, along with notes for a new user workflow that will take less maintainance. See #420. We need to add documentation on how to write a workflow file as it currently is if they want to take back control. Setup interview has not yet been updated with this workflow.
|
|
47
50
|
- Step: `the text in the JSON variable "variable_with_text_value" should be`. Compare JSON variable with a text value to given text. See #470. Does not accept nested values, e.g. "child.name.first". Downloads all the JSON vars to a .json file in the "downloads" artifacts.
|
|
48
51
|
- Step to log the page's JSON variables and values in the report. Future goal: save to file. See #454.
|
|
49
52
|
- Step to log into the developer's docassemble server account using GitHub SECRETs. See #499.
|
|
@@ -51,15 +54,17 @@ Format:
|
|
|
51
54
|
- Add control of alkiln npm version to the action.yml
|
|
52
55
|
|
|
53
56
|
### Changed
|
|
54
|
-
-
|
|
55
|
-
- Update to
|
|
56
|
-
- Update
|
|
57
|
-
-
|
|
57
|
+
- BREAKING: NPM package is now suffolklitlab scoped package. Refer to @suffolklitlab/alkiln from now on.
|
|
58
|
+
- BREAKING: Update to v13 of puppeteer
|
|
59
|
+
- BREAKING: Update to v7 of cucumber
|
|
60
|
+
- BREAKING: Update action.yml node to v17
|
|
61
|
+
- BREAKING: Use alkiln v4 package.json we create during the test run in `action.yml` (as discussed in #489)
|
|
62
|
+
- BREAKING: Use API key to access da server, create projects, pull code, delete projects, and check for server restart.
|
|
63
|
+
- BREAKING: Throw an error for uploading nonexistent file, changed to error instead of warning in reports.
|
|
64
|
+
- Update test setup interview to v4 of ALKiln.
|
|
58
65
|
- Remove and ignore package-lock.json so that our tests will behave more like our users' tests
|
|
59
|
-
- Use API key to access da server, create projects, pull code, delete projects, and check for server restart.
|
|
60
66
|
- Add warning in steps.js for name input with too many parts. Add test in reports.
|
|
61
|
-
- fix typo in the report
|
|
62
|
-
- Throw an error for uploading nonexistent file, changed to error instead of warning in reports.
|
|
67
|
+
- fix typo in the report
|
|
63
68
|
- Allow a developer to wait as a first Step. See #387.
|
|
64
69
|
|
|
65
70
|
<!-- ## [3.0.1-peer-deps.1] - 2021-12-07 -->
|
|
@@ -67,10 +72,63 @@ Format:
|
|
|
67
72
|
- Peer dependencies and dev dependencies. Now `cucumber` is just a dependency. See https://github.com/SuffolkLITLab/ALKiln/issues/396 for discussion. Setup interview has not been updated to remove dependencies.
|
|
68
73
|
|
|
69
74
|
### Fixed
|
|
75
|
+
- Proxy var story table row matches for any page containing the given variable name when there's only one row for the relevant variable. #464.
|
|
70
76
|
- Fixed interview name not allowing url parameters. #449
|
|
71
77
|
- Freeze colors npm package to before bug in both package.json and action.yml
|
|
72
78
|
- Fix invalid project name allowed.
|
|
73
79
|
- fix typo in the report.
|
|
80
|
+
- session_vars branch path regex not removing start of branch path
|
|
81
|
+
|
|
82
|
+
## [3.2.1] - 2022-02-09
|
|
83
|
+
### Fixed
|
|
84
|
+
- Typo in report that was messing up copy/paste of test table
|
|
85
|
+
|
|
86
|
+
## [3.2.0] - 2022-02-09
|
|
87
|
+
### Added
|
|
88
|
+
- Add Step to log into server account using GitHub SECRETs (environment variables). See #499.
|
|
89
|
+
|
|
90
|
+
## [3.1.11] - 2022-02-02
|
|
91
|
+
### Changed
|
|
92
|
+
- Handle an Assembly Line name Step value that has too many names, including a warning for the developer. Include the first three names and the last name to try to catch suffixes.
|
|
93
|
+
|
|
94
|
+
## [3.0.11] - 2022-01-25
|
|
95
|
+
### Added
|
|
96
|
+
- Step: `the text in the JSON variable "variable_with_text_value" should be`. Compare JSON variable with a text value to given text. See #470. Does not accept nested values, e.g. "child.name.first". Downloads all the JSON vars to a .json file in the "downloads" artifacts.
|
|
97
|
+
|
|
98
|
+
## [3.0.10] - 2022-01-24
|
|
99
|
+
### Added
|
|
100
|
+
- Step to log the page's JSON variables and values in the report. Future goal: save to file. See #454.
|
|
101
|
+
|
|
102
|
+
## [3.0.9] - 2022-01-10
|
|
103
|
+
### Security
|
|
104
|
+
- Install the security fix in the action's package.json as well. Because dependents have to require cucumber itself, if they're not using our action (if they have their own package.json), they're going to have to implement this fix in their repo too. That's why our fix isn't working. We'll start the process of helping developers update. We also need to deprecate all previous versions of ALKiln. See #489.
|
|
105
|
+
|
|
106
|
+
## [3.0.8] - 2022-01-10
|
|
107
|
+
### Security
|
|
108
|
+
- Fully publish the security fix in v3.0.7
|
|
109
|
+
|
|
110
|
+
## [3.0.7] - 2022-01-10
|
|
111
|
+
### Security
|
|
112
|
+
- Pinned colors library to 1.4.0. See https://www.bleepingcomputer.com/news/security/dev-corrupts-npm-libs-colors-and-faker-breaking-thousands-of-apps/. We don't use faker, so we don't need to handle that.
|
|
113
|
+
|
|
114
|
+
## [3.0.6] - 2022-01-07
|
|
115
|
+
### Changed
|
|
116
|
+
- See #371
|
|
117
|
+
- Scenario heading tags are now on a second line
|
|
118
|
+
- Artifact filenames use dashes more and are created separately from Scenario headings
|
|
119
|
+
- Scenario ids are separated from filenames and Scenario headings
|
|
120
|
+
|
|
121
|
+
## [3.0.5] - 2022-01-06
|
|
122
|
+
### Added
|
|
123
|
+
- Add action.yml that runs most of what users' workflows run now, along with notes for a new user workflow that will take less maintainance. See #420. We need to add documentation on how to write a workflow file as it currently is if they want to take back control. Setup interview has not yet been updated with this workflow.
|
|
124
|
+
- Add package.json creation/overwriting to action.yml. Simplify package.json.
|
|
125
|
+
|
|
126
|
+
<!-- ## [3.0.1-peer-deps.1] - 2021-12-07 -->
|
|
127
|
+
### Removed
|
|
128
|
+
- Peer dependencies and dev dependencies. Now `cucumber` is just a dependency. See https://github.com/SuffolkLITLab/ALKiln/issues/396 for discussion. Setup interview has not been updated to remove dependencies.
|
|
129
|
+
|
|
130
|
+
### Fixed
|
|
131
|
+
- Fixed interview name not allowing url parameters. #449
|
|
74
132
|
|
|
75
133
|
## [3.0.4] - 2021-12-11
|
|
76
134
|
### Fixed
|
package/README.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
|
-
#
|
|
2
|
-
Integrated automated end-to-end testing with docassemble, puppeteer, and
|
|
1
|
+
# ALKiln
|
|
2
|
+
Integrated automated end-to-end testing with docassemble, puppeteer, cucumber, and chai.
|
|
3
|
+
|
|
4
|
+
Works well with https://github.com/suffolklitlab/docassemble-AssemblyLine but isn't
|
|
5
|
+
dependent on it.
|
|
6
|
+
|
|
7
|
+
Formerly named "docassemble-cucumber"
|
|
8
|
+
|
|
9
|
+
## Documentation
|
|
10
|
+
Read about how to use this framework at https://suffolklitlab.org/docassemble-AssemblyLine-documentation/docs/automated_integrated_testing/.
|
|
3
11
|
|
|
4
12
|
## Integration tests
|
|
5
13
|
To setup for the integration tests, create the project on the server:
|
package/action.yml
CHANGED
|
@@ -32,6 +32,7 @@ inputs:
|
|
|
32
32
|
runs:
|
|
33
33
|
using: "composite"
|
|
34
34
|
steps:
|
|
35
|
+
|
|
35
36
|
# Set environment variables
|
|
36
37
|
- name: "ALKiln: Set environment variables"
|
|
37
38
|
# If extra languages were set manually, override the repository
|
|
@@ -54,9 +55,13 @@ runs:
|
|
|
54
55
|
echo "DOCASSEMBLE_DEVELOPER_API_KEY=${{ inputs.DOCASSEMBLE_DEVELOPER_API_KEY }}" >> $GITHUB_ENV
|
|
55
56
|
echo "ALKILN_VERSION=${{ inputs.ALKILN_VERSION }}" >> $GITHUB_ENV
|
|
56
57
|
shell: bash
|
|
58
|
+
- name: "ALKiln: confirm info"
|
|
59
|
+
run: echo -e "\nRepo is $REPO_URL\nBranch ref is $BRANCH_PATH\nManually added languages are $EXTRA_LANGUAGES\nAll other data is secret\n"
|
|
60
|
+
shell: bash
|
|
61
|
+
|
|
57
62
|
# This doesn't use an already established package-lock.json and that
|
|
58
63
|
# comes with some types of test breaking risks. Same problem as before.
|
|
59
|
-
- name:
|
|
64
|
+
- name: Temporarily overwrite or create package.json
|
|
60
65
|
run: |
|
|
61
66
|
cat << EOF > "package.json"
|
|
62
67
|
{
|
|
@@ -76,11 +81,8 @@ runs:
|
|
|
76
81
|
}
|
|
77
82
|
}
|
|
78
83
|
shell: bash
|
|
79
|
-
- name: "ALKiln: confirm info"
|
|
80
|
-
run: echo -e "\nRepo is $REPO_URL\nBranch ref is $BRANCH_PATH\nManually added languages are $EXTRA_LANGUAGES\nAll other data is secret\n"
|
|
81
|
-
shell: bash
|
|
82
84
|
|
|
83
|
-
# Install node
|
|
85
|
+
# Install node
|
|
84
86
|
- name: "ALKiln: Install node packages"
|
|
85
87
|
uses: actions/setup-node@v1
|
|
86
88
|
with:
|
|
@@ -124,7 +124,8 @@ da_i.get_dev_id = async function ( dev_id_options ) {
|
|
|
124
124
|
|
|
125
125
|
// Default timeouts
|
|
126
126
|
let { timeout } = dev_id_options || { timeout: 75 * 1000 };
|
|
127
|
-
|
|
127
|
+
let response = await _da_REST.get_dev_id( timeout );
|
|
128
|
+
return response.data.id;
|
|
128
129
|
}; // Ends da_i.get_dev_id();
|
|
129
130
|
|
|
130
131
|
|
|
@@ -242,7 +243,7 @@ da_i.loop_to_create_project = async function( creation_options ) {
|
|
|
242
243
|
throw error;
|
|
243
244
|
|
|
244
245
|
} // ends type of non-response error
|
|
245
|
-
} // ends type of
|
|
246
|
+
} // ends type of response error
|
|
246
247
|
} // ends try
|
|
247
248
|
} // ends while
|
|
248
249
|
}; // Ends da_i.loop_to_create_project()
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
let session_vars = require(`../utils/session_vars`);
|
|
2
|
+
let docassemble_api_interface = require('./docassemble_api_interface');
|
|
3
|
+
|
|
4
|
+
let get_base_interview_url = async function () {
|
|
5
|
+
/** Return the part of the interview URL that comes before the filename.
|
|
6
|
+
* Depends on the project name, which may get changed.
|
|
7
|
+
* This also needs to ensure that variable values from previous tests aren't used.
|
|
8
|
+
* That's not completely possible, but our tests try to do this in several ways.
|
|
9
|
+
* This function uses `new_session=1` to try to ensure old session vars aren't used.
|
|
10
|
+
* When finishing a test, we go to the sign out page (which is supposed to help even
|
|
11
|
+
* when the user is not logged in.) We can't use `reset=2` because it caused an
|
|
12
|
+
* 'Unable to locate interview session' error. */
|
|
13
|
+
let server_url = session_vars.get_da_server_url();
|
|
14
|
+
let dev_id = await docassemble_api_interface.get_dev_id();
|
|
15
|
+
let project_name = session_vars.get_project_name();
|
|
16
|
+
return `${ server_url }/interview?new_session=1&i=docassemble.playground${ dev_id }${ project_name }%3A`;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
module.exports = get_base_interview_url;
|
package/lib/index.js
CHANGED