testit-adapter-cypress 5.0.5 → 5.0.6

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 CHANGED
@@ -142,6 +142,7 @@ Description of methods:
142
142
  - `tms.addTitle` - a dynamic method for adding autotest name specified in the autotest card. If not specified, the name from the displayName method is used
143
143
  - `tms.addDescription` - a dynamic method for adding autotest description specified in the autotest card
144
144
  - `tms.addLabels` - a dynamic method for adding labels listed in the autotest card
145
+ - `tms.addLayer` - test pyramid layer in the autotest card (source **Run**). Use `TestLayers` from `testit-js-commons` for recommended values, or any custom string
145
146
  - `tms.addTags` - a dynamic method for adding tags listed in the autotest card
146
147
  - `tms.addLinks` - links in the autotest result
147
148
  - `tms.addAttachments` - uploading files in the autotest result
@@ -156,6 +157,7 @@ Description of methods:
156
157
  #### Simple test
157
158
  ```ts
158
159
  import { getTestRuntime } from "testit-adapter-cypress/runtime";
160
+ import { TestLayers } from "testit-js-commons";
159
161
 
160
162
  describe('example to-do app', () => {
161
163
  it('displays two todo items by default', () => {
@@ -166,6 +168,7 @@ describe('example to-do app', () => {
166
168
  tms.addTitle('test title');
167
169
  tms.addDescription('Test description');
168
170
  tms.addLabels('label1', 'label2');
171
+ tms.addLayer(TestLayers.API);
169
172
  tms.addTags('tag1', 'tag2');
170
173
  tms.addLinks(
171
174
  {
@@ -6,6 +6,7 @@ declare class TmsCypressTestRuntime implements TestRuntime {
6
6
  #private;
7
7
  constructor();
8
8
  addLabels(...labels: string[]): PromiseLike<void>;
9
+ addLayer(layer: string): PromiseLike<void>;
9
10
  addTags(...tags: string[]): PromiseLike<void>;
10
11
  addLinks(...links: Link[]): PromiseLike<void>;
11
12
  addWorkItemIds(...workItemIds: string[]): PromiseLike<void>;
@@ -27,6 +27,14 @@ class TmsCypressTestRuntime {
27
27
  },
28
28
  });
29
29
  }
30
+ addLayer(layer) {
31
+ return __classPrivateFieldGet(this, _TmsCypressTestRuntime_instances, "m", _TmsCypressTestRuntime_enqueueMessageAsync).call(this, {
32
+ type: "metadata",
33
+ data: {
34
+ layer,
35
+ },
36
+ });
37
+ }
30
38
  addTags(...tags) {
31
39
  return __classPrivateFieldGet(this, _TmsCypressTestRuntime_instances, "m", _TmsCypressTestRuntime_enqueueMessageAsync).call(this, {
32
40
  type: "metadata",
@@ -14,6 +14,7 @@ export interface AttachmentOptions {
14
14
  }
15
15
  export interface TestRuntime {
16
16
  addLabels(...labels: string[]): PromiseLike<void>;
17
+ addLayer(layer: string): PromiseLike<void>;
17
18
  addTags(...tags: string[]): PromiseLike<void>;
18
19
  addLinks(...links: Link[]): PromiseLike<void>;
19
20
  addWorkItemIds(...workItemIds: string[]): PromiseLike<void>;
@@ -11,6 +11,7 @@ var ContentType;
11
11
  const noop = { then: () => noop, catch: () => noop };
12
12
  exports.noopRuntime = {
13
13
  addLabels: () => noop,
14
+ addLayer: () => noop,
14
15
  addTags: () => noop,
15
16
  addLinks: () => noop,
16
17
  addWorkItemIds: () => noop,
@@ -24,6 +24,7 @@ export interface TestData {
24
24
  namespace?: string;
25
25
  classname?: string;
26
26
  labels: string[];
27
+ layer?: string;
27
28
  tags: string[];
28
29
  links: Link[];
29
30
  workItemIds: string[];
package/dist/converter.js CHANGED
@@ -44,6 +44,7 @@ function toAutotestPost(specPath, t) {
44
44
  classname: t.classname,
45
45
  links: t.links?.length ? t.links : [],
46
46
  labels: t.labels?.map((l) => ({ name: l })) ?? [],
47
+ layer: t.layer,
47
48
  tags: t.tags?.length ? t.tags : [],
48
49
  steps: t.steps.map(s => stepDataToShortStep(s)),
49
50
  externalKey: t.externalKey,
@@ -174,6 +174,7 @@ type RuntimeMessageBase<T extends string> = {
174
174
  export type RuntimeMetadataMessage = RuntimeMessageBase<"metadata"> & {
175
175
  data: {
176
176
  labels?: Label[];
177
+ layer?: string;
177
178
  links?: Link[];
178
179
  tags?: string[];
179
180
  workItemIds?: string[];
package/dist/reporter.js CHANGED
@@ -406,6 +406,9 @@ class TmsCypress {
406
406
  if (data.labels?.length) {
407
407
  current.labels.push(...data.labels);
408
408
  }
409
+ if (data.layer) {
410
+ current.layer = data.layer;
411
+ }
409
412
  if (data.tags?.length) {
410
413
  current.tags.push(...data.tags);
411
414
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "testit-adapter-cypress",
3
- "version": "5.0.5",
3
+ "version": "5.0.6",
4
4
  "description": "Cypress adapter for Test IT",
5
5
  "license": "Apache-2.0",
6
6
  "author": {
@@ -42,7 +42,7 @@
42
42
  "@types/node": "^20.14.2"
43
43
  },
44
44
  "dependencies": {
45
- "testit-js-commons": "5.0.5"
45
+ "testit-js-commons": "5.0.6"
46
46
  },
47
47
  "files": [
48
48
  "dist"