@qavajs/cypress-runner-adapter 1.8.0 → 1.9.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,9 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how
14
14
 
15
15
  :microscope: - experimental
16
16
 
17
+ ## [1.9.0]
18
+ - :rocket: added step log groups for `it` mode
19
+
17
20
  ## [1.8.0]
18
21
  - :rocket: added `testCaseStartedId` and `testStepId` as hooks parameters to comply cucumber spec
19
22
 
@@ -60,11 +60,22 @@ module.exports = function makeMochaTest(tests) {
60
60
 
61
61
  supportCodeLibrary.World.prototype.executeStep = executeStepByText;
62
62
 
63
- function runStep(name, callback) {
63
+ function runStep({ keyword, name }, callback) {
64
+ const displayName = keyword ? keyword : name;
65
+ const message = keyword && name ? name : '';
66
+ let group;
64
67
  cy.then(() => {
65
- Cypress.log({ displayName: name, message: '' });
66
- })
68
+ group = Cypress.log({
69
+ name,
70
+ displayName,
71
+ message,
72
+ groupStart: true,
73
+ });
74
+ });
67
75
  callback();
76
+ cy.then(() => {
77
+ group.endGroup();
78
+ });
68
79
  }
69
80
 
70
81
  function findTest(tests, name) {
@@ -94,7 +105,7 @@ module.exports = function makeMochaTest(tests) {
94
105
  });
95
106
  for (const beforeTest of supportCodeLibrary.beforeTestCaseHookDefinitions) {
96
107
  if (beforeTest.appliesToTestCase(test)) {
97
- runStep(beforeTest.name, function () {
108
+ runStep({ name: beforeTest.name }, function () {
98
109
  beforeTest.code.apply(world, [{
99
110
  pickle: test,
100
111
  gherkinDocument: tests,
@@ -127,7 +138,7 @@ module.exports = function makeMochaTest(tests) {
127
138
  }
128
139
  for (const afterTest of supportCodeLibrary.afterTestCaseHookDefinitions) {
129
140
  if (afterTest.appliesToTestCase(test)) {
130
- runStep(afterTest.name, function () {
141
+ runStep({ name: afterTest.name }, function () {
131
142
  afterTest.code.apply(world, [{
132
143
  pickle: test,
133
144
  result,
@@ -144,8 +155,7 @@ module.exports = function makeMochaTest(tests) {
144
155
  it('Scenario: ' + test.name, function () {
145
156
  const world = this.world;
146
157
  for (const step of test.steps) {
147
- const stepName = `${keyword(step)} ${stepNameText(step)}`;
148
- runStep(stepName, function () {
158
+ runStep({ keyword: keyword(step), name: stepNameText(step) }, function () {
149
159
  this.step = step;
150
160
  const result = { status: 'passed', duration: 0 };
151
161
  for (const beforeStep of supportCodeLibrary.beforeTestStepHookDefinitions) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qavajs/cypress-runner-adapter",
3
- "version": "1.8.0",
3
+ "version": "1.9.0",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "debug": "cypress open --config-file test/cypress.config.js",
@@ -26,7 +26,7 @@
26
26
  "@cucumber/gherkin": "^39.0.0",
27
27
  "@cucumber/tag-expressions": "^9.1.0",
28
28
  "@cypress/webpack-preprocessor": "^7.0.2",
29
- "fs-extra": "^11.3.3"
29
+ "fs-extra": "^11.3.4"
30
30
  },
31
31
  "devDependencies": {
32
32
  "cypress": "^15.11.0",