@dev-blinq/cucumber-js 1.0.0-amdocs
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/LICENSE +22 -0
- package/README.md +68 -0
- package/api/index.d.ts +6 -0
- package/bin/cucumber-js +3 -0
- package/bin/cucumber.js +3 -0
- package/bin/cucumber.ts +2 -0
- package/bin/download-install.js +167 -0
- package/lib/api/console_logger.d.ts +12 -0
- package/lib/api/console_logger.js +24 -0
- package/lib/api/console_logger.js.map +1 -0
- package/lib/api/convert_configuration.d.ts +4 -0
- package/lib/api/convert_configuration.js +66 -0
- package/lib/api/convert_configuration.js.map +1 -0
- package/lib/api/environment.d.ts +2 -0
- package/lib/api/environment.js +14 -0
- package/lib/api/environment.js.map +1 -0
- package/lib/api/formatters.d.ts +20 -0
- package/lib/api/formatters.js +61 -0
- package/lib/api/formatters.js.map +1 -0
- package/lib/api/gherkin.d.ts +21 -0
- package/lib/api/gherkin.js +146 -0
- package/lib/api/gherkin.js.map +1 -0
- package/lib/api/index.d.ts +12 -0
- package/lib/api/index.js +28 -0
- package/lib/api/index.js.map +1 -0
- package/lib/api/load_configuration.d.ts +9 -0
- package/lib/api/load_configuration.js +41 -0
- package/lib/api/load_configuration.js.map +1 -0
- package/lib/api/load_sources.d.ts +9 -0
- package/lib/api/load_sources.js +53 -0
- package/lib/api/load_sources.js.map +1 -0
- package/lib/api/load_support.d.ts +10 -0
- package/lib/api/load_support.js +30 -0
- package/lib/api/load_support.js.map +1 -0
- package/lib/api/paths.d.ts +8 -0
- package/lib/api/paths.js +102 -0
- package/lib/api/paths.js.map +1 -0
- package/lib/api/plugins.d.ts +4 -0
- package/lib/api/plugins.js +19 -0
- package/lib/api/plugins.js.map +1 -0
- package/lib/api/run_cucumber.d.ts +11 -0
- package/lib/api/run_cucumber.js +115 -0
- package/lib/api/run_cucumber.js.map +1 -0
- package/lib/api/runtime.d.ts +21 -0
- package/lib/api/runtime.js +36 -0
- package/lib/api/runtime.js.map +1 -0
- package/lib/api/support.d.ts +9 -0
- package/lib/api/support.js +26 -0
- package/lib/api/support.js.map +1 -0
- package/lib/api/test_helpers.d.ts +3 -0
- package/lib/api/test_helpers.js +36 -0
- package/lib/api/test_helpers.js.map +1 -0
- package/lib/api/types.d.ts +177 -0
- package/lib/api/types.js +3 -0
- package/lib/api/types.js.map +1 -0
- package/lib/api/wrapper.mjs +6 -0
- package/lib/cli/helpers.d.ts +39 -0
- package/lib/cli/helpers.js +224 -0
- package/lib/cli/helpers.js.map +1 -0
- package/lib/cli/i18n.d.ts +2 -0
- package/lib/cli/i18n.js +70 -0
- package/lib/cli/i18n.js.map +1 -0
- package/lib/cli/index.d.ts +21 -0
- package/lib/cli/index.js +64 -0
- package/lib/cli/index.js.map +1 -0
- package/lib/cli/install_validator.d.ts +1 -0
- package/lib/cli/install_validator.js +18 -0
- package/lib/cli/install_validator.js.map +1 -0
- package/lib/cli/run.d.ts +1 -0
- package/lib/cli/run.js +44 -0
- package/lib/cli/run.js.map +1 -0
- package/lib/cli/validate_node_engine_version.d.ts +10 -0
- package/lib/cli/validate_node_engine_version.js +24 -0
- package/lib/cli/validate_node_engine_version.js.map +1 -0
- package/lib/configuration/argv_parser.d.ts +20 -0
- package/lib/configuration/argv_parser.js +104 -0
- package/lib/configuration/argv_parser.js.map +1 -0
- package/lib/configuration/axios_client.d.ts +1 -0
- package/lib/configuration/axios_client.js +40 -0
- package/lib/configuration/axios_client.js.map +1 -0
- package/lib/configuration/check_schema.d.ts +2 -0
- package/lib/configuration/check_schema.js +60 -0
- package/lib/configuration/check_schema.js.map +1 -0
- package/lib/configuration/default_configuration.d.ts +2 -0
- package/lib/configuration/default_configuration.js +29 -0
- package/lib/configuration/default_configuration.js.map +1 -0
- package/lib/configuration/from_file.d.ts +3 -0
- package/lib/configuration/from_file.js +85 -0
- package/lib/configuration/from_file.js.map +1 -0
- package/lib/configuration/helpers.d.ts +1 -0
- package/lib/configuration/helpers.js +11 -0
- package/lib/configuration/helpers.js.map +1 -0
- package/lib/configuration/index.d.ts +7 -0
- package/lib/configuration/index.js +29 -0
- package/lib/configuration/index.js.map +1 -0
- package/lib/configuration/locate_file.d.ts +1 -0
- package/lib/configuration/locate_file.js +21 -0
- package/lib/configuration/locate_file.js.map +1 -0
- package/lib/configuration/merge_configurations.d.ts +2 -0
- package/lib/configuration/merge_configurations.js +48 -0
- package/lib/configuration/merge_configurations.js.map +1 -0
- package/lib/configuration/option_splitter.d.ts +3 -0
- package/lib/configuration/option_splitter.js +23 -0
- package/lib/configuration/option_splitter.js.map +1 -0
- package/lib/configuration/types.d.ts +30 -0
- package/lib/configuration/types.js +3 -0
- package/lib/configuration/types.js.map +1 -0
- package/lib/configuration/validate_configuration.d.ts +3 -0
- package/lib/configuration/validate_configuration.js +13 -0
- package/lib/configuration/validate_configuration.js.map +1 -0
- package/lib/filter_stack_trace.d.ts +3 -0
- package/lib/filter_stack_trace.js +38 -0
- package/lib/filter_stack_trace.js.map +1 -0
- package/lib/formatter/api.d.ts +2 -0
- package/lib/formatter/api.js +53 -0
- package/lib/formatter/api.js.map +1 -0
- package/lib/formatter/builder.d.ts +37 -0
- package/lib/formatter/builder.js +101 -0
- package/lib/formatter/builder.js.map +1 -0
- package/lib/formatter/bvt_analysis_formatter.d.ts +30 -0
- package/lib/formatter/bvt_analysis_formatter.js +334 -0
- package/lib/formatter/bvt_analysis_formatter.js.map +1 -0
- package/lib/formatter/feature_data_format.d.ts +23 -0
- package/lib/formatter/feature_data_format.js +182 -0
- package/lib/formatter/feature_data_format.js.map +1 -0
- package/lib/formatter/fixtures/typescript.d.ts +2 -0
- package/lib/formatter/fixtures/typescript.js +6 -0
- package/lib/formatter/fixtures/typescript.js.map +1 -0
- package/lib/formatter/get_color_fns.d.ts +15 -0
- package/lib/formatter/get_color_fns.js +56 -0
- package/lib/formatter/get_color_fns.js.map +1 -0
- package/lib/formatter/helpers/constants.d.ts +44 -0
- package/lib/formatter/helpers/constants.js +50 -0
- package/lib/formatter/helpers/constants.js.map +1 -0
- package/lib/formatter/helpers/duration_helpers.d.ts +2 -0
- package/lib/formatter/helpers/duration_helpers.js +9 -0
- package/lib/formatter/helpers/duration_helpers.js.map +1 -0
- package/lib/formatter/helpers/event_data_collector.d.ts +30 -0
- package/lib/formatter/helpers/event_data_collector.js +126 -0
- package/lib/formatter/helpers/event_data_collector.js.map +1 -0
- package/lib/formatter/helpers/formatters.d.ts +6 -0
- package/lib/formatter/helpers/formatters.js +45 -0
- package/lib/formatter/helpers/formatters.js.map +1 -0
- package/lib/formatter/helpers/gherkin_document_parser.d.ts +5 -0
- package/lib/formatter/helpers/gherkin_document_parser.js +66 -0
- package/lib/formatter/helpers/gherkin_document_parser.js.map +1 -0
- package/lib/formatter/helpers/index.d.ts +10 -0
- package/lib/formatter/helpers/index.js +52 -0
- package/lib/formatter/helpers/index.js.map +1 -0
- package/lib/formatter/helpers/issue_helpers.d.ts +19 -0
- package/lib/formatter/helpers/issue_helpers.js +59 -0
- package/lib/formatter/helpers/issue_helpers.js.map +1 -0
- package/lib/formatter/helpers/keyword_type.d.ts +11 -0
- package/lib/formatter/helpers/keyword_type.js +32 -0
- package/lib/formatter/helpers/keyword_type.js.map +1 -0
- package/lib/formatter/helpers/location_helpers.d.ts +2 -0
- package/lib/formatter/helpers/location_helpers.js +17 -0
- package/lib/formatter/helpers/location_helpers.js.map +1 -0
- package/lib/formatter/helpers/pickle_parser.d.ts +17 -0
- package/lib/formatter/helpers/pickle_parser.js +28 -0
- package/lib/formatter/helpers/pickle_parser.js.map +1 -0
- package/lib/formatter/helpers/report_generator.d.ts +148 -0
- package/lib/formatter/helpers/report_generator.js +573 -0
- package/lib/formatter/helpers/report_generator.js.map +1 -0
- package/lib/formatter/helpers/step_argument_formatter.d.ts +2 -0
- package/lib/formatter/helpers/step_argument_formatter.js +48 -0
- package/lib/formatter/helpers/step_argument_formatter.js.map +1 -0
- package/lib/formatter/helpers/summary_helpers.d.ts +9 -0
- package/lib/formatter/helpers/summary_helpers.js +96 -0
- package/lib/formatter/helpers/summary_helpers.js.map +1 -0
- package/lib/formatter/helpers/test_case_attempt_formatter.d.ts +12 -0
- package/lib/formatter/helpers/test_case_attempt_formatter.js +114 -0
- package/lib/formatter/helpers/test_case_attempt_formatter.js.map +1 -0
- package/lib/formatter/helpers/test_case_attempt_parser.d.ts +32 -0
- package/lib/formatter/helpers/test_case_attempt_parser.js +135 -0
- package/lib/formatter/helpers/test_case_attempt_parser.js.map +1 -0
- package/lib/formatter/helpers/upload_serivce.d.ts +26 -0
- package/lib/formatter/helpers/upload_serivce.js +237 -0
- package/lib/formatter/helpers/upload_serivce.js.map +1 -0
- package/lib/formatter/helpers/uploader.d.ts +12 -0
- package/lib/formatter/helpers/uploader.js +151 -0
- package/lib/formatter/helpers/uploader.js.map +1 -0
- package/lib/formatter/helpers/usage_helpers/index.d.ts +23 -0
- package/lib/formatter/helpers/usage_helpers/index.js +111 -0
- package/lib/formatter/helpers/usage_helpers/index.js.map +1 -0
- package/lib/formatter/html_formatter.d.ts +7 -0
- package/lib/formatter/html_formatter.js +30 -0
- package/lib/formatter/html_formatter.js.map +1 -0
- package/lib/formatter/index.d.ts +53 -0
- package/lib/formatter/index.js +21 -0
- package/lib/formatter/index.js.map +1 -0
- package/lib/formatter/json_formatter.d.ts +78 -0
- package/lib/formatter/json_formatter.js +230 -0
- package/lib/formatter/json_formatter.js.map +1 -0
- package/lib/formatter/junit_formatter.d.ts +17 -0
- package/lib/formatter/junit_formatter.js +181 -0
- package/lib/formatter/junit_formatter.js.map +1 -0
- package/lib/formatter/message_formatter.d.ts +5 -0
- package/lib/formatter/message_formatter.js +15 -0
- package/lib/formatter/message_formatter.js.map +1 -0
- package/lib/formatter/progress_bar_formatter.d.ts +18 -0
- package/lib/formatter/progress_bar_formatter.js +99 -0
- package/lib/formatter/progress_bar_formatter.js.map +1 -0
- package/lib/formatter/progress_formatter.d.ts +9 -0
- package/lib/formatter/progress_formatter.js +59 -0
- package/lib/formatter/progress_formatter.js.map +1 -0
- package/lib/formatter/rerun_formatter.d.ts +13 -0
- package/lib/formatter/rerun_formatter.js +80 -0
- package/lib/formatter/rerun_formatter.js.map +1 -0
- package/lib/formatter/snippets_formatter.d.ts +6 -0
- package/lib/formatter/snippets_formatter.js +61 -0
- package/lib/formatter/snippets_formatter.js.map +1 -0
- package/lib/formatter/step_definition_snippet_builder/index.d.ts +20 -0
- package/lib/formatter/step_definition_snippet_builder/index.js +46 -0
- package/lib/formatter/step_definition_snippet_builder/index.js.map +1 -0
- package/lib/formatter/step_definition_snippet_builder/javascript_snippet_syntax.d.ts +7 -0
- package/lib/formatter/step_definition_snippet_builder/javascript_snippet_syntax.js +46 -0
- package/lib/formatter/step_definition_snippet_builder/javascript_snippet_syntax.js.map +1 -0
- package/lib/formatter/step_definition_snippet_builder/snippet_syntax.d.ts +16 -0
- package/lib/formatter/step_definition_snippet_builder/snippet_syntax.js +11 -0
- package/lib/formatter/step_definition_snippet_builder/snippet_syntax.js.map +1 -0
- package/lib/formatter/summary_formatter.d.ts +14 -0
- package/lib/formatter/summary_formatter.js +68 -0
- package/lib/formatter/summary_formatter.js.map +1 -0
- package/lib/formatter/usage_formatter.d.ts +6 -0
- package/lib/formatter/usage_formatter.js +98 -0
- package/lib/formatter/usage_formatter.js.map +1 -0
- package/lib/formatter/usage_json_formatter.d.ts +7 -0
- package/lib/formatter/usage_json_formatter.js +34 -0
- package/lib/formatter/usage_json_formatter.js.map +1 -0
- package/lib/importer.js +13 -0
- package/lib/index.d.ts +58 -0
- package/lib/index.js +109 -0
- package/lib/index.js.map +1 -0
- package/lib/logger.d.ts +5 -0
- package/lib/logger.js +3 -0
- package/lib/logger.js.map +1 -0
- package/lib/models/data_table.d.ts +10 -0
- package/lib/models/data_table.js +46 -0
- package/lib/models/data_table.js.map +1 -0
- package/lib/models/definition.d.ts +55 -0
- package/lib/models/definition.js +22 -0
- package/lib/models/definition.js.map +1 -0
- package/lib/models/gherkin_step_keyword.d.ts +1 -0
- package/lib/models/gherkin_step_keyword.js +3 -0
- package/lib/models/gherkin_step_keyword.js.map +1 -0
- package/lib/models/pickle_order.d.ts +1 -0
- package/lib/models/pickle_order.js +3 -0
- package/lib/models/pickle_order.js.map +1 -0
- package/lib/models/step_definition.d.ts +11 -0
- package/lib/models/step_definition.js +37 -0
- package/lib/models/step_definition.js.map +1 -0
- package/lib/models/test_case_hook_definition.d.ts +10 -0
- package/lib/models/test_case_hook_definition.js +27 -0
- package/lib/models/test_case_hook_definition.js.map +1 -0
- package/lib/models/test_run_hook_definition.d.ts +3 -0
- package/lib/models/test_run_hook_definition.js +10 -0
- package/lib/models/test_run_hook_definition.js.map +1 -0
- package/lib/models/test_step_hook_definition.d.ts +9 -0
- package/lib/models/test_step_hook_definition.js +26 -0
- package/lib/models/test_step_hook_definition.js.map +1 -0
- package/lib/pickle_filter.d.ts +42 -0
- package/lib/pickle_filter.js +99 -0
- package/lib/pickle_filter.js.map +1 -0
- package/lib/plugin/index.d.ts +2 -0
- package/lib/plugin/index.js +19 -0
- package/lib/plugin/index.js.map +1 -0
- package/lib/plugin/plugin_manager.d.ts +13 -0
- package/lib/plugin/plugin_manager.js +36 -0
- package/lib/plugin/plugin_manager.js.map +1 -0
- package/lib/plugin/types.d.ts +14 -0
- package/lib/plugin/types.js +3 -0
- package/lib/plugin/types.js.map +1 -0
- package/lib/publish/http_stream.d.ts +30 -0
- package/lib/publish/http_stream.js +112 -0
- package/lib/publish/http_stream.js.map +1 -0
- package/lib/publish/index.d.ts +2 -0
- package/lib/publish/index.js +5 -0
- package/lib/publish/index.js.map +1 -0
- package/lib/publish/publish_plugin.d.ts +2 -0
- package/lib/publish/publish_plugin.js +48 -0
- package/lib/publish/publish_plugin.js.map +1 -0
- package/lib/runtime/assemble_test_cases.d.ts +13 -0
- package/lib/runtime/assemble_test_cases.js +88 -0
- package/lib/runtime/assemble_test_cases.js.map +1 -0
- package/lib/runtime/attachment_manager/index.d.ts +33 -0
- package/lib/runtime/attachment_manager/index.js +119 -0
- package/lib/runtime/attachment_manager/index.js.map +1 -0
- package/lib/runtime/format_error.d.ts +2 -0
- package/lib/runtime/format_error.js +36 -0
- package/lib/runtime/format_error.js.map +1 -0
- package/lib/runtime/helpers.d.ts +6 -0
- package/lib/runtime/helpers.js +101 -0
- package/lib/runtime/helpers.js.map +1 -0
- package/lib/runtime/index.d.ts +40 -0
- package/lib/runtime/index.js +76 -0
- package/lib/runtime/index.js.map +1 -0
- package/lib/runtime/parallel/command_types.d.ts +32 -0
- package/lib/runtime/parallel/command_types.js +3 -0
- package/lib/runtime/parallel/command_types.js.map +1 -0
- package/lib/runtime/parallel/coordinator.d.ts +72 -0
- package/lib/runtime/parallel/coordinator.js +222 -0
- package/lib/runtime/parallel/coordinator.js.map +1 -0
- package/lib/runtime/parallel/run_worker.d.ts +1 -0
- package/lib/runtime/parallel/run_worker.js +29 -0
- package/lib/runtime/parallel/run_worker.js.map +1 -0
- package/lib/runtime/parallel/worker.d.ts +26 -0
- package/lib/runtime/parallel/worker.js +87 -0
- package/lib/runtime/parallel/worker.js.map +1 -0
- package/lib/runtime/run_test_run_hooks.d.ts +3 -0
- package/lib/runtime/run_test_run_hooks.js +28 -0
- package/lib/runtime/run_test_run_hooks.js.map +1 -0
- package/lib/runtime/step_runner.d.ts +16 -0
- package/lib/runtime/step_runner.js +88 -0
- package/lib/runtime/step_runner.js.map +1 -0
- package/lib/runtime/stopwatch.d.ts +12 -0
- package/lib/runtime/stopwatch.js +34 -0
- package/lib/runtime/stopwatch.js.map +1 -0
- package/lib/runtime/test_case_runner.d.ts +55 -0
- package/lib/runtime/test_case_runner.js +277 -0
- package/lib/runtime/test_case_runner.js.map +1 -0
- package/lib/step_arguments.d.ts +6 -0
- package/lib/step_arguments.js +19 -0
- package/lib/step_arguments.js.map +1 -0
- package/lib/support_code_library_builder/build_parameter_type.d.ts +3 -0
- package/lib/support_code_library_builder/build_parameter_type.js +13 -0
- package/lib/support_code_library_builder/build_parameter_type.js.map +1 -0
- package/lib/support_code_library_builder/get_definition_line_and_uri.d.ts +3 -0
- package/lib/support_code_library_builder/get_definition_line_and_uri.js +29 -0
- package/lib/support_code_library_builder/get_definition_line_and_uri.js.map +1 -0
- package/lib/support_code_library_builder/index.d.ts +74 -0
- package/lib/support_code_library_builder/index.js +304 -0
- package/lib/support_code_library_builder/index.js.map +1 -0
- package/lib/support_code_library_builder/parallel_can_assign_helpers.d.ts +2 -0
- package/lib/support_code_library_builder/parallel_can_assign_helpers.js +16 -0
- package/lib/support_code_library_builder/parallel_can_assign_helpers.js.map +1 -0
- package/lib/support_code_library_builder/sourced_parameter_type_registry.d.ts +7 -0
- package/lib/support_code_library_builder/sourced_parameter_type_registry.js +19 -0
- package/lib/support_code_library_builder/sourced_parameter_type_registry.js.map +1 -0
- package/lib/support_code_library_builder/types.d.ts +88 -0
- package/lib/support_code_library_builder/types.js +3 -0
- package/lib/support_code_library_builder/types.js.map +1 -0
- package/lib/support_code_library_builder/validate_arguments.d.ts +12 -0
- package/lib/support_code_library_builder/validate_arguments.js +73 -0
- package/lib/support_code_library_builder/validate_arguments.js.map +1 -0
- package/lib/support_code_library_builder/world.d.ts +18 -0
- package/lib/support_code_library_builder/world.js +11 -0
- package/lib/support_code_library_builder/world.js.map +1 -0
- package/lib/time.d.ts +18 -0
- package/lib/time.js +61 -0
- package/lib/time.js.map +1 -0
- package/lib/try_require.d.ts +7 -0
- package/lib/try_require.js +26 -0
- package/lib/try_require.js.map +1 -0
- package/lib/types/index.d.ts +4 -0
- package/lib/types/index.js +3 -0
- package/lib/types/index.js.map +1 -0
- package/lib/uncaught_exception_manager.d.ts +7 -0
- package/lib/uncaught_exception_manager.js +12 -0
- package/lib/uncaught_exception_manager.js.map +1 -0
- package/lib/user_code_runner.d.ts +14 -0
- package/lib/user_code_runner.js +82 -0
- package/lib/user_code_runner.js.map +1 -0
- package/lib/value_checker.d.ts +3 -0
- package/lib/value_checker.js +19 -0
- package/lib/value_checker.js.map +1 -0
- package/lib/version.d.ts +1 -0
- package/lib/version.js +6 -0
- package/lib/version.js.map +1 -0
- package/lib/wrapper.mjs +44 -0
- package/package.json +197 -0
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
const messages = __importStar(require("@cucumber/messages"));
|
|
27
|
+
const value_checker_1 = require("../../value_checker");
|
|
28
|
+
class EventDataCollector {
|
|
29
|
+
constructor(eventBroadcaster) {
|
|
30
|
+
this.gherkinDocumentMap = {};
|
|
31
|
+
this.pickleMap = {};
|
|
32
|
+
this.testCaseMap = {};
|
|
33
|
+
this.testCaseAttemptDataMap = {};
|
|
34
|
+
this.undefinedParameterTypes = [];
|
|
35
|
+
eventBroadcaster.on('envelope', this.parseEnvelope.bind(this));
|
|
36
|
+
}
|
|
37
|
+
getGherkinDocument(uri) {
|
|
38
|
+
return this.gherkinDocumentMap[uri];
|
|
39
|
+
}
|
|
40
|
+
getPickle(pickleId) {
|
|
41
|
+
return this.pickleMap[pickleId];
|
|
42
|
+
}
|
|
43
|
+
getTestCaseAttempts() {
|
|
44
|
+
return Object.keys(this.testCaseAttemptDataMap).map((testCaseStartedId) => {
|
|
45
|
+
return this.getTestCaseAttempt(testCaseStartedId);
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
getTestCaseAttempt(testCaseStartedId) {
|
|
49
|
+
const testCaseAttemptData = this.testCaseAttemptDataMap[testCaseStartedId];
|
|
50
|
+
const testCase = this.testCaseMap[testCaseAttemptData.testCaseId];
|
|
51
|
+
const pickle = this.pickleMap[testCase.pickleId];
|
|
52
|
+
return {
|
|
53
|
+
gherkinDocument: this.gherkinDocumentMap[pickle.uri],
|
|
54
|
+
pickle,
|
|
55
|
+
testCase,
|
|
56
|
+
attempt: testCaseAttemptData.attempt,
|
|
57
|
+
willBeRetried: testCaseAttemptData.willBeRetried,
|
|
58
|
+
stepAttachments: testCaseAttemptData.stepAttachments,
|
|
59
|
+
stepResults: testCaseAttemptData.stepResults,
|
|
60
|
+
worstTestStepResult: testCaseAttemptData.worstTestStepResult,
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
parseEnvelope(envelope) {
|
|
64
|
+
if ((0, value_checker_1.doesHaveValue)(envelope.gherkinDocument)) {
|
|
65
|
+
this.gherkinDocumentMap[envelope.gherkinDocument.uri] =
|
|
66
|
+
envelope.gherkinDocument;
|
|
67
|
+
}
|
|
68
|
+
else if ((0, value_checker_1.doesHaveValue)(envelope.pickle)) {
|
|
69
|
+
this.pickleMap[envelope.pickle.id] = envelope.pickle;
|
|
70
|
+
}
|
|
71
|
+
else if ((0, value_checker_1.doesHaveValue)(envelope.undefinedParameterType)) {
|
|
72
|
+
this.undefinedParameterTypes.push(envelope.undefinedParameterType);
|
|
73
|
+
}
|
|
74
|
+
else if ((0, value_checker_1.doesHaveValue)(envelope.testCase)) {
|
|
75
|
+
this.testCaseMap[envelope.testCase.id] = envelope.testCase;
|
|
76
|
+
}
|
|
77
|
+
else if ((0, value_checker_1.doesHaveValue)(envelope.testCaseStarted)) {
|
|
78
|
+
this.initTestCaseAttempt(envelope.testCaseStarted);
|
|
79
|
+
}
|
|
80
|
+
else if ((0, value_checker_1.doesHaveValue)(envelope.attachment)) {
|
|
81
|
+
this.storeAttachment(envelope.attachment);
|
|
82
|
+
}
|
|
83
|
+
else if ((0, value_checker_1.doesHaveValue)(envelope.testStepFinished)) {
|
|
84
|
+
this.storeTestStepResult(envelope.testStepFinished);
|
|
85
|
+
}
|
|
86
|
+
else if ((0, value_checker_1.doesHaveValue)(envelope.testCaseFinished)) {
|
|
87
|
+
this.storeTestCaseResult(envelope.testCaseFinished);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
initTestCaseAttempt(testCaseStarted) {
|
|
91
|
+
this.testCaseAttemptDataMap[testCaseStarted.id] = {
|
|
92
|
+
attempt: testCaseStarted.attempt,
|
|
93
|
+
willBeRetried: false,
|
|
94
|
+
testCaseId: testCaseStarted.testCaseId,
|
|
95
|
+
stepAttachments: {},
|
|
96
|
+
stepResults: {},
|
|
97
|
+
worstTestStepResult: {
|
|
98
|
+
duration: { seconds: 0, nanos: 0 },
|
|
99
|
+
status: messages.TestStepResultStatus.UNKNOWN,
|
|
100
|
+
},
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
storeAttachment(attachment) {
|
|
104
|
+
const { testCaseStartedId, testStepId } = attachment;
|
|
105
|
+
// TODO: we shouldn't have to check if these properties have values - they are non-nullable
|
|
106
|
+
if ((0, value_checker_1.doesHaveValue)(testCaseStartedId) && (0, value_checker_1.doesHaveValue)(testStepId)) {
|
|
107
|
+
const { stepAttachments } = this.testCaseAttemptDataMap[testCaseStartedId];
|
|
108
|
+
if ((0, value_checker_1.doesNotHaveValue)(stepAttachments[testStepId])) {
|
|
109
|
+
stepAttachments[testStepId] = [];
|
|
110
|
+
}
|
|
111
|
+
stepAttachments[testStepId].push(attachment);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
storeTestStepResult({ testCaseStartedId, testStepId, testStepResult, }) {
|
|
115
|
+
this.testCaseAttemptDataMap[testCaseStartedId].stepResults[testStepId] =
|
|
116
|
+
testStepResult;
|
|
117
|
+
}
|
|
118
|
+
storeTestCaseResult({ testCaseStartedId, willBeRetried, }) {
|
|
119
|
+
const stepResults = Object.values(this.testCaseAttemptDataMap[testCaseStartedId].stepResults);
|
|
120
|
+
this.testCaseAttemptDataMap[testCaseStartedId].worstTestStepResult =
|
|
121
|
+
messages.getWorstTestStepResult(stepResults);
|
|
122
|
+
this.testCaseAttemptDataMap[testCaseStartedId].willBeRetried = willBeRetried;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
exports.default = EventDataCollector;
|
|
126
|
+
//# sourceMappingURL=event_data_collector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event_data_collector.js","sourceRoot":"","sources":["../../../src/formatter/helpers/event_data_collector.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6DAA8C;AAC9C,uDAAqE;AAuBrE,MAAqB,kBAAkB;IAOrC,YAAY,gBAA8B;QANlC,uBAAkB,GAA6C,EAAE,CAAA;QACjE,cAAS,GAAoC,EAAE,CAAA;QAC/C,gBAAW,GAAsC,EAAE,CAAA;QACnD,2BAAsB,GAAyC,EAAE,CAAA;QAChE,4BAAuB,GAAsC,EAAE,CAAA;QAGtE,gBAAgB,CAAC,EAAE,CAAC,UAAU,EAAE,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAA;IAChE,CAAC;IAED,kBAAkB,CAAC,GAAW;QAC5B,OAAO,IAAI,CAAC,kBA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AE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE;gBAClC,MAAM,EAAE,QAAQ,CAAC,oBAAoB,CAAC,OAAO;aAC9C;SACF,CAAA;IACH,CAAC;IAED,eAAe,CAAC,UAA+B;QAC7C,MAAM,EAAE,iBAAiB,EAAE,UAAU,EAAE,GAAG,UAAU,CAAA;QACpD,2FAA2F;QAC3F,IAAI,IAAA,6BAAa,EAAC,iBAAiB,CAAC,IAAI,IAAA,6BAAa,EAAC,UAAU,CAAC,EAAE;YACjE,MAAM,EAAE,eAAe,EAAE,GAAG,IAAI,CAAC,sBAAsB,CAAC,iBAAiB,CAAC,CAAA;YAC1E,IAAI,IAAA,gCAAgB,EAAC,eAAe,CAAC,UAAU,CAAC,CAAC,EAAE;gBACjD,eAAe,CAAC,UAAU,CAAC,GAAG,EAAE,CAAA;aACjC;YACD,eAAe,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAA;SAC7C;IACH,CAAC;IAED,mBAAmB,CAAC,EAClB,iBAAiB,EACjB,UAAU,EACV,cAAc,GACY;QAC1B,IAAI,CAAC,sBAAsB,CAAC,iBAAiB,CAAC,CAAC,WAAW,CAAC,UAAU,CAAC;YACpE,cAAc,CAAA;IAClB,CAAC;IAED,mBAAmB,CAAC,EAClB,iBAAiB,EACjB,aAAa,GACa;QAC1B,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,CAC/B,IAAI,CAAC,sBAAsB,CAAC,iBAAiB,CAAC,CAAC,WAAW,CAC3D,CAAA;QACD,IAAI,CAAC,sBAAsB,CAAC,iBAAiB,CAAC,CAAC,mBAAmB;YAChE,QAAQ,CAAC,sBAAsB,CAAC,WAAW,CAAC,CAAA;QAC9C,IAAI,CAAC,sBAAsB,CAAC,iBAAiB,CAAC,CAAC,aAAa,GAAG,aAAa,CAAA;IAC9E,CAAC;CACF;AA5GD,qCA4GC","sourcesContent":["import * as messages from '@cucumber/messages'\nimport { doesHaveValue, doesNotHaveValue } from '../../value_checker'\nimport { EventEmitter } from 'events'\n\ninterface ITestCaseAttemptData {\n attempt: number\n willBeRetried: boolean\n testCaseId: string\n stepAttachments: Record<string, messages.Attachment[]>\n stepResults: Record<string, messages.TestStepResult>\n worstTestStepResult: messages.TestStepResult\n}\n\nexport interface ITestCaseAttempt {\n attempt: number\n willBeRetried: boolean\n gherkinDocument: messages.GherkinDocument\n pickle: messages.Pickle\n stepAttachments: Record<string, messages.Attachment[]>\n stepResults: Record<string, messages.TestStepResult>\n testCase: messages.TestCase\n worstTestStepResult: messages.TestStepResult\n}\n\nexport default class EventDataCollector {\n private gherkinDocumentMap: Record<string, messages.GherkinDocument> = {}\n private pickleMap: Record<string, messages.Pickle> = {}\n private testCaseMap: Record<string, messages.TestCase> = {}\n private testCaseAttemptDataMap: Record<string, ITestCaseAttemptData> = {}\n readonly undefinedParameterTypes: messages.UndefinedParameterType[] = []\n\n constructor(eventBroadcaster: EventEmitter) {\n eventBroadcaster.on('envelope', this.parseEnvelope.bind(this))\n }\n\n getGherkinDocument(uri: string): messages.GherkinDocument {\n return this.gherkinDocumentMap[uri]\n }\n\n getPickle(pickleId: string): messages.Pickle {\n return this.pickleMap[pickleId]\n }\n\n getTestCaseAttempts(): ITestCaseAttempt[] {\n return Object.keys(this.testCaseAttemptDataMap).map((testCaseStartedId) => {\n return this.getTestCaseAttempt(testCaseStartedId)\n })\n }\n\n getTestCaseAttempt(testCaseStartedId: string): ITestCaseAttempt {\n const testCaseAttemptData = this.testCaseAttemptDataMap[testCaseStartedId]\n const testCase = this.testCaseMap[testCaseAttemptData.testCaseId]\n const pickle = this.pickleMap[testCase.pickleId]\n return {\n gherkinDocument: this.gherkinDocumentMap[pickle.uri],\n pickle,\n testCase,\n attempt: testCaseAttemptData.attempt,\n willBeRetried: testCaseAttemptData.willBeRetried,\n stepAttachments: testCaseAttemptData.stepAttachments,\n stepResults: testCaseAttemptData.stepResults,\n worstTestStepResult: testCaseAttemptData.worstTestStepResult,\n }\n }\n\n parseEnvelope(envelope: messages.Envelope): void {\n if (doesHaveValue(envelope.gherkinDocument)) {\n this.gherkinDocumentMap[envelope.gherkinDocument.uri] =\n envelope.gherkinDocument\n } else if (doesHaveValue(envelope.pickle)) {\n this.pickleMap[envelope.pickle.id] = envelope.pickle\n } else if (doesHaveValue(envelope.undefinedParameterType)) {\n this.undefinedParameterTypes.push(envelope.undefinedParameterType)\n } else if (doesHaveValue(envelope.testCase)) {\n this.testCaseMap[envelope.testCase.id] = envelope.testCase\n } else if (doesHaveValue(envelope.testCaseStarted)) {\n this.initTestCaseAttempt(envelope.testCaseStarted)\n } else if (doesHaveValue(envelope.attachment)) {\n this.storeAttachment(envelope.attachment)\n } else if (doesHaveValue(envelope.testStepFinished)) {\n this.storeTestStepResult(envelope.testStepFinished)\n } else if (doesHaveValue(envelope.testCaseFinished)) {\n this.storeTestCaseResult(envelope.testCaseFinished)\n }\n }\n\n private initTestCaseAttempt(testCaseStarted: messages.TestCaseStarted): void {\n this.testCaseAttemptDataMap[testCaseStarted.id] = {\n attempt: testCaseStarted.attempt,\n willBeRetried: false,\n testCaseId: testCaseStarted.testCaseId,\n stepAttachments: {},\n stepResults: {},\n worstTestStepResult: {\n duration: { seconds: 0, nanos: 0 },\n status: messages.TestStepResultStatus.UNKNOWN,\n },\n }\n }\n\n storeAttachment(attachment: messages.Attachment): void {\n const { testCaseStartedId, testStepId } = attachment\n // TODO: we shouldn't have to check if these properties have values - they are non-nullable\n if (doesHaveValue(testCaseStartedId) && doesHaveValue(testStepId)) {\n const { stepAttachments } = this.testCaseAttemptDataMap[testCaseStartedId]\n if (doesNotHaveValue(stepAttachments[testStepId])) {\n stepAttachments[testStepId] = []\n }\n stepAttachments[testStepId].push(attachment)\n }\n }\n\n storeTestStepResult({\n testCaseStartedId,\n testStepId,\n testStepResult,\n }: messages.TestStepFinished): void {\n this.testCaseAttemptDataMap[testCaseStartedId].stepResults[testStepId] =\n testStepResult\n }\n\n storeTestCaseResult({\n testCaseStartedId,\n willBeRetried,\n }: messages.TestCaseFinished): void {\n const stepResults = Object.values(\n this.testCaseAttemptDataMap[testCaseStartedId].stepResults\n )\n this.testCaseAttemptDataMap[testCaseStartedId].worstTestStepResult =\n messages.getWorstTestStepResult(stepResults)\n this.testCaseAttemptDataMap[testCaseStartedId].willBeRetried = willBeRetried\n }\n}\n"]}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const json_formatter_1 = __importDefault(require("../json_formatter"));
|
|
7
|
+
const message_formatter_1 = __importDefault(require("../message_formatter"));
|
|
8
|
+
const progress_bar_formatter_1 = __importDefault(require("../progress_bar_formatter"));
|
|
9
|
+
const progress_formatter_1 = __importDefault(require("../progress_formatter"));
|
|
10
|
+
const rerun_formatter_1 = __importDefault(require("../rerun_formatter"));
|
|
11
|
+
const snippets_formatter_1 = __importDefault(require("../snippets_formatter"));
|
|
12
|
+
const summary_formatter_1 = __importDefault(require("../summary_formatter"));
|
|
13
|
+
const usage_formatter_1 = __importDefault(require("../usage_formatter"));
|
|
14
|
+
const usage_json_formatter_1 = __importDefault(require("../usage_json_formatter"));
|
|
15
|
+
const html_formatter_1 = __importDefault(require("../html_formatter"));
|
|
16
|
+
const junit_formatter_1 = __importDefault(require("../junit_formatter"));
|
|
17
|
+
const bvt_analysis_formatter_1 = __importDefault(require("../bvt_analysis_formatter"));
|
|
18
|
+
const Formatters = {
|
|
19
|
+
getFormatters() {
|
|
20
|
+
return {
|
|
21
|
+
json: json_formatter_1.default,
|
|
22
|
+
message: message_formatter_1.default,
|
|
23
|
+
html: html_formatter_1.default,
|
|
24
|
+
progress: progress_formatter_1.default,
|
|
25
|
+
'progress-bar': progress_bar_formatter_1.default,
|
|
26
|
+
rerun: rerun_formatter_1.default,
|
|
27
|
+
snippets: snippets_formatter_1.default,
|
|
28
|
+
summary: summary_formatter_1.default,
|
|
29
|
+
usage: usage_formatter_1.default,
|
|
30
|
+
'usage-json': usage_json_formatter_1.default,
|
|
31
|
+
junit: junit_formatter_1.default,
|
|
32
|
+
bvt: bvt_analysis_formatter_1.default,
|
|
33
|
+
};
|
|
34
|
+
},
|
|
35
|
+
buildFormattersDocumentationString() {
|
|
36
|
+
let concatanatedFormattersDocumentation = '';
|
|
37
|
+
const formatters = this.getFormatters();
|
|
38
|
+
for (const formatterName in formatters) {
|
|
39
|
+
concatanatedFormattersDocumentation += ` ${formatterName}: ${formatters[formatterName].documentation}\n`;
|
|
40
|
+
}
|
|
41
|
+
return concatanatedFormattersDocumentation;
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
exports.default = Formatters;
|
|
45
|
+
//# sourceMappingURL=formatters.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatters.js","sourceRoot":"","sources":["../../../src/formatter/helpers/formatters.ts"],"names":[],"mappings":";;;;;AACA,uEAA6C;AAC7C,6EAAmD;AACnD,uFAA4D;AAC5D,+EAAqD;AACrD,yEAA+C;AAC/C,+EAAqD;AACrD,6EAAmD;AACnD,yEAA+C;AAC/C,mFAAwD;AACxD,uEAA6C;AAC7C,yEAA+C;AAC/C,uFAA4D;AAC5D,MAAM,UAAU,GAAG;IACjB,aAAa;QACX,OAAO;YACL,IAAI,EAAE,wBAAa;YACnB,OAAO,EAAE,2BAAgB;YACzB,IAAI,EAAE,wBAAa;YACnB,QAAQ,EAAE,4BAAiB;YAC3B,cAAc,EAAE,gCAAoB;YACpC,KAAK,EAAE,yBAAc;YACrB,QAAQ,EAAE,4BAAiB;YAC3B,OAAO,EAAE,2BAAgB;YACzB,KAAK,EAAE,yBAAc;YACrB,YAAY,EAAE,8BAAkB;YAChC,KAAK,EAAE,yBAAc;YACrB,GAAG,EAAE,gCAAoB;SAC1B,CAAA;IACH,CAAC;IACD,kCAAkC;QAChC,IAAI,mCAAmC,GAAW,EAAE,CAAA;QACpD,MAAM,UAAU,GAAG,IAAI,CAAC,aAAa,EAAE,CAAA;QACvC,KAAK,MAAM,aAAa,IAAI,UAAU,EAAE;YACtC,mCAAmC,IAAI,OAAO,aAAa,KAAK,UAAU,CAAC,aAAa,CAAC,CAAC,aAAa,IAAI,CAAA;SAC5G;QAED,OAAO,mCAAmC,CAAA;IAC5C,CAAC;CACF,CAAA;AAED,kBAAe,UAAU,CAAA","sourcesContent":["import Formatter from '../.'\nimport JsonFormatter from '../json_formatter'\nimport MessageFormatter from '../message_formatter'\nimport ProgressBarFormatter from '../progress_bar_formatter'\nimport ProgressFormatter from '../progress_formatter'\nimport RerunFormatter from '../rerun_formatter'\nimport SnippetsFormatter from '../snippets_formatter'\nimport SummaryFormatter from '../summary_formatter'\nimport UsageFormatter from '../usage_formatter'\nimport UsageJsonFormatter from '../usage_json_formatter'\nimport HtmlFormatter from '../html_formatter'\nimport JunitFormatter from '../junit_formatter'\nimport BVTAnalysisFormatter from '../bvt_analysis_formatter'\nconst Formatters = {\n getFormatters(): Record<string, typeof Formatter> {\n return {\n json: JsonFormatter,\n message: MessageFormatter,\n html: HtmlFormatter,\n progress: ProgressFormatter,\n 'progress-bar': ProgressBarFormatter,\n rerun: RerunFormatter,\n snippets: SnippetsFormatter,\n summary: SummaryFormatter,\n usage: UsageFormatter,\n 'usage-json': UsageJsonFormatter,\n junit: JunitFormatter,\n bvt: BVTAnalysisFormatter,\n }\n },\n buildFormattersDocumentationString(): string {\n let concatanatedFormattersDocumentation: string = ''\n const formatters = this.getFormatters()\n for (const formatterName in formatters) {\n concatanatedFormattersDocumentation += ` ${formatterName}: ${formatters[formatterName].documentation}\\n`\n }\n\n return concatanatedFormattersDocumentation\n },\n}\n\nexport default Formatters\n"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as messages from '@cucumber/messages';
|
|
2
|
+
export declare function getGherkinStepMap(gherkinDocument: messages.GherkinDocument): Record<string, messages.Step>;
|
|
3
|
+
export declare function getGherkinScenarioMap(gherkinDocument: messages.GherkinDocument): Record<string, messages.Scenario>;
|
|
4
|
+
export declare function getGherkinExampleRuleMap(gherkinDocument: messages.GherkinDocument): Record<string, messages.Rule>;
|
|
5
|
+
export declare function getGherkinScenarioLocationMap(gherkinDocument: messages.GherkinDocument): Record<string, messages.Location>;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getGherkinScenarioLocationMap = exports.getGherkinExampleRuleMap = exports.getGherkinScenarioMap = exports.getGherkinStepMap = void 0;
|
|
4
|
+
const value_checker_1 = require("../../value_checker");
|
|
5
|
+
function getGherkinStepMap(gherkinDocument) {
|
|
6
|
+
const result = {};
|
|
7
|
+
gherkinDocument.feature.children
|
|
8
|
+
.map(extractStepContainers)
|
|
9
|
+
.flat()
|
|
10
|
+
.forEach((x) => x.steps.forEach((step) => (result[step.id] = step)));
|
|
11
|
+
return result;
|
|
12
|
+
}
|
|
13
|
+
exports.getGherkinStepMap = getGherkinStepMap;
|
|
14
|
+
function extractStepContainers(child) {
|
|
15
|
+
if ((0, value_checker_1.doesHaveValue)(child.background)) {
|
|
16
|
+
return [child.background];
|
|
17
|
+
}
|
|
18
|
+
else if ((0, value_checker_1.doesHaveValue)(child.rule)) {
|
|
19
|
+
return child.rule.children.map((ruleChild) => (0, value_checker_1.doesHaveValue)(ruleChild.background)
|
|
20
|
+
? ruleChild.background
|
|
21
|
+
: ruleChild.scenario);
|
|
22
|
+
}
|
|
23
|
+
return [child.scenario];
|
|
24
|
+
}
|
|
25
|
+
function getGherkinScenarioMap(gherkinDocument) {
|
|
26
|
+
const result = {};
|
|
27
|
+
gherkinDocument.feature.children
|
|
28
|
+
.map((child) => {
|
|
29
|
+
if ((0, value_checker_1.doesHaveValue)(child.rule)) {
|
|
30
|
+
return child.rule.children;
|
|
31
|
+
}
|
|
32
|
+
return [child];
|
|
33
|
+
})
|
|
34
|
+
.flat()
|
|
35
|
+
.forEach((x) => {
|
|
36
|
+
if (x.scenario != null) {
|
|
37
|
+
result[x.scenario.id] = x.scenario;
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
return result;
|
|
41
|
+
}
|
|
42
|
+
exports.getGherkinScenarioMap = getGherkinScenarioMap;
|
|
43
|
+
function getGherkinExampleRuleMap(gherkinDocument) {
|
|
44
|
+
const result = {};
|
|
45
|
+
gherkinDocument.feature.children
|
|
46
|
+
.filter((x) => x.rule != null)
|
|
47
|
+
.forEach((x) => x.rule.children
|
|
48
|
+
.filter((child) => (0, value_checker_1.doesHaveValue)(child.scenario))
|
|
49
|
+
.forEach((child) => (result[child.scenario.id] = x.rule)));
|
|
50
|
+
return result;
|
|
51
|
+
}
|
|
52
|
+
exports.getGherkinExampleRuleMap = getGherkinExampleRuleMap;
|
|
53
|
+
function getGherkinScenarioLocationMap(gherkinDocument) {
|
|
54
|
+
const locationMap = {};
|
|
55
|
+
const scenarioMap = getGherkinScenarioMap(gherkinDocument);
|
|
56
|
+
Object.keys(scenarioMap).forEach((id) => {
|
|
57
|
+
const scenario = scenarioMap[id];
|
|
58
|
+
locationMap[id] = scenario.location;
|
|
59
|
+
if ((0, value_checker_1.doesHaveValue)(scenario.examples)) {
|
|
60
|
+
scenario.examples.forEach((x) => x.tableBody.forEach((tableRow) => (locationMap[tableRow.id] = tableRow.location)));
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
return locationMap;
|
|
64
|
+
}
|
|
65
|
+
exports.getGherkinScenarioLocationMap = getGherkinScenarioLocationMap;
|
|
66
|
+
//# sourceMappingURL=gherkin_document_parser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gherkin_document_parser.js","sourceRoot":"","sources":["../../../src/formatter/helpers/gherkin_document_parser.ts"],"names":[],"mappings":";;;AACA,uDAAmD;AAEnD,SAAgB,iBAAiB,CAC/B,eAAyC;IAEzC,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AAC,CAAC,CAAC,EAAE,EAAE,CAC9B,CAAC,CAAC,SAAS,CAAC,OAAO,CACjB,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,WAAW,CAAC,QAAQ,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,QAAQ,CAAC,CAC7D,CACF,CAAA;SACF;IACH,CAAC,CAAC,CAAA;IACF,OAAO,WAAW,CAAA;AACpB,CAAC;AAlBD,sEAkBC","sourcesContent":["import * as messages from '@cucumber/messages'\nimport { doesHaveValue } from '../../value_checker'\n\nexport function getGherkinStepMap(\n gherkinDocument: messages.GherkinDocument\n): Record<string, messages.Step> {\n const result: Record<string, messages.Step> = {}\n gherkinDocument.feature.children\n .map(extractStepContainers)\n .flat()\n .forEach((x) =>\n x.steps.forEach((step: messages.Step) => (result[step.id] = step))\n )\n return result\n}\n\nfunction extractStepContainers(\n child: messages.FeatureChild\n): Array<messages.Scenario | messages.Background> {\n if (doesHaveValue(child.background)) {\n return [child.background]\n } else if (doesHaveValue(child.rule)) {\n return child.rule.children.map((ruleChild) =>\n doesHaveValue(ruleChild.background)\n ? ruleChild.background\n : ruleChild.scenario\n )\n }\n return [child.scenario]\n}\n\nexport function getGherkinScenarioMap(\n gherkinDocument: messages.GherkinDocument\n): Record<string, messages.Scenario> {\n const result: Record<string, messages.Scenario> = {}\n gherkinDocument.feature.children\n .map((child: messages.FeatureChild) => {\n if (doesHaveValue(child.rule)) {\n return child.rule.children\n }\n return [child]\n })\n .flat()\n .forEach((x) => {\n if (x.scenario != null) {\n result[x.scenario.id] = x.scenario\n }\n })\n return result\n}\n\nexport function getGherkinExampleRuleMap(\n gherkinDocument: messages.GherkinDocument\n): Record<string, messages.Rule> {\n const result: Record<string, messages.Rule> = {}\n gherkinDocument.feature.children\n .filter((x) => x.rule != null)\n .forEach((x) =>\n x.rule.children\n .filter((child) => doesHaveValue(child.scenario))\n .forEach((child) => (result[child.scenario.id] = x.rule))\n )\n return result\n}\n\nexport function getGherkinScenarioLocationMap(\n gherkinDocument: messages.GherkinDocument\n): Record<string, messages.Location> {\n const locationMap: Record<string, messages.Location> = {}\n const scenarioMap: Record<string, messages.Scenario> =\n getGherkinScenarioMap(gherkinDocument)\n Object.keys(scenarioMap).forEach((id) => {\n const scenario = scenarioMap[id]\n locationMap[id] = scenario.location\n if (doesHaveValue(scenario.examples)) {\n scenario.examples.forEach((x) =>\n x.tableBody.forEach(\n (tableRow) => (locationMap[tableRow.id] = tableRow.location)\n )\n )\n }\n })\n return locationMap\n}\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as GherkinDocumentParser from './gherkin_document_parser';
|
|
2
|
+
import * as PickleParser from './pickle_parser';
|
|
3
|
+
export { parseTestCaseAttempt } from './test_case_attempt_parser';
|
|
4
|
+
export { default as EventDataCollector } from './event_data_collector';
|
|
5
|
+
export { KeywordType, getStepKeywordType } from './keyword_type';
|
|
6
|
+
export { formatIssue, isWarning, isFailure, isIssue } from './issue_helpers';
|
|
7
|
+
export { formatLocation } from './location_helpers';
|
|
8
|
+
export { formatSummary } from './summary_helpers';
|
|
9
|
+
export { getUsage } from './usage_helpers';
|
|
10
|
+
export { GherkinDocumentParser, PickleParser };
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.PickleParser = exports.GherkinDocumentParser = exports.getUsage = exports.formatSummary = exports.formatLocation = exports.isIssue = exports.isFailure = exports.isWarning = exports.formatIssue = exports.getStepKeywordType = exports.KeywordType = exports.EventDataCollector = exports.parseTestCaseAttempt = void 0;
|
|
30
|
+
const GherkinDocumentParser = __importStar(require("./gherkin_document_parser"));
|
|
31
|
+
exports.GherkinDocumentParser = GherkinDocumentParser;
|
|
32
|
+
const PickleParser = __importStar(require("./pickle_parser"));
|
|
33
|
+
exports.PickleParser = PickleParser;
|
|
34
|
+
var test_case_attempt_parser_1 = require("./test_case_attempt_parser");
|
|
35
|
+
Object.defineProperty(exports, "parseTestCaseAttempt", { enumerable: true, get: function () { return test_case_attempt_parser_1.parseTestCaseAttempt; } });
|
|
36
|
+
var event_data_collector_1 = require("./event_data_collector");
|
|
37
|
+
Object.defineProperty(exports, "EventDataCollector", { enumerable: true, get: function () { return __importDefault(event_data_collector_1).default; } });
|
|
38
|
+
var keyword_type_1 = require("./keyword_type");
|
|
39
|
+
Object.defineProperty(exports, "KeywordType", { enumerable: true, get: function () { return keyword_type_1.KeywordType; } });
|
|
40
|
+
Object.defineProperty(exports, "getStepKeywordType", { enumerable: true, get: function () { return keyword_type_1.getStepKeywordType; } });
|
|
41
|
+
var issue_helpers_1 = require("./issue_helpers");
|
|
42
|
+
Object.defineProperty(exports, "formatIssue", { enumerable: true, get: function () { return issue_helpers_1.formatIssue; } });
|
|
43
|
+
Object.defineProperty(exports, "isWarning", { enumerable: true, get: function () { return issue_helpers_1.isWarning; } });
|
|
44
|
+
Object.defineProperty(exports, "isFailure", { enumerable: true, get: function () { return issue_helpers_1.isFailure; } });
|
|
45
|
+
Object.defineProperty(exports, "isIssue", { enumerable: true, get: function () { return issue_helpers_1.isIssue; } });
|
|
46
|
+
var location_helpers_1 = require("./location_helpers");
|
|
47
|
+
Object.defineProperty(exports, "formatLocation", { enumerable: true, get: function () { return location_helpers_1.formatLocation; } });
|
|
48
|
+
var summary_helpers_1 = require("./summary_helpers");
|
|
49
|
+
Object.defineProperty(exports, "formatSummary", { enumerable: true, get: function () { return summary_helpers_1.formatSummary; } });
|
|
50
|
+
var usage_helpers_1 = require("./usage_helpers");
|
|
51
|
+
Object.defineProperty(exports, "getUsage", { enumerable: true, get: function () { return usage_helpers_1.getUsage; } });
|
|
52
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/formatter/helpers/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iFAAkE;AAUzD,sDAAqB;AAT9B,8DAA+C;AASf,oCAAY;AAP5C,uEAAiE;AAAxD,gIAAA,oBAAoB,OAAA;AAC7B,+DAAsE;AAA7D,2IAAA,OAAO,OAAsB;AACtC,+CAAgE;AAAvD,2GAAA,WAAW,OAAA;AAAE,kHAAA,kBAAkB,OAAA;AACxC,iDAA4E;AAAnE,4GAAA,WAAW,OAAA;AAAE,0GAAA,SAAS,OAAA;AAAE,0GAAA,SAAS,OAAA;AAAE,wGAAA,OAAO,OAAA;AACnD,uDAAmD;AAA1C,kHAAA,cAAc,OAAA;AACvB,qDAAiD;AAAxC,gHAAA,aAAa,OAAA;AACtB,iDAA0C;AAAjC,yGAAA,QAAQ,OAAA","sourcesContent":["import * as GherkinDocumentParser from './gherkin_document_parser'\nimport * as PickleParser from './pickle_parser'\n\nexport { parseTestCaseAttempt } from './test_case_attempt_parser'\nexport { default as EventDataCollector } from './event_data_collector'\nexport { KeywordType, getStepKeywordType } from './keyword_type'\nexport { formatIssue, isWarning, isFailure, isIssue } from './issue_helpers'\nexport { formatLocation } from './location_helpers'\nexport { formatSummary } from './summary_helpers'\nexport { getUsage } from './usage_helpers'\nexport { GherkinDocumentParser, PickleParser }\n"]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as messages from '@cucumber/messages';
|
|
2
|
+
import { IColorFns } from '../get_color_fns';
|
|
3
|
+
import StepDefinitionSnippetBuilder from '../step_definition_snippet_builder';
|
|
4
|
+
import { ISupportCodeLibrary } from '../../support_code_library_builder/types';
|
|
5
|
+
import { ITestCaseAttempt } from './event_data_collector';
|
|
6
|
+
export declare function isFailure(result: messages.TestStepResult, willBeRetried?: boolean): boolean;
|
|
7
|
+
export declare function isWarning(result: messages.TestStepResult, willBeRetried?: boolean): boolean;
|
|
8
|
+
export declare function isIssue(result: messages.TestStepResult): boolean;
|
|
9
|
+
export interface IFormatIssueRequest {
|
|
10
|
+
colorFns: IColorFns;
|
|
11
|
+
number: number;
|
|
12
|
+
snippetBuilder: StepDefinitionSnippetBuilder;
|
|
13
|
+
testCaseAttempt: ITestCaseAttempt;
|
|
14
|
+
supportCodeLibrary: ISupportCodeLibrary;
|
|
15
|
+
printAttachments?: boolean;
|
|
16
|
+
}
|
|
17
|
+
export declare function formatIssue({ colorFns, number, snippetBuilder, testCaseAttempt, supportCodeLibrary, printAttachments, }: IFormatIssueRequest): string;
|
|
18
|
+
export declare function formatUndefinedParameterTypes(undefinedParameterTypes: messages.UndefinedParameterType[]): string;
|
|
19
|
+
export declare function formatUndefinedParameterType(parameterType: messages.UndefinedParameterType): string;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.formatUndefinedParameterType = exports.formatUndefinedParameterTypes = exports.formatIssue = exports.isIssue = exports.isWarning = exports.isFailure = void 0;
|
|
7
|
+
const indent_string_1 = __importDefault(require("indent-string"));
|
|
8
|
+
const test_case_attempt_formatter_1 = require("./test_case_attempt_formatter");
|
|
9
|
+
function isFailure(result, willBeRetried = false) {
|
|
10
|
+
return (result.status === 'AMBIGUOUS' ||
|
|
11
|
+
result.status === 'UNDEFINED' ||
|
|
12
|
+
(result.status === 'FAILED' && !willBeRetried));
|
|
13
|
+
}
|
|
14
|
+
exports.isFailure = isFailure;
|
|
15
|
+
function isWarning(result, willBeRetried = false) {
|
|
16
|
+
return (result.status === 'PENDING' || (result.status === 'FAILED' && willBeRetried));
|
|
17
|
+
}
|
|
18
|
+
exports.isWarning = isWarning;
|
|
19
|
+
function isIssue(result) {
|
|
20
|
+
return isFailure(result) || isWarning(result);
|
|
21
|
+
}
|
|
22
|
+
exports.isIssue = isIssue;
|
|
23
|
+
function formatIssue({ colorFns, number, snippetBuilder, testCaseAttempt, supportCodeLibrary, printAttachments = true, }) {
|
|
24
|
+
const prefix = `${number.toString()}) `;
|
|
25
|
+
const formattedTestCaseAttempt = (0, test_case_attempt_formatter_1.formatTestCaseAttempt)({
|
|
26
|
+
colorFns,
|
|
27
|
+
snippetBuilder,
|
|
28
|
+
testCaseAttempt,
|
|
29
|
+
supportCodeLibrary,
|
|
30
|
+
printAttachments,
|
|
31
|
+
});
|
|
32
|
+
const lines = formattedTestCaseAttempt.split('\n');
|
|
33
|
+
const updatedLines = lines.map((line, index) => {
|
|
34
|
+
if (index === 0) {
|
|
35
|
+
return `${prefix}${line}`;
|
|
36
|
+
}
|
|
37
|
+
return (0, indent_string_1.default)(line, prefix.length);
|
|
38
|
+
});
|
|
39
|
+
return updatedLines.join('\n');
|
|
40
|
+
}
|
|
41
|
+
exports.formatIssue = formatIssue;
|
|
42
|
+
function formatUndefinedParameterTypes(undefinedParameterTypes) {
|
|
43
|
+
const output = [`Undefined parameter types:\n\n`];
|
|
44
|
+
const withLatest = {};
|
|
45
|
+
undefinedParameterTypes.forEach((parameterType) => {
|
|
46
|
+
withLatest[parameterType.name] = parameterType;
|
|
47
|
+
});
|
|
48
|
+
output.push(Object.values(withLatest)
|
|
49
|
+
.map((parameterType) => `- ${formatUndefinedParameterType(parameterType)}`)
|
|
50
|
+
.join('\n'));
|
|
51
|
+
output.push('\n\n');
|
|
52
|
+
return output.join('');
|
|
53
|
+
}
|
|
54
|
+
exports.formatUndefinedParameterTypes = formatUndefinedParameterTypes;
|
|
55
|
+
function formatUndefinedParameterType(parameterType) {
|
|
56
|
+
return `"${parameterType.name}" e.g. \`${parameterType.expression}\``;
|
|
57
|
+
}
|
|
58
|
+
exports.formatUndefinedParameterType = formatUndefinedParameterType;
|
|
59
|
+
//# sourceMappingURL=issue_helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"issue_helpers.js","sourceRoot":"","sources":["../../../src/formatter/helpers/issue_helpers.ts"],"names":[],"mappings":";;;;;;AAAA,kEAAwC;AACxC,+EAAqE;AAOrE,SAAgB,SAAS,CACvB,MAA+B,EAC/B,gBAAyB,KAAK;IAE9B,OAAO,CACL,MAAM,CAAC,MAAM,KAAK,WAAW;QAC7B,MAAM,CAAC,MAAM,KAAK,WAAW;QAC7B,CAAC,MAAM,CAAC,MAAM,KAAK,QAAQ,IAAI,CAAC,aAAa,CAAC,CAC/C,CAAA;AACH,CAAC;AATD,8BASC;AAED,SAAgB,SAAS,CACvB,MAA+B,EAC/B,gBAAyB,KAAK;IAE9B,OAAO,CACL,MAAM,CAAC,MAAM,KAAK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A;IACF,MAAM,CAAC,IAAI,CACT,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC;SACtB,GAAG,CACF,CAAC,aAAa,EAAE,EAAE,CAAC,KAAK,4BAA4B,CAAC,aAAa,CAAC,EAAE,CACtE;SACA,IAAI,CAAC,IAAI,CAAC,CACd,CAAA;IACD,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;IACnB,OAAO,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AACxB,CAAC;AAjBD,sEAiBC;AAED,SAAgB,4BAA4B,CAC1C,aAA8C;IAE9C,OAAO,IAAI,aAAa,CAAC,IAAI,YAAY,aAAa,CAAC,UAAU,IAAI,CAAA;AACvE,CAAC;AAJD,oEAIC","sourcesContent":["import indentString from 'indent-string'\nimport { formatTestCaseAttempt } from './test_case_attempt_formatter'\nimport * as messages from '@cucumber/messages'\nimport { IColorFns } from '../get_color_fns'\nimport StepDefinitionSnippetBuilder from '../step_definition_snippet_builder'\nimport { ISupportCodeLibrary } from '../../support_code_library_builder/types'\nimport { ITestCaseAttempt } from './event_data_collector'\n\nexport function isFailure(\n result: messages.TestStepResult,\n willBeRetried: boolean = false\n): boolean {\n return (\n result.status === 'AMBIGUOUS' ||\n result.status === 'UNDEFINED' ||\n (result.status === 'FAILED' && !willBeRetried)\n )\n}\n\nexport function isWarning(\n result: messages.TestStepResult,\n willBeRetried: boolean = false\n): boolean {\n return (\n result.status === 'PENDING' || (result.status === 'FAILED' && willBeRetried)\n )\n}\n\nexport function isIssue(result: messages.TestStepResult): boolean {\n return isFailure(result) || isWarning(result)\n}\n\nexport interface IFormatIssueRequest {\n colorFns: IColorFns\n number: number\n snippetBuilder: StepDefinitionSnippetBuilder\n testCaseAttempt: ITestCaseAttempt\n supportCodeLibrary: ISupportCodeLibrary\n printAttachments?: boolean\n}\n\nexport function formatIssue({\n colorFns,\n number,\n snippetBuilder,\n testCaseAttempt,\n supportCodeLibrary,\n printAttachments = true,\n}: IFormatIssueRequest): string {\n const prefix = `${number.toString()}) `\n const formattedTestCaseAttempt = formatTestCaseAttempt({\n colorFns,\n snippetBuilder,\n testCaseAttempt,\n supportCodeLibrary,\n printAttachments,\n })\n const lines = formattedTestCaseAttempt.split('\\n')\n const updatedLines = lines.map((line, index) => {\n if (index === 0) {\n return `${prefix}${line}`\n }\n return indentString(line, prefix.length)\n })\n return updatedLines.join('\\n')\n}\n\nexport function formatUndefinedParameterTypes(\n undefinedParameterTypes: messages.UndefinedParameterType[]\n): string {\n const output = [`Undefined parameter types:\\n\\n`]\n const withLatest: Record<string, messages.UndefinedParameterType> = {}\n undefinedParameterTypes.forEach((parameterType) => {\n withLatest[parameterType.name] = parameterType\n })\n output.push(\n Object.values(withLatest)\n .map(\n (parameterType) => `- ${formatUndefinedParameterType(parameterType)}`\n )\n .join('\\n')\n )\n output.push('\\n\\n')\n return output.join('')\n}\n\nexport function formatUndefinedParameterType(\n parameterType: messages.UndefinedParameterType\n): string {\n return `\"${parameterType.name}\" e.g. \\`${parameterType.expression}\\``\n}\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare enum KeywordType {
|
|
2
|
+
Precondition = "precondition",
|
|
3
|
+
Event = "event",
|
|
4
|
+
Outcome = "outcome"
|
|
5
|
+
}
|
|
6
|
+
export interface IGetStepKeywordTypeOptions {
|
|
7
|
+
keyword: string;
|
|
8
|
+
language: string;
|
|
9
|
+
previousKeywordType?: KeywordType;
|
|
10
|
+
}
|
|
11
|
+
export declare function getStepKeywordType({ keyword, language, previousKeywordType, }: IGetStepKeywordTypeOptions): KeywordType;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getStepKeywordType = exports.KeywordType = void 0;
|
|
4
|
+
const gherkin_1 = require("@cucumber/gherkin");
|
|
5
|
+
const value_checker_1 = require("../../value_checker");
|
|
6
|
+
var KeywordType;
|
|
7
|
+
(function (KeywordType) {
|
|
8
|
+
KeywordType["Precondition"] = "precondition";
|
|
9
|
+
KeywordType["Event"] = "event";
|
|
10
|
+
KeywordType["Outcome"] = "outcome";
|
|
11
|
+
})(KeywordType = exports.KeywordType || (exports.KeywordType = {}));
|
|
12
|
+
function getStepKeywordType({ keyword, language, previousKeywordType, }) {
|
|
13
|
+
const dialect = gherkin_1.dialects[language];
|
|
14
|
+
const stepKeywords = ['given', 'when', 'then', 'and', 'but'];
|
|
15
|
+
const type = stepKeywords.find((key) => dialect[key].includes(keyword));
|
|
16
|
+
switch (type) {
|
|
17
|
+
case 'when':
|
|
18
|
+
return KeywordType.Event;
|
|
19
|
+
case 'then':
|
|
20
|
+
return KeywordType.Outcome;
|
|
21
|
+
case 'and':
|
|
22
|
+
case 'but':
|
|
23
|
+
if ((0, value_checker_1.doesHaveValue)(previousKeywordType)) {
|
|
24
|
+
return previousKeywordType;
|
|
25
|
+
}
|
|
26
|
+
// fallthrough
|
|
27
|
+
default:
|
|
28
|
+
return KeywordType.Precondition;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
exports.getStepKeywordType = getStepKeywordType;
|
|
32
|
+
//# sourceMappingURL=keyword_type.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keyword_type.js","sourceRoot":"","sources":["../../../src/formatter/helpers/keyword_type.ts"],"names":[],"mappings":";;;AAAA,+CAAqD;AACrD,uDAAmD;AAEnD,IAAY,WAIX;AAJD,WAAY,WAAW;IACrB,4CAA6B,CAAA;IAC7B,8BAAe,CAAA;IACf,kCAAmB,CAAA;AACrB,CAAC,EAJW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAItB;AAQD,SAAgB,kBAAkB,CAAC,EACjC,OAAO,EACP,QAAQ,EACR,mBAAmB,GACQ;IAC3B,MAAM,OAAO,GAAY,kBAAQ,CAAC,QAAQ,CAAC,CAAA;IAC3C,MAAM,YAAY,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,CAAU,CAAA;IACrE,MAAM,IAAI,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAA;IACvE,QAAQ,IAAI,EAAE;QACZ,KAAK,MAAM;YACT,OAAO,WAAW,CAAC,KAAK,CAAA;QAC1B,KAAK,MAAM;YACT,OAAO,WAAW,CAAC,OAAO,CAAA;QAC5B,KAAK,KAAK,CAAC;QACX,KAAK,KAAK;YACR,IAAI,IAAA,6BAAa,EAAC,mBAAmB,CAAC,EAAE;gBACtC,OAAO,mBAAmB,CAAA;aAC3B;QACH,cAAc;QACd;YACE,OAAO,WAAW,CAAC,YAAY,CAAA;KAClC;AACH,CAAC;AAtBD,gDAsBC","sourcesContent":["import { Dialect, dialects } from '@cucumber/gherkin'\nimport { doesHaveValue } from '../../value_checker'\n\nexport enum KeywordType {\n Precondition = 'precondition',\n Event = 'event',\n Outcome = 'outcome',\n}\n\nexport interface IGetStepKeywordTypeOptions {\n keyword: string\n language: string\n previousKeywordType?: KeywordType\n}\n\nexport function getStepKeywordType({\n keyword,\n language,\n previousKeywordType,\n}: IGetStepKeywordTypeOptions): KeywordType {\n const dialect: Dialect = dialects[language]\n const stepKeywords = ['given', 'when', 'then', 'and', 'but'] as const\n const type = stepKeywords.find((key) => dialect[key].includes(keyword))\n switch (type) {\n case 'when':\n return KeywordType.Event\n case 'then':\n return KeywordType.Outcome\n case 'and':\n case 'but':\n if (doesHaveValue(previousKeywordType)) {\n return previousKeywordType\n }\n // fallthrough\n default:\n return KeywordType.Precondition\n }\n}\n"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.formatLocation = void 0;
|
|
7
|
+
const path_1 = __importDefault(require("path"));
|
|
8
|
+
const value_checker_1 = require("../../value_checker");
|
|
9
|
+
function formatLocation(obj, cwd) {
|
|
10
|
+
let uri = obj.uri;
|
|
11
|
+
if ((0, value_checker_1.doesHaveValue)(cwd)) {
|
|
12
|
+
uri = path_1.default.relative(cwd, uri);
|
|
13
|
+
}
|
|
14
|
+
return `${uri}:${obj.line.toString()}`;
|
|
15
|
+
}
|
|
16
|
+
exports.formatLocation = formatLocation;
|
|
17
|
+
//# sourceMappingURL=location_helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"location_helpers.js","sourceRoot":"","sources":["../../../src/formatter/helpers/location_helpers.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAuB;AACvB,uDAAmD;AAGnD,SAAgB,cAAc,CAAC,GAAgB,EAAE,GAAY;IAC3D,IAAI,GAAG,GAAG,GAAG,CAAC,GAAG,CAAA;IACjB,IAAI,IAAA,6BAAa,EAAC,GAAG,CAAC,EAAE;QACtB,GAAG,GAAG,cAAI,CAAC,QAAQ,CAAC,GAAG,EAAE,GAAG,CAAC,CAAA;KAC9B;IACD,OAAO,GAAG,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE,CAAA;AACxC,CAAC;AAND,wCAMC","sourcesContent":["import path from 'path'\nimport { doesHaveValue } from '../../value_checker'\nimport { ILineAndUri } from '../../types'\n\nexport function formatLocation(obj: ILineAndUri, cwd?: string): string {\n let uri = obj.uri\n if (doesHaveValue(cwd)) {\n uri = path.relative(cwd, uri)\n }\n return `${uri}:${obj.line.toString()}`\n}\n"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as messages from '@cucumber/messages';
|
|
2
|
+
export interface IGetPickleLocationRequest {
|
|
3
|
+
gherkinDocument: messages.GherkinDocument;
|
|
4
|
+
pickle: messages.Pickle;
|
|
5
|
+
}
|
|
6
|
+
export interface IGetStepKeywordRequest {
|
|
7
|
+
pickleStep: messages.PickleStep;
|
|
8
|
+
gherkinStepMap: Record<string, messages.Step>;
|
|
9
|
+
}
|
|
10
|
+
export interface IGetScenarioDescriptionRequest {
|
|
11
|
+
pickle: messages.Pickle;
|
|
12
|
+
gherkinScenarioMap: Record<string, messages.Scenario>;
|
|
13
|
+
}
|
|
14
|
+
export declare function getScenarioDescription({ pickle, gherkinScenarioMap, }: IGetScenarioDescriptionRequest): string;
|
|
15
|
+
export declare function getStepKeyword({ pickleStep, gherkinStepMap, }: IGetStepKeywordRequest): string;
|
|
16
|
+
export declare function getPickleStepMap(pickle: messages.Pickle): Record<string, messages.PickleStep>;
|
|
17
|
+
export declare function getPickleLocation({ gherkinDocument, pickle, }: IGetPickleLocationRequest): messages.Location;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getPickleLocation = exports.getPickleStepMap = exports.getStepKeyword = exports.getScenarioDescription = void 0;
|
|
4
|
+
const gherkin_document_parser_1 = require("./gherkin_document_parser");
|
|
5
|
+
function getScenarioDescription({ pickle, gherkinScenarioMap, }) {
|
|
6
|
+
return pickle.astNodeIds
|
|
7
|
+
.map((id) => gherkinScenarioMap[id])
|
|
8
|
+
.filter((x) => x != null)[0].description;
|
|
9
|
+
}
|
|
10
|
+
exports.getScenarioDescription = getScenarioDescription;
|
|
11
|
+
function getStepKeyword({ pickleStep, gherkinStepMap, }) {
|
|
12
|
+
return pickleStep.astNodeIds
|
|
13
|
+
.map((id) => gherkinStepMap[id])
|
|
14
|
+
.filter((x) => x != null)[0].keyword;
|
|
15
|
+
}
|
|
16
|
+
exports.getStepKeyword = getStepKeyword;
|
|
17
|
+
function getPickleStepMap(pickle) {
|
|
18
|
+
const result = {};
|
|
19
|
+
pickle.steps.forEach((pickleStep) => (result[pickleStep.id] = pickleStep));
|
|
20
|
+
return result;
|
|
21
|
+
}
|
|
22
|
+
exports.getPickleStepMap = getPickleStepMap;
|
|
23
|
+
function getPickleLocation({ gherkinDocument, pickle, }) {
|
|
24
|
+
const gherkinScenarioLocationMap = (0, gherkin_document_parser_1.getGherkinScenarioLocationMap)(gherkinDocument);
|
|
25
|
+
return gherkinScenarioLocationMap[pickle.astNodeIds[pickle.astNodeIds.length - 1]];
|
|
26
|
+
}
|
|
27
|
+
exports.getPickleLocation = getPickleLocation;
|
|
28
|
+
//# sourceMappingURL=pickle_parser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pickle_parser.js","sourceRoot":"","sources":["../../../src/formatter/helpers/pickle_parser.ts"],"names":[],"mappings":";;;AAAA,uEAAyE;AAkBzE,SAAgB,sBAAsB,CAAC,EACrC,MAAM,EACN,kBAAkB,GACa;IAC/B,OAAO,MAAM,CAAC,UAAU;SACrB,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,kBAAkB,CAAC,EAAE,CAAC,CAAC;SACnC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,CAAA;AAC5C,CAAC;AAPD,wDAOC;AAED,SAAgB,cAAc,CAAC,EAC7B,UAAU,EACV,cAAc,GACS;IACvB,OAAO,UAAU,CAAC,UAAU;SACzB,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,cAAc,CAAC,EAAE,CAAC,CAAC;SAC/B,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAA;AACxC,CAAC;AAPD,wCAOC;AAED,SAAgB,gBAAgB,CAC9B,MAAuB;IAEvB,MAAM,MAAM,GAAwC,EAAE,CAAA;IACtD,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,EAAE,CAAC,GAAG,UAAU,CAAC,CAAC,CAAA;IAC1E,OAAO,MAAM,CAAA;AACf,CAAC;AAND,4CAMC;AAED,SAAgB,iBAAiB,CAAC,EAChC,eAAe,EACf,MAAM,GACoB;IAC1B,MAAM,0BAA0B,GAC9B,IAAA,uDAA6B,EAAC,eAAe,CAAC,CAAA;IAChD,OAAO,0BAA0B,CAC/B,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC,CAChD,CAAA;AACH,CAAC;AATD,8CASC","sourcesContent":["import { getGherkinScenarioLocationMap } from './gherkin_document_parser'\nimport * as messages from '@cucumber/messages'\n\nexport interface IGetPickleLocationRequest {\n gherkinDocument: messages.GherkinDocument\n pickle: messages.Pickle\n}\n\nexport interface IGetStepKeywordRequest {\n pickleStep: messages.PickleStep\n gherkinStepMap: Record<string, messages.Step>\n}\n\nexport interface IGetScenarioDescriptionRequest {\n pickle: messages.Pickle\n gherkinScenarioMap: Record<string, messages.Scenario>\n}\n\nexport function getScenarioDescription({\n pickle,\n gherkinScenarioMap,\n}: IGetScenarioDescriptionRequest): string {\n return pickle.astNodeIds\n .map((id) => gherkinScenarioMap[id])\n .filter((x) => x != null)[0].description\n}\n\nexport function getStepKeyword({\n pickleStep,\n gherkinStepMap,\n}: IGetStepKeywordRequest): string {\n return pickleStep.astNodeIds\n .map((id) => gherkinStepMap[id])\n .filter((x) => x != null)[0].keyword\n}\n\nexport function getPickleStepMap(\n pickle: messages.Pickle\n): Record<string, messages.PickleStep> {\n const result: Record<string, messages.PickleStep> = {}\n pickle.steps.forEach((pickleStep) => (result[pickleStep.id] = pickleStep))\n return result\n}\n\nexport function getPickleLocation({\n gherkinDocument,\n pickle,\n}: IGetPickleLocationRequest): messages.Location {\n const gherkinScenarioLocationMap =\n getGherkinScenarioLocationMap(gherkinDocument)\n return gherkinScenarioLocationMap[\n pickle.astNodeIds[pickle.astNodeIds.length - 1]\n ]\n}\n"]}
|