testit-adapter-jest 1.1.2 → 1.1.3
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/README.md +2 -7
- package/dist/testitEnvironment.d.ts +2 -0
- package/dist/testitEnvironment.js +12 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -3,13 +3,6 @@
|
|
|
3
3
|
|
|
4
4
|
## Getting Started
|
|
5
5
|
|
|
6
|
-
### Compatibility
|
|
7
|
-
|
|
8
|
-
| Test IT | Adapter |
|
|
9
|
-
|---------|---------|
|
|
10
|
-
| 3.5 | 1.0 |
|
|
11
|
-
| 4.0 | 1.1 |
|
|
12
|
-
|
|
13
6
|
### Installation
|
|
14
7
|
```
|
|
15
8
|
npm install testit-adapter-jest
|
|
@@ -119,6 +112,8 @@ Description of metadata methods:
|
|
|
119
112
|
- `testit.description` - description in the autotest card
|
|
120
113
|
- `testit.labels` - tags in the work item
|
|
121
114
|
- `testit.link` - links in the autotest card
|
|
115
|
+
- `testit.nameSpace` - directory in the TMS system (default - directory's name of test)
|
|
116
|
+
- `testit.className` - subdirectory in the TMS system (default - file's name of test)
|
|
122
117
|
|
|
123
118
|
Description of methods:
|
|
124
119
|
- `testit.addLinks` - links in the autotest result
|
|
@@ -51,6 +51,8 @@ export default class TestItEnvironment extends NodeEnvironment {
|
|
|
51
51
|
setLabels(labels: string[]): void;
|
|
52
52
|
setWorkItems(workItems: string[]): void;
|
|
53
53
|
setParams(params: any): void;
|
|
54
|
+
setNameSpace(nameSpace: string): void;
|
|
55
|
+
setClassName(className: string): void;
|
|
54
56
|
startStep(name: string, description?: string): void;
|
|
55
57
|
generateExternalId(testName: string): string;
|
|
56
58
|
}
|
|
@@ -66,6 +66,8 @@ class TestItEnvironment extends jest_environment_node_1.default {
|
|
|
66
66
|
addAttachments: this.addAttachments.bind(this),
|
|
67
67
|
addLinks: this.addLinks.bind(this),
|
|
68
68
|
addMessage: this.addMessage.bind(this),
|
|
69
|
+
nameSpace: this.setNameSpace.bind(this),
|
|
70
|
+
className: this.setClassName.bind(this),
|
|
69
71
|
};
|
|
70
72
|
}
|
|
71
73
|
async teardown() {
|
|
@@ -191,8 +193,8 @@ class TestItEnvironment extends jest_environment_node_1.default {
|
|
|
191
193
|
title: autotest.title,
|
|
192
194
|
name: autotest.name,
|
|
193
195
|
description: autotest.description,
|
|
194
|
-
namespace: (0, utils_1.getDir)(this.testPath),
|
|
195
|
-
classname: (0, utils_1.getFileName)(this.testPath),
|
|
196
|
+
namespace: autotest.namespace ?? (0, utils_1.getDir)(this.testPath),
|
|
197
|
+
classname: autotest.classname ?? (0, utils_1.getFileName)(this.testPath),
|
|
196
198
|
setup: setupSteps.map(mappers_1.mapStep),
|
|
197
199
|
steps: autotest.steps.map(mappers_1.mapStep),
|
|
198
200
|
teardown: teardownSteps.map(mappers_1.mapStep),
|
|
@@ -334,6 +336,14 @@ class TestItEnvironment extends jest_environment_node_1.default {
|
|
|
334
336
|
log('Setting params to %s', this.autotestData.name);
|
|
335
337
|
this.autotestData.params = params;
|
|
336
338
|
}
|
|
339
|
+
setNameSpace(nameSpace) {
|
|
340
|
+
log('Setting nameSpace to %s', nameSpace);
|
|
341
|
+
this.autotestData.namespace = nameSpace;
|
|
342
|
+
}
|
|
343
|
+
setClassName(className) {
|
|
344
|
+
log('Setting nameSpace to %s', className);
|
|
345
|
+
this.autotestData.classname = className;
|
|
346
|
+
}
|
|
337
347
|
startStep(name, description) {
|
|
338
348
|
log('Starting step %s', name);
|
|
339
349
|
if (this.currentType !== 'test' && this.currentType !== 'step') {
|