testit-adapter-cucumber 1.0.3 → 1.0.4
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/LICENSE.md +202 -0
- package/README.md +144 -0
- package/dist/formatter.js +3 -2
- package/dist/formatter.js.map +1 -1
- package/dist/mappers.js +7 -2
- package/dist/mappers.js.map +1 -1
- package/package.json +1 -1
- package/src/formatter.ts +3 -2
- package/src/mappers.ts +7 -2
- package/testit-adapter-cucumber-1.0.4.tgz +0 -0
package/LICENSE.md
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright 2022 Test IT
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
# Test IT TMS adapters for JavaScript
|
|
2
|
+

|
|
3
|
+
|
|
4
|
+
# Cucumber
|
|
5
|
+
|
|
6
|
+
## Getting Started
|
|
7
|
+
|
|
8
|
+
### Installation
|
|
9
|
+
```
|
|
10
|
+
npm install testit-adapter-cucumber
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
### API client
|
|
16
|
+
|
|
17
|
+
To use adapter you need to install `testit-api-client`:
|
|
18
|
+
```
|
|
19
|
+
npm install testit-api-client
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
### Configuration
|
|
23
|
+
|
|
24
|
+
Create `testitFormatter.js` file in the root directory of the project:
|
|
25
|
+
```js
|
|
26
|
+
const { TestItFormatter } = require('testit-adapter-cucumber');
|
|
27
|
+
|
|
28
|
+
module.exports = class CustomFormatter extends TestItFormatter {
|
|
29
|
+
constructor(options) {
|
|
30
|
+
super(options, {
|
|
31
|
+
url: '<url>',
|
|
32
|
+
privateToken: '<token>',
|
|
33
|
+
projectId: '<id>',
|
|
34
|
+
configurationId: '<id>',
|
|
35
|
+
testRunId: '<optional id>',
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
And fill object with your configuration. Formatter sends results to Test IT.
|
|
42
|
+
|
|
43
|
+
> TestRunId is optional. If it's not provided than it create automatically.
|
|
44
|
+
|
|
45
|
+
Add to `cucumber.js` file
|
|
46
|
+
|
|
47
|
+
```js
|
|
48
|
+
module.exports = {
|
|
49
|
+
default:
|
|
50
|
+
'-f ./testitFormatter.js',
|
|
51
|
+
};
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### Tags
|
|
55
|
+
|
|
56
|
+
Formatter provides additional methods to World:
|
|
57
|
+
|
|
58
|
+
- addMessage - adds message to autotest
|
|
59
|
+
- addLinks - adds links to autotest
|
|
60
|
+
- addAttachments - uploads specified to Test IT and links to test run
|
|
61
|
+
|
|
62
|
+
```js
|
|
63
|
+
When('Something happens', function () {
|
|
64
|
+
this.addMessage('💔');
|
|
65
|
+
this.addLinks([
|
|
66
|
+
{
|
|
67
|
+
url: 'http://github.com',
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
url: 'https://wikipedia.org',
|
|
71
|
+
title: 'Wikipedia',
|
|
72
|
+
description: 'The free encyclopedia',
|
|
73
|
+
type: 'Related',
|
|
74
|
+
hasInfo: true,
|
|
75
|
+
},
|
|
76
|
+
]);
|
|
77
|
+
this.addAttachments(['path/to/file.txt']);
|
|
78
|
+
});
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Cucumber tags can be used to specify information about autotest.
|
|
82
|
+
|
|
83
|
+
> Only those specified above the `Scenario` are taken into account
|
|
84
|
+
|
|
85
|
+
- `@ExternalId` - Unique identifier of autotest (Required)
|
|
86
|
+
- `@Title` - Title that is displayed on autotest page
|
|
87
|
+
- `@DisplayName` - Name that is displayed in autotests table
|
|
88
|
+
- `@Description` - Autotest description
|
|
89
|
+
- `@Link` - can be specified either in JSON (`@Link={"url":"http://google.com","hasInfo":true,"description":"GoogleDescription","title":"Google","type":"Defect"}`) or in text (`@Link=http://google.com`)
|
|
90
|
+
- `@Label` - Label that is going to be linked to autotest
|
|
91
|
+
- `@WorkItemId` - Work item's ID to which autotest is going to be linked
|
|
92
|
+
|
|
93
|
+
### Examples
|
|
94
|
+
|
|
95
|
+
#### Tags
|
|
96
|
+
```
|
|
97
|
+
Feature: Tags
|
|
98
|
+
@DisplayName=GoogiliGoogle
|
|
99
|
+
@Description=Cannot_Write_With_Spaces
|
|
100
|
+
@ExternalId=344
|
|
101
|
+
@Link=http://google.com
|
|
102
|
+
@Link=http://vk.com
|
|
103
|
+
@Label=Maths
|
|
104
|
+
@Label=School
|
|
105
|
+
Scenario: Scenario with links
|
|
106
|
+
When 2+2
|
|
107
|
+
Then Result is 4
|
|
108
|
+
@Title=LINKS
|
|
109
|
+
@ExternalId=343
|
|
110
|
+
@Link={"url":"http://google.com","hasInfo":true,"description":"GoogleDescription","title":"Google","type":"Defect"}
|
|
111
|
+
Scenario: Scenario with link obj
|
|
112
|
+
When 2+2
|
|
113
|
+
Then Result is 4
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
#### Parameterized test
|
|
117
|
+
```
|
|
118
|
+
Feature: Rule
|
|
119
|
+
Tests that use Rule
|
|
120
|
+
@ExternalId=999
|
|
121
|
+
Scenario: Summing
|
|
122
|
+
When <left>+<right>
|
|
123
|
+
Then Result is <result>
|
|
124
|
+
|
|
125
|
+
Examples: Options
|
|
126
|
+
Examples show different options
|
|
127
|
+
| left | right | result |
|
|
128
|
+
| 1 | 1 | 3 |
|
|
129
|
+
| 9 | 9 | 18 |
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
# Contributing
|
|
133
|
+
|
|
134
|
+
You can help to develop the project. Any contributions are **greatly appreciated**.
|
|
135
|
+
|
|
136
|
+
* If you have suggestions for adding or removing projects, feel free to [open an issue](https://github.com/testit-tms/adapters-js/issues/new) to discuss it, or directly create a pull request after you edit the *README.md* file with necessary changes.
|
|
137
|
+
* Please make sure you check your spelling and grammar.
|
|
138
|
+
* Create individual PR for each suggestion.
|
|
139
|
+
* Please also read through the [Code Of Conduct](https://github.com/testit-tms/adapters-js/blob/master/CODE_OF_CONDUCT.md) before posting your first idea as well.
|
|
140
|
+
|
|
141
|
+
# License
|
|
142
|
+
|
|
143
|
+
Distributed under the Apache-2.0 License. See [LICENSE](https://github.com/testit-tms/adapters-js/blob/master/LICENSE.md) for more information.
|
|
144
|
+
|
package/dist/formatter.js
CHANGED
|
@@ -19,9 +19,9 @@ class TestItFormatter extends cucumber_1.Formatter {
|
|
|
19
19
|
return this.onGherkinDocument(envelope.gherkinDocument);
|
|
20
20
|
}
|
|
21
21
|
if (envelope.pickle) {
|
|
22
|
+
const tags = (0, utils_1.parseTags)(envelope.pickle.tags);
|
|
22
23
|
if (this.resolvedAutotests !== undefined) {
|
|
23
24
|
if (this.resolvedAutotests.length > 0) {
|
|
24
|
-
const tags = (0, utils_1.parseTags)(envelope.pickle.tags);
|
|
25
25
|
for (const externalId of this.resolvedAutotests) {
|
|
26
26
|
if (externalId === tags.externalId) {
|
|
27
27
|
return this.onPickle(envelope.pickle);
|
|
@@ -30,9 +30,10 @@ class TestItFormatter extends cucumber_1.Formatter {
|
|
|
30
30
|
}
|
|
31
31
|
envelope.pickle = undefined;
|
|
32
32
|
}
|
|
33
|
-
else {
|
|
33
|
+
else if (tags.externalId !== undefined) {
|
|
34
34
|
return this.onPickle(envelope.pickle);
|
|
35
35
|
}
|
|
36
|
+
envelope.pickle = undefined;
|
|
36
37
|
}
|
|
37
38
|
if (envelope.testCase) {
|
|
38
39
|
return this.onTestCase(envelope.testCase);
|
package/dist/formatter.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formatter.js","sourceRoot":"","sources":["../src/formatter.ts"],"names":[],"mappings":";;;AAAA,iDAAkE;AAclE,yDAK2B;AAE3B,uCAAoC;AAIpC,mCAAqD;AAErD,MAAa,eAAgB,SAAQ,oBAAS;IAM5C,YACE,OAA0B,EAC1B,MAAqC;QAErC,KAAK,CAAC,OAAO,CAAC,CAAC;QARjB,YAAO,GAAa,IAAI,iBAAO,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"formatter.js","sourceRoot":"","sources":["../src/formatter.ts"],"names":[],"mappings":";;;AAAA,iDAAkE;AAclE,yDAK2B;AAE3B,uCAAoC;AAIpC,mCAAqD;AAErD,MAAa,eAAgB,SAAQ,oBAAS;IAM5C,YACE,OAA0B,EAC1B,MAAqC;QAErC,KAAK,CAAC,OAAO,CAAC,CAAC;QARjB,YAAO,GAAa,IAAI,iBAAO,EAAE,CAAC;QAiE1B,qBAAgB,GAAoB,EAAE,CAAC;QAxD7C,IAAI,CAAC,MAAM,GAAG,IAAI,0BAAM,CAAC,MAAM,CAAC,CAAC;QACjC,OAAO,CAAC,gBAAgB,CAAC,EAAE,CAAC,UAAU,EAAE,CAAC,QAAkB,EAAE,EAAE;YAC7D,IAAI,QAAQ,CAAC,IAAI,EAAE;gBACjB,OAAO,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;aACnC;YACD,IAAI,QAAQ,CAAC,eAAe,EAAE;gBAC5B,OAAO,IAAI,CAAC,iBAAiB,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC;aACzD;YACD,IAAI,QAAQ,CAAC,MAAM,EAAE;gBACnB,MAAM,IAAI,GAAG,IAAA,iBAAS,EAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;gBAC7C,IAAI,IAAI,CAAC,iBAAiB,KAAK,SAAS,EAAE;oBACxC,IAAI,IAAI,CAAC,iBAAiB,CAAC,MAAM,GAAG,CAAC,EAAE;wBACrC,KAAK,MAAM,UAAU,IA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,QAAQ,CAAC,IAAI,CAAC,iBAAiB,EAAE,KAAK,CAAC,CAAC;IACvD,CAAC;IAED,cAAc,CAAC,WAAqB;QAClC,IAAI,IAAI,CAAC,iBAAiB,KAAK,SAAS,EAAE;YACxC,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC;SACjD;QACD,MAAM,iBAAiB,GAAG,IAAI,CAAC,iBAAiB,CAAC;QACjD,IAAI,CAAC,gBAAgB,CAAC,IAAI,CACxB,GAAG,WAAW,CAAC,GAAG,CAAC,KAAK,EAAE,UAAU,EAAE,EAAE;YACtC,MAAM,EAAE,EAAE,EAAE,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC;YAC5D,IAAI,EAAE,KAAK,SAAS,EAAE;gBACpB,aAAa;gBACb,OAAO,CAAC,IAAI,CAAC,+BAA+B,CAAC,CAAC;gBAC9C,OAAO;aACR;YACD,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,iBAAiB,EAAE,EAAE,CAAC,CAAC;QACpD,CAAC,CAAC,CACH,CAAC;IACJ,CAAC;IAEO,QAAQ,CAAC,GAAe;;QAC9B,OAAO,CAAC,KAAK,CACX,MAAA,GAAG,CAAC,QAAQ,0CAAE,MAAM,EACpB,GAAG,CAAC,MAAM,CAAC,MAAM,EACjB,GAAG,CAAC,MAAM,CAAC,GAAG,EACd,MAAA,GAAG,CAAC,QAAQ,0CAAE,IAAI,CACnB,CAAC;IACJ,CAAC;CAGF;AArRD,0CAqRC"}
|
package/dist/mappers.js
CHANGED
|
@@ -68,7 +68,11 @@ function mapScenario(scenario, projectId, setup) {
|
|
|
68
68
|
var _a, _b;
|
|
69
69
|
const tags = (0, utils_1.parseTags)(scenario.tags);
|
|
70
70
|
if (tags.externalId === undefined) {
|
|
71
|
-
|
|
71
|
+
return {
|
|
72
|
+
externalId: '',
|
|
73
|
+
name: scenario.name,
|
|
74
|
+
projectId
|
|
75
|
+
};
|
|
72
76
|
}
|
|
73
77
|
const exampleSteps = scenario.examples.map(mapExamples);
|
|
74
78
|
return {
|
|
@@ -89,6 +93,7 @@ function mapScenario(scenario, projectId, setup) {
|
|
|
89
93
|
};
|
|
90
94
|
}
|
|
91
95
|
exports.mapScenario = mapScenario;
|
|
96
|
+
//TODO: Implement using "parameters" fields
|
|
92
97
|
function mapExamples(examples) {
|
|
93
98
|
var _a, _b, _c, _d;
|
|
94
99
|
let table = [];
|
|
@@ -109,7 +114,7 @@ function mapExamples(examples) {
|
|
|
109
114
|
description.push(JSON.stringify(table));
|
|
110
115
|
}
|
|
111
116
|
return {
|
|
112
|
-
title: (_c = (_b = tags.title) !== null && _b !== void 0 ? _b : tags.name) !== null && _c !== void 0 ? _c : examples.name,
|
|
117
|
+
title: (_c = (_b = tags.title) !== null && _b !== void 0 ? _b : tags.name) !== null && _c !== void 0 ? _c : (examples.name !== '' ? examples.name : 'Parameters'),
|
|
113
118
|
description: (_d = tags.description) !== null && _d !== void 0 ? _d : description.join('\n\n'),
|
|
114
119
|
};
|
|
115
120
|
}
|
package/dist/mappers.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mappers.js","sourceRoot":"","sources":["../src/mappers.ts"],"names":[],"mappings":";;;AAAA,iDAS4B;AAE5B,mCAAoC;AAMpC,SAAgB,SAAS,CAAC,MAA4B;IACpD,QAAQ,MAAM,EAAE;QACd,KAAK,+BAAoB,CAAC,MAAM;YAC9B,OAAO,QAAQ,CAAC;QAClB,KAAK,+BAAoB,CAAC,MAAM;YAC9B,OAAO,QAAQ,CAAC;QAClB,KAAK,+BAAoB,CAAC,OAAO;YAC/B,OAAO,SAAS,CAAC;QACnB,KAAK,+BAAoB,CAAC,OAAO;YAC/B,OAAO,SAAS,CAAC;QACnB,KAAK,+BAAoB,CAAC,OAAO,CAAC;QAClC,KAAK,+BAAoB,CAAC,SAAS,CAAC;QACpC,KAAK,+BAAoB,CAAC,SAAS;YACjC,OAAO,SAAS,CAAC;QACnB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AKC;AAED,SAAgB,YAAY,CAC1B,SAAgC;IAEhC,IAAI,SAAS,KAAK,SAAS,EAAE;QAC3B,OAAO,SAAS,CAAC;KAClB;IACD,MAAM,IAAI,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC/D,MAAM,IAAI,GAAG,SAAS,CAAC,IAAI;SACxB,KAAK,CAAC,CAAC,CAAC;SACR,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;IACrD,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CACjC,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE;QAC1B,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;QACpB,OAAO,GAAG,CAAC;IACb,CAAC,EAAE,EAA4B,CAAC,CACjC,CAAC;IACF,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;AACjC,CAAC;AAjBD,oCAiBC"}
|
package/package.json
CHANGED
package/src/formatter.ts
CHANGED
|
@@ -45,9 +45,9 @@ export class TestItFormatter extends Formatter implements IFormatter {
|
|
|
45
45
|
return this.onGherkinDocument(envelope.gherkinDocument);
|
|
46
46
|
}
|
|
47
47
|
if (envelope.pickle) {
|
|
48
|
+
const tags = parseTags(envelope.pickle.tags);
|
|
48
49
|
if (this.resolvedAutotests !== undefined) {
|
|
49
50
|
if (this.resolvedAutotests.length > 0) {
|
|
50
|
-
const tags = parseTags(envelope.pickle.tags);
|
|
51
51
|
for (const externalId of this.resolvedAutotests) {
|
|
52
52
|
if (externalId === tags.externalId) {
|
|
53
53
|
return this.onPickle(envelope.pickle);
|
|
@@ -55,9 +55,10 @@ export class TestItFormatter extends Formatter implements IFormatter {
|
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
envelope.pickle = undefined;
|
|
58
|
-
} else {
|
|
58
|
+
} else if (tags.externalId !== undefined) {
|
|
59
59
|
return this.onPickle(envelope.pickle);
|
|
60
60
|
}
|
|
61
|
+
envelope.pickle = undefined;
|
|
61
62
|
}
|
|
62
63
|
if (envelope.testCase) {
|
|
63
64
|
return this.onTestCase(envelope.testCase);
|
package/src/mappers.ts
CHANGED
|
@@ -96,7 +96,11 @@ export function mapScenario(
|
|
|
96
96
|
): AutotestPostWithWorkItemId {
|
|
97
97
|
const tags = parseTags(scenario.tags);
|
|
98
98
|
if (tags.externalId === undefined) {
|
|
99
|
-
|
|
99
|
+
return {
|
|
100
|
+
externalId: '',
|
|
101
|
+
name: scenario.name,
|
|
102
|
+
projectId
|
|
103
|
+
};
|
|
100
104
|
}
|
|
101
105
|
const exampleSteps = scenario.examples.map(mapExamples);
|
|
102
106
|
return {
|
|
@@ -117,6 +121,7 @@ export function mapScenario(
|
|
|
117
121
|
};
|
|
118
122
|
}
|
|
119
123
|
|
|
124
|
+
//TODO: Implement using "parameters" fields
|
|
120
125
|
export function mapExamples(examples: Examples): AutotestStep {
|
|
121
126
|
let table: string[][] | Record<string, string>[] = [];
|
|
122
127
|
const body = examples.tableBody.map((row) =>
|
|
@@ -142,7 +147,7 @@ export function mapExamples(examples: Examples): AutotestStep {
|
|
|
142
147
|
}
|
|
143
148
|
|
|
144
149
|
return {
|
|
145
|
-
title: tags.title ?? tags.name ?? examples.name,
|
|
150
|
+
title: tags.title ?? tags.name ?? (examples.name !== '' ? examples.name : 'Parameters'),
|
|
146
151
|
description: tags.description ?? description.join('\n\n'),
|
|
147
152
|
};
|
|
148
153
|
}
|
|
Binary file
|