@qavajs/cypress-runner-adapter 1.6.0 → 1.8.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 CHANGED
@@ -14,6 +14,11 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how
14
14
 
15
15
  :microscope: - experimental
16
16
 
17
+ ## [1.8.0]
18
+ - :rocket: added `testCaseStartedId` and `testStepId` as hooks parameters to comply cucumber spec
19
+
20
+ ## [1.7.0]
21
+ - :rocket: updated @cucumber/cucumber-expressions, @cucumber/gherkin, @cucumber/tag-expressions
17
22
 
18
23
  ## [1.6.0]
19
24
  - :rocket: updated logs for Gherkin steps
@@ -94,7 +94,9 @@ module.exports = function makeMochaTest(tests) {
94
94
  status,
95
95
  exception,
96
96
  message
97
- }
97
+ },
98
+ testCaseStartedId: test.id,
99
+ testStepId: this.step.id,
98
100
  }]);
99
101
  }
100
102
  }
@@ -109,7 +111,8 @@ module.exports = function makeMochaTest(tests) {
109
111
  beforeTest.code.apply(world, [{
110
112
  pickle: test,
111
113
  gherkinDocument: tests,
112
- willBeRetried: false
114
+ willBeRetried: false,
115
+ testCaseStartedId: test.id
113
116
  }]);
114
117
  });
115
118
  }
@@ -124,7 +127,9 @@ module.exports = function makeMochaTest(tests) {
124
127
  beforeStep.code.apply(world, [{
125
128
  pickle: test,
126
129
  pickleStep: step,
127
- gherkinDocument: tests
130
+ gherkinDocument: tests,
131
+ testCaseStartedId: test.id,
132
+ testStepId: this.step.id,
128
133
  }]);
129
134
  }
130
135
  }
@@ -145,7 +150,8 @@ module.exports = function makeMochaTest(tests) {
145
150
  message
146
151
  },
147
152
  gherkinDocument: tests,
148
- willBeRetried: false
153
+ willBeRetried: false,
154
+ testCaseStartedId: test.id,
149
155
  }]);
150
156
  });
151
157
  }
@@ -39,8 +39,8 @@ module.exports = function makeMochaTest(tests) {
39
39
  if (steps.length === 0) throw new Error(`Step '${text}' is not defined`);
40
40
  if (steps.length > 1) throw new Error(`Step '${text}' matches multiple step definitions`);
41
41
  const [step] = steps;
42
- const {parameters} = step.getInvocationParameters({
43
- step: {text, argument},
42
+ const { parameters } = step.getInvocationParameters({
43
+ step: { text, argument },
44
44
  world: this
45
45
  });
46
46
  step.code.apply(this, parameters);
@@ -49,10 +49,10 @@ module.exports = function makeMochaTest(tests) {
49
49
  function executeStep(pickle, world) {
50
50
  cy.then(() => {
51
51
  if (pickle.argument && pickle.argument.dataTable) {
52
- Cypress.log({displayName: 'DataTable', message: pickle.argument.dataTable});
52
+ Cypress.log({ displayName: 'DataTable', message: pickle.argument.dataTable });
53
53
  }
54
54
  if (pickle.argument && pickle.argument.docString) {
55
- Cypress.log({displayName: 'Multiline', message: pickle.argument.docString.content});
55
+ Cypress.log({ displayName: 'Multiline', message: pickle.argument.docString.content });
56
56
  }
57
57
  });
58
58
  executeStepByText.call(world, pickle.text, pickle.argument);
@@ -62,7 +62,7 @@ module.exports = function makeMochaTest(tests) {
62
62
 
63
63
  function runStep(name, callback) {
64
64
  cy.then(() => {
65
- Cypress.log({displayName: name, message: ''});
65
+ Cypress.log({ displayName: name, message: '' });
66
66
  })
67
67
  callback();
68
68
  }
@@ -98,7 +98,8 @@ module.exports = function makeMochaTest(tests) {
98
98
  beforeTest.code.apply(world, [{
99
99
  pickle: test,
100
100
  gherkinDocument: tests,
101
- willBeRetried: false
101
+ willBeRetried: false,
102
+ testCaseStartedId: test.id
102
103
  }]);
103
104
  });
104
105
  }
@@ -117,6 +118,8 @@ module.exports = function makeMochaTest(tests) {
117
118
  pickle: test,
118
119
  pickleStep: this.step,
119
120
  gherkinDocument: tests,
121
+ testCaseStartedId: test.id,
122
+ testStepId: this.step.id,
120
123
  result
121
124
  }]);
122
125
  }
@@ -129,6 +132,7 @@ module.exports = function makeMochaTest(tests) {
129
132
  pickle: test,
130
133
  result,
131
134
  gherkinDocument: tests,
135
+ testCaseStartedId: test.id,
132
136
  willBeRetried: false
133
137
  }]);
134
138
  });
@@ -143,13 +147,16 @@ module.exports = function makeMochaTest(tests) {
143
147
  const stepName = `${keyword(step)} ${stepNameText(step)}`;
144
148
  runStep(stepName, function () {
145
149
  this.step = step;
146
- const result = {status: 'passed', duration: 0};
150
+ const result = { status: 'passed', duration: 0 };
147
151
  for (const beforeStep of supportCodeLibrary.beforeTestStepHookDefinitions) {
148
152
  if (beforeStep.appliesToTestCase(step)) {
149
153
  beforeStep.code.apply(world, [{
150
154
  pickle: test,
151
155
  pickleStep: step,
152
- gherkinDocument: tests
156
+ gherkinDocument: tests,
157
+ willBeRetried: false,
158
+ testCaseStartedId: test.id,
159
+ testStepId: step.id
153
160
  }]);
154
161
  }
155
162
  }
@@ -160,7 +167,10 @@ module.exports = function makeMochaTest(tests) {
160
167
  pickle: test,
161
168
  pickleStep: this.step,
162
169
  gherkinDocument: tests,
163
- result
170
+ result,
171
+ willBeRetried: false,
172
+ testCaseStartedId: test.id,
173
+ testStepId: step.id
164
174
  }]);
165
175
  }
166
176
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qavajs/cypress-runner-adapter",
3
- "version": "1.6.0",
3
+ "version": "1.8.0",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "debug": "cypress open --config-file test/cypress.config.js",
@@ -22,14 +22,14 @@
22
22
  },
23
23
  "homepage": "https://qavajs.github.io/docs/intro",
24
24
  "dependencies": {
25
- "@cucumber/cucumber-expressions": "^18.0.1",
26
- "@cucumber/gherkin": "^37.0.1",
27
- "@cucumber/tag-expressions": "^8.1.0",
25
+ "@cucumber/cucumber-expressions": "^19.0.0",
26
+ "@cucumber/gherkin": "^39.0.0",
27
+ "@cucumber/tag-expressions": "^9.1.0",
28
28
  "@cypress/webpack-preprocessor": "^7.0.2",
29
29
  "fs-extra": "^11.3.3"
30
30
  },
31
31
  "devDependencies": {
32
- "cypress": "^15.9.0",
32
+ "cypress": "^15.11.0",
33
33
  "mochawesome": "^7.1.4"
34
34
  },
35
35
  "keywords": [