@dev-blinq/cucumber-js 1.0.133-dev → 1.0.133
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/bin/cucumber.ts +1 -0
- package/bin/download-install.js +22 -2
- package/lib/api/console_logger.js.map +1 -1
- package/lib/cli/run.js +1 -0
- package/lib/cli/run.js.map +1 -1
- package/lib/cli/validate_node_engine_version.js +3 -1
- package/lib/cli/validate_node_engine_version.js.map +1 -1
- package/lib/configuration/axios_client.js +1 -1
- package/lib/configuration/axios_client.js.map +1 -1
- package/lib/formatter/api.js +16 -5
- package/lib/formatter/api.js.map +1 -1
- package/lib/formatter/builder.js +1 -3
- package/lib/formatter/builder.js.map +1 -1
- package/lib/formatter/bvt_analysis_formatter.d.ts +14 -1
- package/lib/formatter/bvt_analysis_formatter.js +207 -57
- package/lib/formatter/bvt_analysis_formatter.js.map +1 -1
- package/lib/formatter/feature_data_format.js +22 -8
- package/lib/formatter/feature_data_format.js.map +1 -1
- package/lib/formatter/helpers/constants.d.ts +50 -0
- package/lib/formatter/helpers/constants.js +60 -0
- package/lib/formatter/helpers/constants.js.map +1 -0
- package/lib/formatter/helpers/report_generator.d.ts +20 -2
- package/lib/formatter/helpers/report_generator.js +279 -23
- package/lib/formatter/helpers/report_generator.js.map +1 -1
- package/lib/formatter/helpers/test_case_attempt_parser.js.map +1 -1
- package/lib/formatter/helpers/upload_serivce.d.ts +22 -2
- package/lib/formatter/helpers/upload_serivce.js +214 -34
- package/lib/formatter/helpers/upload_serivce.js.map +1 -1
- package/lib/formatter/helpers/uploader.js +6 -2
- package/lib/formatter/helpers/uploader.js.map +1 -1
- package/lib/formatter/progress_formatter.d.ts +2 -1
- package/lib/formatter/progress_formatter.js.map +1 -1
- package/lib/formatter/snippets_formatter.js.map +1 -1
- package/lib/formatter/summary_formatter.js +4 -0
- package/lib/formatter/summary_formatter.js.map +1 -1
- package/lib/formatter/usage_formatter.js.map +1 -1
- package/lib/formatter/usage_json_formatter.js.map +1 -1
- package/lib/pickle_filter.d.ts +3 -2
- package/lib/pickle_filter.js.map +1 -1
- package/lib/runtime/test_case_runner.d.ts +2 -0
- package/lib/runtime/test_case_runner.js +17 -1
- package/lib/runtime/test_case_runner.js.map +1 -1
- package/lib/uncaught_exception_manager.d.ts +1 -1
- package/lib/uncaught_exception_manager.js.map +1 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/lib/version.js.map +1 -1
- package/package.json +7 -3
package/bin/cucumber.ts
CHANGED
package/bin/download-install.js
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-var-requires */
|
|
2
|
+
/* eslint-disable no-console */
|
|
3
|
+
/* eslint-disable no-undef */
|
|
1
4
|
const { argv } = require('node:process')
|
|
2
5
|
const fs = require('fs')
|
|
3
6
|
const path = require('path')
|
|
@@ -16,8 +19,14 @@ const getSSoUrl = () => {
|
|
|
16
19
|
return 'https://dev.api.blinq.io/api/auth'
|
|
17
20
|
case 'stage':
|
|
18
21
|
return 'https://stage.api.blinq.io/api/auth'
|
|
19
|
-
|
|
22
|
+
case 'prod':
|
|
23
|
+
return 'https://api.blinq.io/api/auth'
|
|
24
|
+
case null:
|
|
25
|
+
return 'https://api.blinq.io/api/auth'
|
|
26
|
+
case undefined:
|
|
20
27
|
return 'https://api.blinq.io/api/auth'
|
|
28
|
+
default:
|
|
29
|
+
return `${process.env.NODE_ENV_BLINQ}/api/auth`
|
|
21
30
|
}
|
|
22
31
|
}
|
|
23
32
|
|
|
@@ -48,8 +57,14 @@ const getWorkSpaceUrl = () => {
|
|
|
48
57
|
return 'https://dev.api.blinq.io/api/workspace'
|
|
49
58
|
case "stage":
|
|
50
59
|
return 'https://stage.api.blinq.io/api/workspace'
|
|
51
|
-
|
|
60
|
+
case 'prod':
|
|
61
|
+
return 'https://api.blinq.io/api/workspace'
|
|
62
|
+
case null:
|
|
52
63
|
return 'https://api.blinq.io/api/workspace'
|
|
64
|
+
case undefined:
|
|
65
|
+
return 'https://api.blinq.io/api/workspace'
|
|
66
|
+
default:
|
|
67
|
+
return `${process.env.NODE_ENV_BLINQ}/api/workspace`
|
|
53
68
|
}
|
|
54
69
|
}
|
|
55
70
|
|
|
@@ -137,6 +152,11 @@ const downloadAndInstall = async (extractPath, token) => {
|
|
|
137
152
|
},
|
|
138
153
|
})
|
|
139
154
|
|
|
155
|
+
if (res.status !== 200) {
|
|
156
|
+
console.error('Error: Unable to fetch workspace')
|
|
157
|
+
process.exit(1)
|
|
158
|
+
}
|
|
159
|
+
|
|
140
160
|
const zip = await JSZip.loadAsync(res.data)
|
|
141
161
|
for (const filename of Object.keys(zip.files)) {
|
|
142
162
|
const fileData = zip.files[filename]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"console_logger.js","sourceRoot":"","sources":["../../src/api/console_logger.ts"],"names":[],"mappings":";;;AAAA,qCAAiC;AAIjC,MAAa,aAAa;IAExB,
|
|
1
|
+
{"version":3,"file":"console_logger.js","sourceRoot":"","sources":["../../src/api/console_logger.ts"],"names":[],"mappings":";;;AAAA,qCAAiC;AAIjC,MAAa,aAAa;IAExB,YACU,MAAgB,EAChB,YAAqB;QADrB,WAAM,GAAN,MAAM,CAAU;QAChB,iBAAY,GAAZ,YAAY,CAAS;QAHvB,YAAO,GAAY,IAAI,iBAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;IAIhD,CAAC;IAEJ,KAAK,CAAC,GAAG,OAAc;QACrB,IAAI,IAAI,CAAC,YAAY,EAAE;YACrB,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC,CAAA;SAC/B;IACH,CAAC;IAED,KAAK,CAAC,GAAG,OAAc;QACrB,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC,CAAA;IAChC,CAAC;IAED,IAAI,CAAC,GAAG,OAAc;QACpB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,CAAA;IAC/B,CAAC;CACF;AApBD,sCAoBC","sourcesContent":["import { Console } from 'console'\nimport { Writable } from 'stream'\nimport { ILogger } from '../logger'\n\nexport class ConsoleLogger implements ILogger {\n private console: Console = new Console(this.stream)\n constructor(\n private stream: Writable,\n private debugEnabled: boolean\n ) {}\n\n debug(...content: any[]): void {\n if (this.debugEnabled) {\n this.console.debug(...content)\n }\n }\n\n error(...content: any[]): void {\n this.console.error(...content)\n }\n\n warn(...content: any[]): void {\n this.console.warn(...content)\n }\n}\n"]}
|
package/lib/cli/run.js
CHANGED
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
/* eslint-disable no-console */
|
|
7
7
|
/* This is one rare place where we're fine to use process/console directly,
|
|
8
8
|
* but other code abstracts those to remain composable and testable. */
|
|
9
|
+
console.log('Loading necessary packages...');
|
|
9
10
|
const _1 = __importDefault(require("./"));
|
|
10
11
|
const verror_1 = __importDefault(require("verror"));
|
|
11
12
|
const validate_node_engine_version_1 = require("./validate_node_engine_version");
|
package/lib/cli/run.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run.js","sourceRoot":"","sources":["../../src/cli/run.ts"],"names":[],"mappings":";;;;;AAAA,+BAA+B;AAC/B;uEACuE;AACvE,0CAAuC;AACvC,oDAA2B;AAC3B,iFAA0E;AAE1E,SAAS,sBAAsB,CAAC,OAAe;IAC7C,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;IACtB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;AACjB,CAAC;AAEc,KAAK,UAAU,GAAG;IAC/B,IAAA,wDAAyB,EACvB,OAAO,CAAC,OAAO,EACf,CAAC,KAAK,EAAE,EAAE;QACR,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;QACpB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IACjB,CAAC,EACD,OAAO,CAAC,IAAI,CACb,CAAA;IAED,MAAM,GAAG,GAAG,IAAI,UAAG,CAAC;QAClB,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE;QAClB,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,GAAG,EAAE,OAAO,CAAC,GAAG;KACjB,CAAC,CAAA;IAEF,IAAI,MAAqB,CAAA;IACzB,IAAI;QACF,MAAM,GAAG,MAAM,GAAG,CAAC,GAAG,EAAE,CAAA;KACzB;IAAC,OAAO,KAAK,EAAE;QACd,sBAAsB,CAAC,gBAAM,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAA;KAChD;IAED,MAAM,QAAQ,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;IACvC,IAAI,MAAM,CAAC,qBAAqB,EAAE;QAChC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;KACvB;SAAM;QACL,OAAO,CAAC,QAAQ,GAAG,QAAQ,CAAA;KAC5B;AACH,CAAC;AA/BD,sBA+BC","sourcesContent":["/* eslint-disable no-console */\n/* This is one rare place where we're fine to use process/console directly,\n * but other code abstracts those to remain composable and testable. */\nimport Cli, { ICliRunResult } from './'\nimport VError from 'verror'\nimport { validateNodeEngineVersion } from './validate_node_engine_version'\n\nfunction logErrorMessageAndExit(message: string): void {\n console.error(message)\n process.exit(1)\n}\n\nexport default async function run(): Promise<void> {\n validateNodeEngineVersion(\n process.version,\n (error) => {\n console.error(error)\n process.exit(1)\n },\n console.warn\n )\n\n const cli = new Cli({\n argv: process.argv,\n cwd: process.cwd(),\n stdout: process.stdout,\n stderr: process.stderr,\n env: process.env,\n })\n\n let result: ICliRunResult\n try {\n result = await cli.run()\n } catch (error) {\n logErrorMessageAndExit(VError.fullStack(error))\n }\n\n const exitCode = result.success ? 0 : 1\n if (result.shouldExitImmediately) {\n process.exit(exitCode)\n } else {\n process.exitCode = exitCode\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"run.js","sourceRoot":"","sources":["../../src/cli/run.ts"],"names":[],"mappings":";;;;;AAAA,+BAA+B;AAC/B;uEACuE;AACvE,OAAO,CAAC,GAAG,CAAC,+BAA+B,CAAC,CAAA;AAC5C,0CAAuC;AACvC,oDAA2B;AAC3B,iFAA0E;AAE1E,SAAS,sBAAsB,CAAC,OAAe;IAC7C,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;IACtB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;AACjB,CAAC;AAEc,KAAK,UAAU,GAAG;IAC/B,IAAA,wDAAyB,EACvB,OAAO,CAAC,OAAO,EACf,CAAC,KAAK,EAAE,EAAE;QACR,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;QACpB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IACjB,CAAC,EACD,OAAO,CAAC,IAAI,CACb,CAAA;IAED,MAAM,GAAG,GAAG,IAAI,UAAG,CAAC;QAClB,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE;QAClB,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,GAAG,EAAE,OAAO,CAAC,GAAG;KACjB,CAAC,CAAA;IAEF,IAAI,MAAqB,CAAA;IACzB,IAAI;QACF,MAAM,GAAG,MAAM,GAAG,CAAC,GAAG,EAAE,CAAA;KACzB;IAAC,OAAO,KAAK,EAAE;QACd,sBAAsB,CAAC,gBAAM,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAA;KAChD;IAED,MAAM,QAAQ,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;IACvC,IAAI,MAAM,CAAC,qBAAqB,EAAE;QAChC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;KACvB;SAAM;QACL,OAAO,CAAC,QAAQ,GAAG,QAAQ,CAAA;KAC5B;AACH,CAAC;AA/BD,sBA+BC","sourcesContent":["/* eslint-disable no-console */\n/* This is one rare place where we're fine to use process/console directly,\n * but other code abstracts those to remain composable and testable. */\nconsole.log('Loading necessary packages...')\nimport Cli, { ICliRunResult } from './'\nimport VError from 'verror'\nimport { validateNodeEngineVersion } from './validate_node_engine_version'\n\nfunction logErrorMessageAndExit(message: string): void {\n console.error(message)\n process.exit(1)\n}\n\nexport default async function run(): Promise<void> {\n validateNodeEngineVersion(\n process.version,\n (error) => {\n console.error(error)\n process.exit(1)\n },\n console.warn\n )\n\n const cli = new Cli({\n argv: process.argv,\n cwd: process.cwd(),\n stdout: process.stdout,\n stderr: process.stderr,\n env: process.env,\n })\n\n let result: ICliRunResult\n try {\n result = await cli.run()\n } catch (error) {\n logErrorMessageAndExit(VError.fullStack(error))\n }\n\n const exitCode = result.success ? 0 : 1\n if (result.shouldExitImmediately) {\n process.exit(exitCode)\n } else {\n process.exitCode = exitCode\n }\n}\n"]}
|
|
@@ -17,7 +17,9 @@ function validateNodeEngineVersion(currentVersion, onError, onWarning, readPacka
|
|
|
17
17
|
onError(`Cucumber can only run on Node.js versions ${requiredVersions}. This Node.js version is ${currentVersion}`);
|
|
18
18
|
}
|
|
19
19
|
else if (!semver_1.default.satisfies(currentVersion, testedVersions)) {
|
|
20
|
-
onWarning(
|
|
20
|
+
// onWarning(
|
|
21
|
+
// `This Node.js version (${currentVersion}) has not been tested with this version of Cucumber; it should work normally, but please raise an issue if you see anything unexpected.`
|
|
22
|
+
// )
|
|
21
23
|
}
|
|
22
24
|
}
|
|
23
25
|
exports.validateNodeEngineVersion = validateNodeEngineVersion;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate_node_engine_version.js","sourceRoot":"","sources":["../../src/cli/validate_node_engine_version.ts"],"names":[],"mappings":";;;;;;AAAA,4CAAmB;AACnB,gDAAuB;AACvB,oDAA2B;AAO3B,MAAM,qBAAqB,GAAsB,GAAG,EAAE,CACpD,IAAI,CAAC,KAAK,CACR,YAAE;KACC,YAAY,CAAC,cAAI,CAAC,OAAO,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,cAAc,CAAC,CAAC;KACjE,QAAQ,EAAE,CACd,CAAA;AAEH,SAAgB,yBAAyB,CACvC,cAAsB,EACtB,OAAkC,EAClC,SAAoC,EACpC,kBAAqC,qBAAqB;IAE1D,MAAM,gBAAgB,GAAG,eAAe,EAAE,CAAC,OAAO,CAAC,IAAI,CAAA;IACvD,MAAM,cAAc,GAAG,eAAe,EAAE,CAAC,aAAa,CAAC,IAAI,CAAA;IAC3D,IAAI,CAAC,gBAAM,CAAC,SAAS,CAAC,cAAc,EAAE,gBAAgB,CAAC,EAAE;QACvD,OAAO,CACL,6CAA6C,gBAAgB,6BAA6B,cAAc,EAAE,CAC3G,CAAA;KACF;SAAM,IAAI,CAAC,gBAAM,CAAC,SAAS,CAAC,cAAc,EAAE,cAAc,CAAC,EAAE;QAC5D,
|
|
1
|
+
{"version":3,"file":"validate_node_engine_version.js","sourceRoot":"","sources":["../../src/cli/validate_node_engine_version.ts"],"names":[],"mappings":";;;;;;AAAA,4CAAmB;AACnB,gDAAuB;AACvB,oDAA2B;AAO3B,MAAM,qBAAqB,GAAsB,GAAG,EAAE,CACpD,IAAI,CAAC,KAAK,CACR,YAAE;KACC,YAAY,CAAC,cAAI,CAAC,OAAO,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,cAAc,CAAC,CAAC;KACjE,QAAQ,EAAE,CACd,CAAA;AAEH,SAAgB,yBAAyB,CACvC,cAAsB,EACtB,OAAkC,EAClC,SAAoC,EACpC,kBAAqC,qBAAqB;IAE1D,MAAM,gBAAgB,GAAG,eAAe,EAAE,CAAC,OAAO,CAAC,IAAI,CAAA;IACvD,MAAM,cAAc,GAAG,eAAe,EAAE,CAAC,aAAa,CAAC,IAAI,CAAA;IAC3D,IAAI,CAAC,gBAAM,CAAC,SAAS,CAAC,cAAc,EAAE,gBAAgB,CAAC,EAAE;QACvD,OAAO,CACL,6CAA6C,gBAAgB,6BAA6B,cAAc,EAAE,CAC3G,CAAA;KACF;SAAM,IAAI,CAAC,gBAAM,CAAC,SAAS,CAAC,cAAc,EAAE,cAAc,CAAC,EAAE;QAC5D,aAAa;QACb,qLAAqL;QACrL,IAAI;KACL;AACH,CAAC;AAjBD,8DAiBC","sourcesContent":["import fs from 'fs'\nimport path from 'path'\nimport semver from 'semver'\n\ntype PackageJSON = {\n engines: { node: string }\n enginesTested: { node: string }\n}\n\nconst readActualPackageJSON: () => PackageJSON = () =>\n JSON.parse(\n fs\n .readFileSync(path.resolve(__dirname, '..', '..', 'package.json'))\n .toString()\n )\n\nexport function validateNodeEngineVersion(\n currentVersion: string,\n onError: (message: string) => void,\n onWarning: (message: string) => void,\n readPackageJSON: () => PackageJSON = readActualPackageJSON\n): void {\n const requiredVersions = readPackageJSON().engines.node\n const testedVersions = readPackageJSON().enginesTested.node\n if (!semver.satisfies(currentVersion, requiredVersions)) {\n onError(\n `Cucumber can only run on Node.js versions ${requiredVersions}. This Node.js version is ${currentVersion}`\n )\n } else if (!semver.satisfies(currentVersion, testedVersions)) {\n // onWarning(\n // `This Node.js version (${currentVersion}) has not been tested with this version of Cucumber; it should work normally, but please raise an issue if you see anything unexpected.`\n // )\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"axios_client.js","sourceRoot":"","sources":["../../src/configuration/axios_client.ts"],"names":[],"mappings":";;;;;;AAAA,+BAA+B;AAC/B,kDAAyB;AACzB,oDAA6C;AAG7C,MAAM,QAAQ,GAAG,GAAiB,EAAE;IAClC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE;QACtB,OAAO,IAAI,CAAA;KACZ;IAED,MAAM,KAAK,GAAkB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAA;IAC9C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AAG,QAAQ,IAAI,QAAQ,EAAE,CAAA;KAClD;IACD,OAAO,gBAAM,CAAC,aAAa,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,CAAC,CAAA;AACrD,CAAC,CAAA;AAED,MAAM,iBAAiB,GAAG,GAAG,EAAE;IAC7B,IAAI;QACF,MAAM,KAAK,GAAmB,QAAQ,EAAE,CAAA;QACxC,OAAO,eAAK,CAAC,MAAM,CAAC;YAClB,UAAU,EAAE,KAAK;YACjB,KAAK,EAAE,KAAK;SACb,CAAC,CAAA;KACH;IAAC,OAAO,KAAK,EAAE;QACd,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;QAC1B,MAAM,IAAI,KAAK,CACb,+BACE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,IAC1D,EAAE,CACH,CAAA;KACF;AACH,CAAC,CAAA;AAEY,QAAA,WAAW,GAAG,iBAAiB,EAAE,CAAA","sourcesContent":["/* eslint-disable no-console */\nimport axios from 'axios'\nimport tunnel, { ProxyOptions } from 'tunnel'\nimport { Agent } from 'http'\n\nconst getProxy = (): Agent | null => {\n if (!process.env.PROXY) {\n return null\n }\n\n const proxy: string | null = process.env.PROXY\n const url = new URL(proxy)\n const proxyObject: ProxyOptions = {\n host: url.hostname,\n port: Number(url.port),\n }\n\n const { username, password } = url\n\n if (username && password) {\n proxyObject.proxyAuth = `${username}:${password}`\n }\n return tunnel.httpsOverHttp({ proxy: proxyObject })\n}\n\nconst createAxiosClient = () => {\n try {\n const agent: string | Agent = getProxy()\n return axios.create({\n httpsAgent: agent,\n proxy: false,\n })\n } catch (error) {\n console.log(error.message)\n throw new Error(\n `Error creating axios client ${\n error instanceof Error ? error.message : error.response.data\n }`\n )\n }\n}\n\nexport const axiosClient = createAxiosClient()\n"]}
|
package/lib/formatter/api.js
CHANGED
|
@@ -4,8 +4,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.getProjectByAccessKey = void 0;
|
|
7
|
-
const axios_1 = __importDefault(require("axios"));
|
|
8
7
|
const tunnel_1 = __importDefault(require("tunnel"));
|
|
8
|
+
const axios_client_1 = require("../configuration/axios_client");
|
|
9
9
|
const getSSoUrl = () => {
|
|
10
10
|
switch (process.env.NODE_ENV_BLINQ) {
|
|
11
11
|
case 'local':
|
|
@@ -14,8 +14,14 @@ const getSSoUrl = () => {
|
|
|
14
14
|
return 'https://dev.api.blinq.io/api/auth';
|
|
15
15
|
case 'stage':
|
|
16
16
|
return 'https://stage.api.blinq.io/api/auth';
|
|
17
|
-
|
|
17
|
+
case 'prod':
|
|
18
|
+
return 'https://api.blinq.io/api/auth';
|
|
19
|
+
case null:
|
|
18
20
|
return 'https://api.blinq.io/api/auth';
|
|
21
|
+
case undefined:
|
|
22
|
+
return 'https://api.blinq.io/api/auth';
|
|
23
|
+
default:
|
|
24
|
+
return `${process.env.NODE_ENV_BLINQ}/api/auth`;
|
|
19
25
|
}
|
|
20
26
|
};
|
|
21
27
|
const getProxy = () => {
|
|
@@ -38,11 +44,16 @@ const getProxy = () => {
|
|
|
38
44
|
const getProjectByAccessKey = async (access_key) => {
|
|
39
45
|
const ssoUrl = getSSoUrl();
|
|
40
46
|
const accessKeyUrl = `${ssoUrl}/getProjectByAccessKey`;
|
|
41
|
-
const response = await
|
|
47
|
+
const response = await axios_client_1.axiosClient.post(accessKeyUrl, {
|
|
42
48
|
access_key,
|
|
43
|
-
httpAgent: getProxy(),
|
|
44
|
-
proxy: false,
|
|
45
49
|
});
|
|
50
|
+
/*
|
|
51
|
+
const response = await axios.post(accessKeyUrl, {
|
|
52
|
+
access_key,
|
|
53
|
+
httpAgent: getProxy(),
|
|
54
|
+
proxy: false,
|
|
55
|
+
})
|
|
56
|
+
*/
|
|
46
57
|
if (response.status !== 200) {
|
|
47
58
|
console.error('Error: Invalid access key');
|
|
48
59
|
process.exit(1);
|
package/lib/formatter/api.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../src/formatter/api.ts"],"names":[],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../src/formatter/api.ts"],"names":[],"mappings":";;;;;;AACA,oDAA2B;AAC3B,gEAA2D;AAE3D,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,QAAQ,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE;QAClC,KAAK,OAAO;YACV,OAAO,gCAAgC,CAAA;QACzC,KAAK,KAAK;YACR,OAAO,mCAAmC,CAAA;QAC5C,KAAK,OAAO;YACV,OAAO,qCAAqC,CAAA;QAC9C,KAAK,MAAM;YACT,OAAO,+BAA+B,CAAA;QACxC,KAAK,IAAI;YACP,OAAO,+BAA+B,CAAA;QACxC,KAAK,SAAS;YACZ,OAAO,+BAA+B,CAAA;QACxC;YACE,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,cAAc,WAAW,CAAA;KAClD;AACH,CAAC,CAAA;AACD,MAAM,QAAQ,GAAG,GAAG,EAAE;IACpB,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE;QACtB,OAAO,IAAI,CAAA;KACZ;IAED,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,KAAK,CAAA;IAC/B,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,CAAA;IAC1B,MAAM,WAAW,GAAG;QAClB,IAAI,EAAE,GAAG,CAAC,QAAQ;QAClB,IAAI,EAAE,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC;KACvB,CAAA;IAED,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,GAAG,CAAA;IAElC,IAAI,QAAQ,IAAI,QAAQ,EAAE;QACxB,YAAY;QACZ,WAAW,CAAC,SAAS,GAAG,GAAG,QAAQ,IAAI,QAAQ,EAAE,CAAA;KAClD;IACD,OAAO,gBAAM,CAAC,aAAa,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,CAAC,CAAA;AACrD,CAAC,CAAA;AAED,MAAM,qBAAqB,GAAG,KAAK,EAAE,UAAkB,EAAE,EAAE;IACzD,MAAM,MAAM,GAAG,SAAS,EAAE,CAAA;IAC1B,MAAM,YAAY,GAAG,GAAG,MAAM,wBAAwB,CAAA;IAEtD,MAAM,QAAQ,GAAG,MAAM,0BAAW,CAAC,IAAI,CAAC,YAAY,EAAE;QACpD,UAAU;KACX,CAAC,CAAA;IAEF;;;;;;MAME;IAEF,IAAI,QAAQ,CAAC,MAAM,KAAK,GAAG,EAAE;QAC3B,OAAO,CAAC,KAAK,CAAC,2BAA2B,CAAC,CAAA;QAC1C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;KAChB;IACD,OAAO,QAAQ,CAAC,IAAI,CAAA;AACtB,CAAC,CAAA;AAEQ,sDAAqB","sourcesContent":["import axios from 'axios'\nimport tunnel from 'tunnel'\nimport { axiosClient } from '../configuration/axios_client'\n\nconst getSSoUrl = () => {\n switch (process.env.NODE_ENV_BLINQ) {\n case 'local':\n return 'http://localhost:5000/api/auth'\n case 'dev':\n return 'https://dev.api.blinq.io/api/auth'\n case 'stage':\n return 'https://stage.api.blinq.io/api/auth'\n case 'prod':\n return 'https://api.blinq.io/api/auth'\n case null:\n return 'https://api.blinq.io/api/auth'\n case undefined:\n return 'https://api.blinq.io/api/auth'\n default:\n return `${process.env.NODE_ENV_BLINQ}/api/auth`\n }\n}\nconst getProxy = () => {\n if (!process.env.PROXY) {\n return null\n }\n\n const proxy = process.env.PROXY\n const url = new URL(proxy)\n const proxyObject = {\n host: url.hostname,\n port: Number(url.port),\n }\n\n const { username, password } = url\n\n if (username && password) {\n //@ts-ignore\n proxyObject.proxyAuth = `${username}:${password}`\n }\n return tunnel.httpsOverHttp({ proxy: proxyObject })\n}\n\nconst getProjectByAccessKey = async (access_key: string) => {\n const ssoUrl = getSSoUrl()\n const accessKeyUrl = `${ssoUrl}/getProjectByAccessKey`\n\n const response = await axiosClient.post(accessKeyUrl, {\n access_key,\n })\n\n /*\n const response = await axios.post(accessKeyUrl, {\n access_key,\n httpAgent: getProxy(),\n proxy: false,\n })\n */\n\n if (response.status !== 200) {\n console.error('Error: Invalid access key')\n process.exit(1)\n }\n return response.data\n}\n\nexport { getProjectByAccessKey }\n"]}
|
package/lib/formatter/builder.js
CHANGED
|
@@ -69,9 +69,7 @@ const FormatterBuilder = {
|
|
|
69
69
|
let result;
|
|
70
70
|
try {
|
|
71
71
|
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
72
|
-
result = require(typeof urlOrName === 'string'
|
|
73
|
-
? urlOrName
|
|
74
|
-
: (0, url_1.fileURLToPath)(urlOrName));
|
|
72
|
+
result = require(typeof urlOrName === 'string' ? urlOrName : (0, url_1.fileURLToPath)(urlOrName));
|
|
75
73
|
}
|
|
76
74
|
catch (error) {
|
|
77
75
|
if (error.code === 'ERR_REQUIRE_ESM') {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"builder.js","sourceRoot":"","sources":["../../src/formatter/builder.ts"],"names":[],"mappings":";;;;;AAAA,oEAAyC;AACzC,4HAAiG;AACjG,gDAAuB;AACvB,wGAA4E;AAO5E,oDAAkE;AAIlE,qFAAmF;AACnF,6BAAkD;AAClD,sEAA6C;AAC7C,8DAA8D;AAC9D,MAAM,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC,aAAa,CAAC,CAAA;AAqB3C,MAAM,gBAAgB,GAAG;IACvB,KAAK,CAAC,KAAK,CAAC,IAAY,EAAE,OAAsB;QAC9C,MAAM,oBAAoB,GAAG,MAAM,gBAAgB,CAAC,oBAAoB,CACtE,IAAI,EACJ,OAAO,CAAC,GAAG,CACZ,CAAA;QACD,MAAM,QAAQ,GAAG,IAAA,uBAAW,EAC1B,OAAO,CAAC,MAAM,EAC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AK,CAAA;aACZ;SACF;QACD,OAAO,MAAM,CAAA;IACf,CAAC;IAED,kBAAkB,CAAC,YAAiB;QAClC,IAAI,IAAA,gCAAgB,EAAC,YAAY,CAAC,EAAE;YAClC,OAAO,IAAI,CAAA;SACZ;QACD,IAAI,OAAO,YAAY,KAAK,UAAU,EAAE;YACtC,OAAO,YAAY,CAAA;SACpB;aAAM,IACL,OAAO,YAAY,KAAK,QAAQ;YAChC,OAAO,YAAY,CAAC,OAAO,KAAK,UAAU,EAC1C;YACA,OAAO,YAAY,CAAC,OAAO,CAAA;SAC5B;QACD,OAAO,IAAI,CAAA;IACb,CAAC;CACF,CAAA;AAED,kBAAe,gBAAgB,CAAA","sourcesContent":["import getColorFns from './get_color_fns'\nimport JavascriptSnippetSyntax from './step_definition_snippet_builder/javascript_snippet_syntax'\nimport path from 'path'\nimport StepDefinitionSnippetBuilder from './step_definition_snippet_builder'\nimport { ISupportCodeLibrary } from '../support_code_library_builder/types'\nimport Formatter, {\n FormatOptions,\n IFormatterCleanupFn,\n IFormatterLogFn,\n} from '.'\nimport { doesHaveValue, doesNotHaveValue } from '../value_checker'\nimport { EventEmitter } from 'events'\nimport EventDataCollector from './helpers/event_data_collector'\nimport { Writable as WritableStream } from 'stream'\nimport { SnippetInterface } from './step_definition_snippet_builder/snippet_syntax'\nimport { fileURLToPath, pathToFileURL } from 'url'\nimport Formatters from './helpers/formatters'\n// eslint-disable-next-line @typescript-eslint/no-var-requires\nconst { importer } = require('../importer')\n\ninterface IGetStepDefinitionSnippetBuilderOptions {\n cwd: string\n snippetInterface?: SnippetInterface\n snippetSyntax?: string\n supportCodeLibrary: ISupportCodeLibrary\n}\n\nexport interface IBuildOptions {\n env: NodeJS.ProcessEnv\n cwd: string\n eventBroadcaster: EventEmitter\n eventDataCollector: EventDataCollector\n log: IFormatterLogFn\n parsedArgvOptions: FormatOptions\n stream: WritableStream\n cleanup: IFormatterCleanupFn\n supportCodeLibrary: ISupportCodeLibrary\n}\n\nconst FormatterBuilder = {\n async build(type: string, options: IBuildOptions): Promise<Formatter> {\n const FormatterConstructor = await FormatterBuilder.getConstructorByType(\n type,\n options.cwd\n )\n const colorFns = getColorFns(\n options.stream,\n options.env,\n options.parsedArgvOptions.colorsEnabled\n )\n const snippetBuilder =\n await FormatterBuilder.getStepDefinitionSnippetBuilder({\n cwd: options.cwd,\n snippetInterface: options.parsedArgvOptions.snippetInterface,\n snippetSyntax: options.parsedArgvOptions.snippetSyntax,\n supportCodeLibrary: options.supportCodeLibrary,\n })\n return new FormatterConstructor({\n colorFns,\n snippetBuilder,\n ...options,\n })\n },\n\n async getConstructorByType(\n type: string,\n cwd: string\n ): Promise<typeof Formatter> {\n const formatters: Record<string, typeof Formatter> =\n Formatters.getFormatters()\n\n return formatters[type]\n ? formatters[type]\n : await FormatterBuilder.loadCustomClass('formatter', type, cwd)\n },\n\n async getStepDefinitionSnippetBuilder({\n cwd,\n snippetInterface,\n snippetSyntax,\n supportCodeLibrary,\n }: IGetStepDefinitionSnippetBuilderOptions) {\n if (doesNotHaveValue(snippetInterface)) {\n snippetInterface = SnippetInterface.Synchronous\n }\n let Syntax = JavascriptSnippetSyntax\n if (doesHaveValue(snippetSyntax)) {\n Syntax = await FormatterBuilder.loadCustomClass(\n 'syntax',\n snippetSyntax,\n cwd\n )\n }\n return new StepDefinitionSnippetBuilder({\n snippetSyntax: new Syntax(snippetInterface),\n parameterTypeRegistry: supportCodeLibrary.parameterTypeRegistry,\n })\n },\n\n async loadCustomClass(\n type: 'formatter' | 'syntax',\n descriptor: string,\n cwd: string\n ) {\n let normalized: URL | string = descriptor\n if (descriptor.startsWith('.')) {\n normalized = pathToFileURL(path.resolve(cwd, descriptor))\n } else if (descriptor.startsWith('file://')) {\n normalized = new URL(descriptor)\n }\n let CustomClass = await FormatterBuilder.loadFile(normalized)\n CustomClass = FormatterBuilder.resolveConstructor(CustomClass)\n if (doesHaveValue(CustomClass)) {\n return CustomClass\n } else {\n throw new Error(\n `Custom ${type} (${descriptor}) does not export a function/class`\n )\n }\n },\n\n async loadFile(urlOrName: URL | string) {\n let result\n try {\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n result = require(\n typeof urlOrName === 'string' ? urlOrName : fileURLToPath(urlOrName)\n )\n } catch (error) {\n if (error.code === 'ERR_REQUIRE_ESM') {\n result = await importer(urlOrName)\n } else {\n throw error\n }\n }\n return result\n },\n\n resolveConstructor(ImportedCode: any) {\n if (doesNotHaveValue(ImportedCode)) {\n return null\n }\n if (typeof ImportedCode === 'function') {\n return ImportedCode\n } else if (\n typeof ImportedCode === 'object' &&\n typeof ImportedCode.default === 'function'\n ) {\n return ImportedCode.default\n }\n return null\n },\n}\n\nexport default FormatterBuilder\n"]}
|
|
@@ -1,12 +1,22 @@
|
|
|
1
1
|
import Formatter, { IFormatterOptions } from '.';
|
|
2
|
+
import ReportGenerator, { JsonTestResult } from './helpers/report_generator';
|
|
3
|
+
export declare let globalReportLink: string;
|
|
2
4
|
export default class BVTAnalysisFormatter extends Formatter {
|
|
5
|
+
static reportGenerator: ReportGenerator;
|
|
6
|
+
static reRunFailedStepsIndex: {
|
|
7
|
+
testCaseId: string;
|
|
8
|
+
failedStepIndex: number;
|
|
9
|
+
}[] | null;
|
|
3
10
|
private reportGenerator;
|
|
4
11
|
private uploader;
|
|
5
12
|
private exit;
|
|
6
13
|
private START;
|
|
7
14
|
private runName;
|
|
15
|
+
private failedStepsIndex;
|
|
8
16
|
private summaryFormatter;
|
|
17
|
+
private rootCauseArray;
|
|
9
18
|
constructor(options: IFormatterOptions);
|
|
19
|
+
private sendEvent;
|
|
10
20
|
private uploadReport;
|
|
11
21
|
finished(): Promise<any>;
|
|
12
22
|
private analyzeReport;
|
|
@@ -14,7 +24,10 @@ export default class BVTAnalysisFormatter extends Formatter {
|
|
|
14
24
|
private processTestCase;
|
|
15
25
|
private uploadFinalReport;
|
|
16
26
|
private retrain;
|
|
27
|
+
private rerun;
|
|
17
28
|
private call_cucumber_client;
|
|
18
29
|
private getAppDataDir;
|
|
19
30
|
}
|
|
20
|
-
export declare function logReportLink(runId: string, projectId: string):
|
|
31
|
+
export declare function logReportLink(runId: string, projectId: string, status: JsonTestResult): string;
|
|
32
|
+
export declare function postUploadReportEvent(projectId: string, accessToken: string): Promise<void>;
|
|
33
|
+
export declare function createNewTestCase(payload: any, runsApiBaseURL: string, accessToken: string): Promise<any>;
|