@serenity-js/cucumber 2.32.7 → 2.33.2
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
|
@@ -3,6 +3,36 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [2.33.2](https://github.com/serenity-js/serenity-js/compare/v2.33.1...v2.33.2) (2022-02-23)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @serenity-js/cucumber
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [2.33.1](https://github.com/serenity-js/serenity-js/compare/v2.33.0...v2.33.1) (2022-02-10)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
|
|
19
|
+
* **deps:** update dependency tiny-types to ^1.17.0 ([7b7d6fd](https://github.com/serenity-js/serenity-js/commit/7b7d6fda08f5db7199d8608ff4cf1389a6e84d3c))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
# [2.33.0](https://github.com/serenity-js/serenity-js/compare/v2.32.7...v2.33.0) (2022-02-03)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
### Features
|
|
29
|
+
|
|
30
|
+
* **cucumber:** support for executing individual scenarios given line number they're on ([d6804f9](https://github.com/serenity-js/serenity-js/commit/d6804f9d61f574243296ddc2befef321a3018ae4)), closes [cucumber/cucumber-js#1900](https://github.com/cucumber/cucumber-js/issues/1900) [protractor-cucumber-framework/protractor-cucumber-framework#238](https://github.com/protractor-cucumber-framework/protractor-cucumber-framework/issues/238)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
6
36
|
## [2.32.7](https://github.com/serenity-js/serenity-js/compare/v2.32.6...v2.32.7) (2022-01-10)
|
|
7
37
|
|
|
8
38
|
|
|
@@ -4,6 +4,7 @@ exports.CucumberCLIAdapter = void 0;
|
|
|
4
4
|
/* istanbul ignore file covered in integration tests */
|
|
5
5
|
const io_1 = require("@serenity-js/core/lib/io");
|
|
6
6
|
const model_1 = require("@serenity-js/core/lib/model");
|
|
7
|
+
const path = require("path"); // eslint-disable-line unicorn/import-style
|
|
7
8
|
const CucumberOptions_1 = require("./CucumberOptions");
|
|
8
9
|
/**
|
|
9
10
|
* @desc
|
|
@@ -46,9 +47,14 @@ class CucumberCLIAdapter {
|
|
|
46
47
|
* @returns {Promise<void>}
|
|
47
48
|
*/
|
|
48
49
|
async load(pathsToScenarios) {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
this.pathsToScenarios = pathsToScenarios.map(maybeAbsolutePathToScenario => {
|
|
51
|
+
// Ensure paths provided to Cucumber are relative
|
|
52
|
+
// see https://github.com/cucumber/cucumber-js/issues/1900
|
|
53
|
+
return path.isAbsolute(maybeAbsolutePathToScenario)
|
|
54
|
+
? path.relative(this.loader.cwd, maybeAbsolutePathToScenario)
|
|
55
|
+
: maybeAbsolutePathToScenario;
|
|
56
|
+
});
|
|
57
|
+
// todo: implement loading, so parsing feature files to determine how many executable we have
|
|
52
58
|
}
|
|
53
59
|
/**
|
|
54
60
|
* @desc
|
|
@@ -60,8 +66,9 @@ class CucumberCLIAdapter {
|
|
|
60
66
|
* @returns {number}
|
|
61
67
|
*/
|
|
62
68
|
scenarioCount() {
|
|
63
|
-
// todo:
|
|
64
|
-
|
|
69
|
+
// todo: we should count the actual executable scenarios to avoid launching a WebdriverIO worked
|
|
70
|
+
// for a feature file without any scenarios.
|
|
71
|
+
return this.pathsToScenarios.length;
|
|
65
72
|
// if (this.totalScenarios === undefined) {
|
|
66
73
|
// throw new LogicError('Make sure to call `load` before calling `scenarioCount`');
|
|
67
74
|
// }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CucumberCLIAdapter.js","sourceRoot":"","sources":["../../src/cli/CucumberCLIAdapter.ts"],"names":[],"mappings":";;;AAAA,uDAAuD;AACvD,iDAAgG;AAChG,uDAA+F;
|
|
1
|
+
{"version":3,"file":"CucumberCLIAdapter.js","sourceRoot":"","sources":["../../src/cli/CucumberCLIAdapter.ts"],"names":[],"mappings":";;;AAAA,uDAAuD;AACvD,iDAAgG;AAChG,uDAA+F;AAC/F,6BAA6B,CAAG,2CAA2C;AAG3E,uDAAoD;AAGpD;;;;;GAKG;AACH,MAAa,kBAAkB;IAM3B;;;;;;OAMG;IACH,YACI,MAAsB,EACL,MAAoB,EACrC,UAAsB,EACL,MAA+B;QAF/B,WAAM,GAAN,MAAM,CAAc;QAEpB,WAAM,GAAN,MAAM,CAAyB;QAf5C,qBAAgB,GAAa,EAAE,CAAC;QAiBpC,IAAI,CAAC,OAAO,GAAG,IAAI,iCAAe,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;IAC3D,CAAC;IAED;;;;;OAKG;IACH,gBAAgB;QACZ,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE;YAC1B,CAAC,CAAC,wBAAgB;YAClB,CAAC,CAAC,6BAAqB,CAAC;IAChC,CAAC;IAED;;;;;;;;OAQG;IACH,KAAK,CAAC,IAAI,CAAC,gBAA0B;QACjC,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAC,GAAG,CAAC,2BAA2B,CAAC,EAAE;YACvE,iDAAiD;YACjD,0DAA0D;YAC1D,OAAO,IAAI,CAAC,UAAU,CAAC,2BAA2B,CAAC;gBAC/C,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,2BAA2B,CAAC;gBAC7D,CAAC,CAAC,2BAA2B,CAAC;QACtC,CAAC,CAAC,CAAC;QAEH,6FAA6F;IACjG,CAAC;IAED;;;;;;;;OAQG;IACH,aAAa;QACT,gGAAgG;QAChG,6CAA6C;QAC7C,OAAO,I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CAAC,EAAE;YACd,MAAM,KAAK,CAAC;QAChB,CAAC,CAAC,CAAC;IACX,CAAC,CAAA;AACL,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@serenity-js/cucumber",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.33.2",
|
|
4
4
|
"description": "Serenity/JS adapter for Cucumber test runners version 1.x - 7.x",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Jan Molak",
|
|
@@ -46,11 +46,11 @@
|
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"@cucumber/messages": "^16.0.1",
|
|
49
|
-
"@serenity-js/core": "2.
|
|
49
|
+
"@serenity-js/core": "2.33.2",
|
|
50
50
|
"cli-table3": "^0.6.1",
|
|
51
51
|
"colors": "1.4.0",
|
|
52
52
|
"gherkin": "5.1.0",
|
|
53
|
-
"tiny-types": "^1.
|
|
53
|
+
"tiny-types": "^1.17.0"
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
|
56
56
|
"@cucumber/cucumber": "^7.3.2",
|
|
@@ -69,10 +69,10 @@
|
|
|
69
69
|
"@documentation/esdoc-template": "2.0.0",
|
|
70
70
|
"@integration/testing-tools": "2.0.0",
|
|
71
71
|
"@types/chai": "^4.3.0",
|
|
72
|
-
"@types/mocha": "^9.
|
|
73
|
-
"mocha": "^9.1
|
|
74
|
-
"ts-node": "^10.
|
|
75
|
-
"typescript": "^4.5.
|
|
72
|
+
"@types/mocha": "^9.1.0",
|
|
73
|
+
"mocha": "^9.2.1",
|
|
74
|
+
"ts-node": "^10.5.0",
|
|
75
|
+
"typescript": "^4.5.5"
|
|
76
76
|
},
|
|
77
77
|
"nyc": {
|
|
78
78
|
"include": [
|
|
@@ -97,5 +97,5 @@
|
|
|
97
97
|
"cache": true,
|
|
98
98
|
"all": true
|
|
99
99
|
},
|
|
100
|
-
"gitHead": "
|
|
100
|
+
"gitHead": "20c20c4d1322376f50510e14a97114b96747f9ac"
|
|
101
101
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/* istanbul ignore file covered in integration tests */
|
|
2
2
|
import { FileSystem, ModuleLoader, TestRunnerAdapter, Version } from '@serenity-js/core/lib/io';
|
|
3
3
|
import { ExecutionIgnored, ImplementationPending, Outcome } from '@serenity-js/core/lib/model';
|
|
4
|
+
import * as path from 'path'; // eslint-disable-line unicorn/import-style
|
|
4
5
|
|
|
5
6
|
import { CucumberConfig } from './CucumberConfig';
|
|
6
7
|
import { CucumberOptions } from './CucumberOptions';
|
|
@@ -56,10 +57,15 @@ export class CucumberCLIAdapter implements TestRunnerAdapter {
|
|
|
56
57
|
* @returns {Promise<void>}
|
|
57
58
|
*/
|
|
58
59
|
async load(pathsToScenarios: string[]): Promise<void> {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
60
|
+
this.pathsToScenarios = pathsToScenarios.map(maybeAbsolutePathToScenario => {
|
|
61
|
+
// Ensure paths provided to Cucumber are relative
|
|
62
|
+
// see https://github.com/cucumber/cucumber-js/issues/1900
|
|
63
|
+
return path.isAbsolute(maybeAbsolutePathToScenario)
|
|
64
|
+
? path.relative(this.loader.cwd, maybeAbsolutePathToScenario)
|
|
65
|
+
: maybeAbsolutePathToScenario;
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
// todo: implement loading, so parsing feature files to determine how many executable we have
|
|
63
69
|
}
|
|
64
70
|
|
|
65
71
|
/**
|
|
@@ -72,8 +78,9 @@ export class CucumberCLIAdapter implements TestRunnerAdapter {
|
|
|
72
78
|
* @returns {number}
|
|
73
79
|
*/
|
|
74
80
|
scenarioCount(): number {
|
|
75
|
-
// todo:
|
|
76
|
-
|
|
81
|
+
// todo: we should count the actual executable scenarios to avoid launching a WebdriverIO worked
|
|
82
|
+
// for a feature file without any scenarios.
|
|
83
|
+
return this.pathsToScenarios.length;
|
|
77
84
|
|
|
78
85
|
// if (this.totalScenarios === undefined) {
|
|
79
86
|
// throw new LogicError('Make sure to call `load` before calling `scenarioCount`');
|