@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 @@
|
|
|
1
|
+
{"version":3,"file":"bvt_analysis_formatter.js","sourceRoot":"","sources":["../../src/formatter/bvt_analysis_formatter.ts"],"names":[],"mappings":";;;;;;AACA,iDAAqC;AACrC,2BAA4D;AAC5D,0CAAsD;AACtD,gDAAuB;AACvB,6BAA6B;AAC7B,yCAAgD;AAChD,oDAAgD;AAChD,kFAKmC;AACnC,kEAA+C;AAC/C,4CAAmB;AACnB,+BAA6C;AAC7C,4EAAkD;AAClD,mDAAgE;AAChE,gEAA2D;AAK3D,+BAAiC;AACjC,iDAAqC;AAErC,YAAY;AACZ,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,KAAK,CAAA;AAQ/B,MAAqB,oBAAqB,SAAQ,UAAS;IAiBzD,YAAY,OAA0B;QACpC,KAAK,CAAC,OAAO,CAAC,CAAA;QAbR,oBAAe,GAAG,IAAI,0BAAe,EAAE,CAAA;QACvC,aAAQ,GAAG,IAAI,kBAAc,CAAC,IAAI,CAAC,eAAe,CAAC,CAAA;QACnD,SAAI,GAAG,KAAK,CAAA;QAKZ,mBAAc,GAGhB,EAAE,CAAA;QAIN,IAAI,CAAC,gBAAgB,GAAG,IAAI,2BAAgB,CAAC,OAAO,CAAC,CAAA;QACrD,oBAAoB,CAAC,eAAe,GAAG,IAAI,CAAC,eAAe,CAAA;QAC3D,IAAI,CAAC,cAAc,GAAG,EAAE,CAAA;QACxB,IAAI,CAAC,gBAAgB,GAAG,EAAE,CAAA;QAC1B,oBAAoB,CAAC,qBAAqB,GAAG,OAAO,CAAC,GAAG,CAAC,KAAK;YAC5D,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC;YAC/B,CAAC,CAAC,IAAI,CAAA;QAER,IAAI,CAAC,KAAK,IAAI,OAAO,CAAC,GAAG,CAAC,aAA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UAAkB;IACvD,IAAI,IAAA,eAAU,EAAC,wBAAwB,CAAC,EAAE;QACxC,MAAM,SAAS,GAAG,IAAA,gBAAS,EAAC,oBAAI,CAAC,CAAC;QAClC,SAAS,CAAC,4BAA4B,GAAG,UAAU,CAAC,CAAC;KACtD;AACH,CAAC","sourcesContent":["import { Envelope, Meta } from '@cucumber/messages'\nimport { spawn } from 'child_process'\nimport { readFileSync, existsSync, writeFileSync } from 'fs'\nimport { mkdir, unlink, writeFile } from 'fs/promises'\nimport path from 'path'\nimport { tmpName } from 'tmp'\nimport Formatter, { IFormatterOptions } from '.'\nimport { doesHaveValue } from '../value_checker'\nimport ReportGenerator, {\n JsonReport,\n JsonTestProgress,\n JsonTestResult,\n RetrainStats,\n} from './helpers/report_generator'\nimport ReportUploader from './helpers/uploader'\nimport os from 'os'\nimport { getProjectByAccessKey } from './api'\nimport SummaryFormatter from './summary_formatter'\nimport { ActionEvents, SERVICES_URI } from './helpers/constants'\nimport { axiosClient } from '../configuration/axios_client'\nimport {\n FinishTestCaseResponse,\n RootCauseProps,\n} from './helpers/upload_serivce'\nimport { promisify } from 'util';\nimport { exec } from 'child_process';\n\n//User token\nconst TOKEN = process.env.TOKEN\ninterface MetaMessage extends Meta {\n runName: string\n}\n\ninterface EnvelopeWithMetaMessage extends Envelope {\n meta: MetaMessage\n}\nexport default class BVTAnalysisFormatter extends Formatter {\n static reportGenerator: ReportGenerator\n static reRunFailedStepsIndex:\n | { testCaseId: string; failedStepIndex: number }[]\n | null\n private reportGenerator = new ReportGenerator()\n private uploader = new ReportUploader(this.reportGenerator)\n private exit = false\n private START: number\n private runName: string\n private failedStepsIndex: { testCaseId: string; failedStepIndex: number }[]\n private summaryFormatter: SummaryFormatter\n private rootCauseArray: {\n rootCause: RootCauseProps\n report: JsonTestProgress\n }[] = []\n\n constructor(options: IFormatterOptions) {\n super(options)\n this.summaryFormatter = new SummaryFormatter(options)\n BVTAnalysisFormatter.reportGenerator = this.reportGenerator\n this.rootCauseArray = []\n this.failedStepsIndex = []\n BVTAnalysisFormatter.reRunFailedStepsIndex = process.env.RERUN\n ? JSON.parse(process.env.RERUN)\n : null\n\n if (!TOKEN && process.env.BVT_FORMATTER === 'ANALYSIS') {\n throw new Error('TOKEN must be set')\n }\n this.sendEvent(ActionEvents.cli_run_tests)\n options.eventBroadcaster.on(\n 'envelope',\n async (envelope: EnvelopeWithMetaMessage, data?: any) => {\n if (doesHaveValue(envelope.testCaseFinished) && data) {\n const { rootCause, report } = data as FinishTestCaseResponse\n\n if (!rootCause.status) {\n console.error(\n `Root cause: ${rootCause.failClass}\\n, ${rootCause.analysis}\\nfailing step: ${rootCause.failedStep}`\n )\n this.rootCauseArray.push({ rootCause, report })\n this.failedStepsIndex.push({\n testCaseId: report.id,\n failedStepIndex: rootCause.failedStep,\n })\n }\n return\n }\n await this.reportGenerator.handleMessage(envelope)\n\n if (\n doesHaveValue(envelope.meta) &&\n doesHaveValue(envelope.meta.runName)\n ) {\n this.runName = envelope.meta.runName\n }\n if (doesHaveValue(envelope.testRunFinished)) {\n this.START = Date.now()\n if (process.env.BVT_FORMATTER === 'ANALYSIS') {\n await this.analyzeReport()\n } else {\n // await this.uploadReport(report)\n }\n this.exit = true\n }\n }\n )\n }\n\n private sendEvent(event: ActionEvents) {\n axiosClient\n .post(\n `${SERVICES_URI.STORAGE}/event`,\n {\n event,\n },\n {\n headers: {\n Authorization: `Bearer ${TOKEN}`,\n 'x-source': 'cucumber_js',\n },\n }\n )\n .catch((err) => {\n // Error with events, ignoring\n })\n }\n\n private async uploadReport(report: JsonReport) {\n const uploadSuccessful = await this.uploadFinalReport(report)\n if (uploadSuccessful && report.result.status !== 'FAILED') {\n process.exit(0)\n }\n process.exit(1)\n }\n\n async finished(): Promise<any> {\n await new Promise((resolve) => {\n const checkInterval = setInterval(() => {\n let anyRem\n if (process.env.UPLOADING_TEST_CASE) {\n anyRem = JSON.parse(process.env.UPLOADING_TEST_CASE) as string[]\n } else {\n anyRem = undefined\n }\n\n if (this.exit && (!anyRem || anyRem.length === 0)) {\n // clearInterval(checkInterval)\n // resolve(null)\n if (this.reportGenerator.getReport().result.status === 'FAILED') {\n process.exit(1)\n } else {\n process.exit(0)\n }\n }\n }, 100) // check every 100ms\n })\n }\n private async analyzeReport() {\n if (\n this.rootCauseArray.length === 0 ||\n process.env.NO_RETRAIN === 'false'\n ) {\n if (this.rootCauseArray.length === 0) {\n this.log('No test failed. No need to retrain\\n')\n }\n if (process.env.NO_RETRAIN === 'false') {\n this.log(\n 'Retraining is skipped since the failed step contains an API request\\n'\n )\n }\n // const uploadSuccessful = await this.uploadFinalReport(report)\n // process.exit(0)\n this.exit = true\n return\n }\n\n //checking if the type of report.result is JsonResultFailed or not\n\n this.log('Some tests failed, starting the retraining...\\n')\n await this.processTestCases()\n if (this.reportGenerator.getReport().result.status === 'FAILED') {\n process.exit(1)\n }\n process.exit(0)\n }\n private async processTestCases() {\n for (const { rootCause, report } of this.rootCauseArray) {\n await this.processTestCase(rootCause, report)\n }\n }\n private async processTestCase(\n rootCause: RootCauseProps,\n report: JsonTestProgress\n ) {\n const failedTestSteps = rootCause.failedStep\n\n if (\n BVTAnalysisFormatter.reRunFailedStepsIndex &&\n BVTAnalysisFormatter.reRunFailedStepsIndex.length > 0\n ) {\n const previousRun = BVTAnalysisFormatter.reRunFailedStepsIndex[0]\n if (previousRun.failedStepIndex === failedTestSteps) {\n console.log('Same step has failed again, skipping retraining')\n BVTAnalysisFormatter.reRunFailedStepsIndex.shift()\n return\n }\n BVTAnalysisFormatter.reRunFailedStepsIndex.shift()\n }\n\n const retrainStats = await this.retrain(failedTestSteps, report)\n\n if (!retrainStats) {\n return\n }\n\n await this.uploader.modifyTestCase({\n ...report,\n retrainStats,\n })\n\n await this.rerun(report)\n }\n\n private async uploadFinalReport(finalReport: JsonReport) {\n let success = true\n try {\n const { projectId, runId } = await this.uploader.uploadRun(\n finalReport,\n this.runName\n )\n logReportLink(runId, projectId)\n } catch (err) {\n this.log('Error uploading report\\n')\n if ('stack' in err) {\n this.log(err.stack)\n }\n success = false\n } finally {\n try {\n writeFileSync(\n path.join(this.reportGenerator.reportFolder, 'report.json'),\n JSON.stringify(finalReport, null, 2),\n 'utf-8'\n )\n } catch (e) {\n console.error('failed to write report.json to local disk')\n }\n }\n\n //this.log(JSON.stringify(finalReport, null, 2))\n return success\n }\n private async retrain(\n failedTestCases: number,\n testCase: JsonTestProgress\n ): Promise<RetrainStats | null> {\n const data = await getProjectByAccessKey(TOKEN)\n const currentTimestampInSeconds = Math.floor(Date.now() / 1000)\n if (data.project.expriration_date < currentTimestampInSeconds) {\n console.log(\n 'Warning: Your project has expired, retraining is restricted. Please contact sales.'\n )\n process.exit(1)\n }\n return await this.call_cucumber_client(failedTestCases, testCase)\n }\n\n private async rerun(report: JsonTestProgress) {\n await new Promise<void>((resolve) => {\n const node_path = process.argv.shift()\n const args = [\n path.join(\n process.cwd(),\n 'node_modules',\n '@dev-blinq',\n 'cucumber-js',\n 'bin',\n 'cucumber.js'\n ),\n '--name',\n `^${report.scenarioName}$`,\n '--exit',\n '--format',\n 'bvt',\n '--run-name',\n `${report.scenarioName}@debug`,\n path.join(process.cwd(), 'features', `${report.featureName}.feature`),\n ]\n const cucumberClient = spawn(node_path, args, {\n env: {\n ...process.env,\n RERUN: JSON.stringify(this.failedStepsIndex),\n },\n })\n\n cucumberClient.stdout.on('data', (data) => {\n console.log(data.toString())\n })\n\n cucumberClient.stderr.on('data', (data) => {\n console.error(data.toString())\n })\n\n cucumberClient.on('close', () => {\n resolve()\n })\n })\n }\n\n private async call_cucumber_client(\n stepsToRetrain: number,\n testCase: JsonTestProgress\n ): Promise<RetrainStats | null> {\n return new Promise((resolve, reject) => {\n const cucumber_client_path = path.resolve(\n process.cwd(),\n 'node_modules',\n '@dev-blinq',\n 'cucumber_client',\n 'bin',\n 'client',\n 'cucumber.js'\n )\n\n const args: string[] = [\n process.cwd(),\n path.join(process.cwd(), testCase.uri),\n `${testCase.scenarioName}`,\n 'undefined',\n `${stepsToRetrain},`,\n ]\n\n if (process.env.BLINQ_ENV) {\n args.push(`--env=${process.env.BLINQ_ENV}`)\n }\n\n if (!existsSync(path.join(this.getAppDataDir(), 'blinq.io', '.temp'))) {\n mkdir(path.join(this.getAppDataDir(), 'blinq.io', '.temp'), {\n recursive: true,\n })\n }\n\n tmpName(async (err, name) => {\n const tempFile = path.join(\n this.getAppDataDir(),\n 'blinq.io',\n '.temp',\n path.basename(name)\n )\n console.log('File path: ', tempFile)\n await writeFile(tempFile, '', 'utf-8')\n\n args.push(`--temp-file=${tempFile}`)\n const cucumberClient = spawn('node', [cucumber_client_path, ...args], {\n env: {\n ...process.env,\n },\n })\n\n cucumberClient.stdout.on('data', (data) => {\n console.log(data.toString())\n })\n\n cucumberClient.stderr.on('data', (data) => {\n console.error(data.toString())\n })\n\n cucumberClient.on('close', async (code) => {\n if (code === 0) {\n const reportData = readFileSync(tempFile, 'utf-8')\n const retrainStats = JSON.parse(reportData) as RetrainStats\n await unlink(tempFile)\n resolve(retrainStats)\n } else {\n this.log('Error retraining\\n')\n try {\n const reportData = readFileSync(tempFile, 'utf-8')\n const retrainStats = JSON.parse(reportData) as RetrainStats\n await unlink(tempFile)\n resolve(retrainStats)\n } catch (e) {\n this.log('Error reading scenario report\\n ' + e)\n resolve(null)\n }\n }\n })\n })\n })\n }\n\n private getAppDataDir() {\n if (process.env.BLINQ_APPDATA_DIR) {\n return process.env.BLINQ_APPDATA_DIR\n }\n\n let appDataDir: string\n\n switch (process.platform) {\n case 'win32':\n appDataDir = process.env.APPDATA!\n break\n case 'darwin':\n appDataDir = path.join(os.homedir(), 'Library', 'Application Support')\n break\n default:\n appDataDir = path.join(os.homedir(), '.config')\n break\n }\n return appDataDir\n }\n}\n\nexport function logReportLink(runId: string, projectId: string) {\n let reportLinkBaseUrl = 'https://app.blinq.io'\n if (process.env.NODE_ENV_BLINQ === 'local') {\n reportLinkBaseUrl = 'http://localhost:3000'\n } else if (process.env.NODE_ENV_BLINQ === 'dev') {\n reportLinkBaseUrl = 'https://dev.app.blinq.io'\n } else if (process.env.NODE_ENV_BLINQ === 'stage') {\n reportLinkBaseUrl = 'https://stage.app.blinq.io'\n }\n const reportLink = `${reportLinkBaseUrl}/${projectId}/run-report/${runId}`\n console.log(`Report link: ${reportLink}\\n`)\n try {\n publishReportLinkToGuacServer(reportLink);\n } catch (err) {\n }\n}\n\nfunction publishReportLinkToGuacServer(reportLink: string) {\n if (existsSync(\"/tmp/report_publish.sh\")) {\n const execAsync = promisify(exec);\n execAsync(\"sh /tmp/report_publish.sh \" + reportLink);\n }\n}\n"]}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { TableCell } from '@cucumber/messages';
|
|
2
|
+
declare const generateTestData: (featureFileContent: string, vars?: any, fakeData?: {
|
|
3
|
+
var: string;
|
|
4
|
+
fake: string;
|
|
5
|
+
}[], projectDir?: string) => {
|
|
6
|
+
newContent: string;
|
|
7
|
+
variables: any;
|
|
8
|
+
otherFakeData: {
|
|
9
|
+
var: string;
|
|
10
|
+
fake: any;
|
|
11
|
+
}[];
|
|
12
|
+
changed: boolean;
|
|
13
|
+
fakeIndex: number;
|
|
14
|
+
};
|
|
15
|
+
declare const generateExamplesFromFunction: (data: string, feature_path: string, functionName: string, functionFile: string) => {
|
|
16
|
+
newData: string;
|
|
17
|
+
mjsData: any;
|
|
18
|
+
};
|
|
19
|
+
declare const generateExamplesFromFunctionGherkin: (headers: readonly TableCell[], values: readonly TableCell[], mjsData: any) => {
|
|
20
|
+
header: string;
|
|
21
|
+
value: any;
|
|
22
|
+
}[];
|
|
23
|
+
export { generateTestData, generateExamplesFromFunction, generateExamplesFromFunctionGherkin, };
|
|
@@ -0,0 +1,182 @@
|
|
|
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.generateExamplesFromFunctionGherkin = exports.generateExamplesFromFunction = exports.generateTestData = void 0;
|
|
7
|
+
const faker_1 = require("@faker-js/faker");
|
|
8
|
+
const fs_1 = __importDefault(require("fs"));
|
|
9
|
+
const path_1 = __importDefault(require("path"));
|
|
10
|
+
const json5_1 = __importDefault(require("json5"));
|
|
11
|
+
const generateTestData = (featureFileContent, vars, fakeData, projectDir) => {
|
|
12
|
+
const regexp = /\{\{([^}]*\([^)]*\))\}\}/g;
|
|
13
|
+
const variableRegex = /^([a-zA-Z0-9_]*)=(.*)/g;
|
|
14
|
+
let newContent = featureFileContent;
|
|
15
|
+
let match;
|
|
16
|
+
if (!projectDir) {
|
|
17
|
+
projectDir = process.cwd();
|
|
18
|
+
}
|
|
19
|
+
const namespacePath = path_1.default.join(projectDir, 'features', 'step_definitions', 'namespaces.json');
|
|
20
|
+
let namespaces = fs_1.default.existsSync(namespacePath)
|
|
21
|
+
? JSON.parse(fs_1.default.readFileSync(namespacePath, 'utf-8'))
|
|
22
|
+
: [];
|
|
23
|
+
if (!Array.isArray(namespaces)) {
|
|
24
|
+
namespaces = [];
|
|
25
|
+
}
|
|
26
|
+
const matches = [];
|
|
27
|
+
// collect all matches
|
|
28
|
+
while ((match = regexp.exec(featureFileContent)) !== null) {
|
|
29
|
+
// match[0] is the full match, match[1] is the first capturing group
|
|
30
|
+
// Eg:- match[0] = {{name}}, match[1] = name
|
|
31
|
+
if (!namespaces.includes(match[1].split('.')[0]))
|
|
32
|
+
matches.push(match);
|
|
33
|
+
}
|
|
34
|
+
// find all variables in the matches
|
|
35
|
+
const variables = { ...vars };
|
|
36
|
+
if (Object.keys(variables).length > 0) {
|
|
37
|
+
for (let i = 0; i < matches.length; i++) {
|
|
38
|
+
const _match = matches[i];
|
|
39
|
+
const value = _match[1];
|
|
40
|
+
const variableMatch = variableRegex.exec(value);
|
|
41
|
+
if (variableMatch !== null) {
|
|
42
|
+
newContent = newContent.replaceAll(_match[0], `{{${variableMatch[1]}}}`);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
for (const key in variables) {
|
|
46
|
+
const variable = variables[key];
|
|
47
|
+
newContent = newContent.replaceAll(`{{${variable.var}}}`, variable.fake);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
for (let i = 0; i < matches.length; i++) {
|
|
52
|
+
const _match = matches[i];
|
|
53
|
+
const value = _match[1];
|
|
54
|
+
const variableMatch = variableRegex.exec(value);
|
|
55
|
+
if (variableMatch !== null) {
|
|
56
|
+
variables[variableMatch[1]] = {
|
|
57
|
+
var: variableMatch[1],
|
|
58
|
+
toFake: variableMatch[2],
|
|
59
|
+
};
|
|
60
|
+
newContent = newContent.replaceAll(_match[0], `{{${variableMatch[1]}}}`);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
for (const key in variables) {
|
|
64
|
+
const variable = variables[key];
|
|
65
|
+
const fake = getFakeString(variable.toFake.substring(2, variable.toFake.length - 2));
|
|
66
|
+
newContent = newContent.replaceAll(`{{${variable.var}}}`, fake);
|
|
67
|
+
variables[key].fake = fake;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
regexp.lastIndex = 0;
|
|
71
|
+
const otherFakeData = [];
|
|
72
|
+
const duplicateFakeData = fakeData ? [...fakeData] : [];
|
|
73
|
+
let fakeIndex = 0;
|
|
74
|
+
while ((match = regexp.exec(featureFileContent)) !== null) {
|
|
75
|
+
if (namespaces.includes(match[1].split('.')[0]))
|
|
76
|
+
continue;
|
|
77
|
+
try {
|
|
78
|
+
const fake = duplicateFakeData &&
|
|
79
|
+
duplicateFakeData.length > 0 &&
|
|
80
|
+
duplicateFakeData[0].var === match[0]
|
|
81
|
+
? duplicateFakeData.shift().fake
|
|
82
|
+
: getFakeString(match[0].substring(2, match[0].length - 2));
|
|
83
|
+
otherFakeData.push({
|
|
84
|
+
var: match[0],
|
|
85
|
+
fake,
|
|
86
|
+
});
|
|
87
|
+
newContent = newContent.replace(match[0], fake);
|
|
88
|
+
fakeIndex++;
|
|
89
|
+
}
|
|
90
|
+
catch (err) {
|
|
91
|
+
// eslint-disable-next-line no-console
|
|
92
|
+
//console.log('unknown faker variable:' + match[0])
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
return {
|
|
96
|
+
newContent,
|
|
97
|
+
variables,
|
|
98
|
+
otherFakeData,
|
|
99
|
+
changed: newContent !== featureFileContent,
|
|
100
|
+
fakeIndex,
|
|
101
|
+
};
|
|
102
|
+
};
|
|
103
|
+
exports.generateTestData = generateTestData;
|
|
104
|
+
const getFakeString = (content) => {
|
|
105
|
+
// content example: helpers.fromRegExp('#{2,9}')
|
|
106
|
+
const faking = content.split('(')[0].split('.');
|
|
107
|
+
// faking example: ['helpers', 'fromRegExp']
|
|
108
|
+
const argument = content.substring(content.indexOf('(') + 1, content.lastIndexOf(')'));
|
|
109
|
+
// argument example: '#{2,9}'
|
|
110
|
+
let fakeFunc = faker_1.faker;
|
|
111
|
+
faking.forEach((f) => {
|
|
112
|
+
fakeFunc = fakeFunc[f];
|
|
113
|
+
});
|
|
114
|
+
let regexpParam = false;
|
|
115
|
+
if (faking.length === 2 && faking[1] === 'fromRegExp') {
|
|
116
|
+
regexpParam = true;
|
|
117
|
+
}
|
|
118
|
+
if (regexpParam) {
|
|
119
|
+
return fakeFunc(new RegExp(argument));
|
|
120
|
+
}
|
|
121
|
+
try {
|
|
122
|
+
return fakeFunc(json5_1.default.parse(argument));
|
|
123
|
+
}
|
|
124
|
+
catch (error) {
|
|
125
|
+
if (!argument) {
|
|
126
|
+
return fakeFunc();
|
|
127
|
+
}
|
|
128
|
+
return fakeFunc(argument);
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
const getDefinitionFunction = (feature_path, functionName, functionFile) => {
|
|
132
|
+
const mjsFiles = fs_1.default
|
|
133
|
+
.readdirSync(path_1.default.join(feature_path, '../step_definitions'))
|
|
134
|
+
.filter((file) => file === `${functionFile}.js`);
|
|
135
|
+
if (mjsFiles.length === 0) {
|
|
136
|
+
throw new Error(`File ${functionFile} not found in step_definitions folder`);
|
|
137
|
+
}
|
|
138
|
+
const [mjsData] = mjsFiles.map((file) => {
|
|
139
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
140
|
+
const { [functionName]: func } = require(path_1.default.join(feature_path, '../step_definitions', file));
|
|
141
|
+
if (!func)
|
|
142
|
+
throw new Error(`Function ${functionName} not found in file ${file}`);
|
|
143
|
+
return func();
|
|
144
|
+
});
|
|
145
|
+
return mjsData;
|
|
146
|
+
};
|
|
147
|
+
const generateExamplesFromFunction = (data, feature_path, functionName, functionFile) => {
|
|
148
|
+
const examples = data.split('Examples:')[1].split('\n').slice(1);
|
|
149
|
+
const headers = examples[0]
|
|
150
|
+
.split('|')
|
|
151
|
+
.map((header) => header.trim())
|
|
152
|
+
.filter((header) => header !== '');
|
|
153
|
+
const values = examples[1]
|
|
154
|
+
.split('|')
|
|
155
|
+
.map((value) => value.trim())
|
|
156
|
+
.filter((header) => header !== '');
|
|
157
|
+
const mjsData = getDefinitionFunction(feature_path, functionName, functionFile);
|
|
158
|
+
const newExamples = headers.map((header) => {
|
|
159
|
+
if (mjsData[header]) {
|
|
160
|
+
return mjsData[header];
|
|
161
|
+
}
|
|
162
|
+
return values[headers.indexOf(header)];
|
|
163
|
+
});
|
|
164
|
+
let newExamplesString = data.split('Examples:')[1];
|
|
165
|
+
newExamples.forEach((example, index) => {
|
|
166
|
+
newExamplesString = newExamplesString.replace(values[index], example);
|
|
167
|
+
});
|
|
168
|
+
const newData = data.replace(data.split('Examples:')[1], newExamplesString);
|
|
169
|
+
return { newData, mjsData };
|
|
170
|
+
};
|
|
171
|
+
exports.generateExamplesFromFunction = generateExamplesFromFunction;
|
|
172
|
+
const generateExamplesFromFunctionGherkin = (headers, values, mjsData) => {
|
|
173
|
+
const newExamples = headers.map(({ value: header }, index) => {
|
|
174
|
+
if (mjsData[header]) {
|
|
175
|
+
return { header, value: mjsData[header] };
|
|
176
|
+
}
|
|
177
|
+
return { header, value: values[index].value };
|
|
178
|
+
});
|
|
179
|
+
return newExamples;
|
|
180
|
+
};
|
|
181
|
+
exports.generateExamplesFromFunctionGherkin = generateExamplesFromFunctionGherkin;
|
|
182
|
+
//# sourceMappingURL=feature_data_format.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"feature_data_format.js","sourceRoot":"","sources":["../../src/formatter/feature_data_format.ts"],"names":[],"mappings":";;;;;;AAAA,2CAAuC;AACvC,4CAAmB;AACnB,gDAAuB;AAEvB,kDAAyB;AAEzB,MAAM,gBAAgB,GAAG,CACvB,kBAA0B,EAC1B,IAAU,EACV,QAGG,EACH,UAAmB,EACnB,EAAE;IACF,MAAM,MAAM,GAAG,2BAA2B,CAAA;IAC1C,MAAM,aAAa,GAAG,wBAAwB,CAAA;IAC9C,IAAI,UAAU,GAAG,kBAAkB,CAAA;IACnC,IAAI,KAAsB,CAAA;IAC1B,IAAI,CAAC,UAAU,EAAE;QACf,UAAU,GAAG,OAAO,CAAC,GAAG,EAAE,CAAA;KAC3B;IACD,MAAM,aAAa,GAAG,cAAI,CAAC,IAAI,CAC7B,UAAU,EACV,UAAU,EACV,kBAAkB,EAClB,iBAAiB,CAClB,CAAA;IACD,IAAI,UAAU,GAAa,YAAE,CAAC,UAAU,CAAC,aAAa,CAAC;QACrD,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,YAAE,CAAC,YAAY,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;QACrD,CAAC,CAAC,EAAE,CAAA;IACN,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE;QAC9B,UAAU,GAAG,EAAE,CAAA;KAChB;IACD,MAAM,OAAO,GAAG,EAAE,CAAA;IAClB,sBAAsB;IACtB,OAAO,CAAC,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,KAAK,IAAI,EAAE;QACzD,oEAAoE;QACpE,4CAA4C;Q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AiB,GAAG,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAA;IAClD,WAAW,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE;QACrC,iBAAiB,GAAG,iBAAiB,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC,CAAA;IACvE,CAAC,CAAC,CAAA;IAEF,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,EAAE,iBAAiB,CAAC,CAAA;IAE3E,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,CAAA;AAC7B,CAAC,CAAA;AAmBC,oEAA4B;AAjB9B,MAAM,mCAAmC,GAAG,CAC1C,OAA6B,EAC7B,MAA4B,EAC5B,OAAY,EACZ,EAAE;IACF,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,EAAE;QAC3D,IAAI,OAAO,CAAC,MAAM,CAAC,EAAE;YACnB,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,MAAM,CAAC,EAAE,CAAA;SAC1C;QACD,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,CAAA;IAC/C,CAAC,CAAC,CAAA;IAEF,OAAO,WAAW,CAAA;AACpB,CAAC,CAAA;AAKC,kFAAmC","sourcesContent":["import { faker } from '@faker-js/faker'\nimport fs from 'fs'\nimport path from 'path'\nimport { TableCell } from '@cucumber/messages'\nimport JSON5 from 'json5'\n\nconst generateTestData = (\n featureFileContent: string,\n vars?: any,\n fakeData?: {\n var: string\n fake: string\n }[],\n projectDir?: string\n) => {\n const regexp = /\\{\\{([^}]*\\([^)]*\\))\\}\\}/g\n const variableRegex = /^([a-zA-Z0-9_]*)=(.*)/g\n let newContent = featureFileContent\n let match: RegExpExecArray\n if (!projectDir) {\n projectDir = process.cwd()\n }\n const namespacePath = path.join(\n projectDir,\n 'features',\n 'step_definitions',\n 'namespaces.json'\n )\n let namespaces: string[] = fs.existsSync(namespacePath)\n ? JSON.parse(fs.readFileSync(namespacePath, 'utf-8'))\n : []\n if (!Array.isArray(namespaces)) {\n namespaces = []\n }\n const matches = []\n // collect all matches\n while ((match = regexp.exec(featureFileContent)) !== null) {\n // match[0] is the full match, match[1] is the first capturing group\n // Eg:- match[0] = {{name}}, match[1] = name\n if (!namespaces.includes(match[1].split('.')[0])) matches.push(match)\n }\n // find all variables in the matches\n const variables: any = { ...vars }\n\n if (Object.keys(variables).length > 0) {\n for (let i = 0; i < matches.length; i++) {\n const _match = matches[i]\n const value = _match[1]\n const variableMatch = variableRegex.exec(value)\n if (variableMatch !== null) {\n newContent = newContent.replaceAll(_match[0], `{{${variableMatch[1]}}}`)\n }\n }\n\n for (const key in variables) {\n const variable = variables[key]\n newContent = newContent.replaceAll(`{{${variable.var}}}`, variable.fake)\n }\n } else {\n for (let i = 0; i < matches.length; i++) {\n const _match = matches[i]\n const value = _match[1]\n const variableMatch = variableRegex.exec(value)\n if (variableMatch !== null) {\n variables[variableMatch[1]] = {\n var: variableMatch[1],\n toFake: variableMatch[2],\n }\n newContent = newContent.replaceAll(_match[0], `{{${variableMatch[1]}}}`)\n }\n }\n\n for (const key in variables) {\n const variable = variables[key]\n const fake = getFakeString(\n variable.toFake.substring(2, variable.toFake.length - 2)\n )\n newContent = newContent.replaceAll(`{{${variable.var}}}`, fake)\n variables[key].fake = fake\n }\n }\n\n regexp.lastIndex = 0\n const otherFakeData = []\n const duplicateFakeData = fakeData ? [...fakeData] : []\n let fakeIndex = 0\n while ((match = regexp.exec(featureFileContent)) !== null) {\n if (namespaces.includes(match[1].split('.')[0])) continue\n try {\n const fake =\n duplicateFakeData &&\n duplicateFakeData.length > 0 &&\n duplicateFakeData[0].var === match[0]\n ? duplicateFakeData.shift().fake\n : getFakeString(match[0].substring(2, match[0].length - 2))\n otherFakeData.push({\n var: match[0],\n fake,\n })\n newContent = newContent.replace(match[0], fake)\n fakeIndex++\n } catch (err) {\n // eslint-disable-next-line no-console\n //console.log('unknown faker variable:' + match[0])\n }\n }\n\n return {\n newContent,\n variables,\n otherFakeData,\n changed: newContent !== featureFileContent,\n fakeIndex,\n }\n}\n\nconst getFakeString = (content: string) => {\n // content example: helpers.fromRegExp('#{2,9}')\n const faking = content.split('(')[0].split('.')\n // faking example: ['helpers', 'fromRegExp']\n const argument = content.substring(\n content.indexOf('(') + 1,\n content.lastIndexOf(')')\n )\n // argument example: '#{2,9}'\n\n let fakeFunc: any = faker\n faking.forEach((f: string) => {\n fakeFunc = fakeFunc[f]\n })\n let regexpParam = false\n if (faking.length === 2 && faking[1] === 'fromRegExp') {\n regexpParam = true\n }\n if (regexpParam) {\n return fakeFunc(new RegExp(argument))\n }\n try {\n return fakeFunc(JSON5.parse(argument))\n } catch (error) {\n if (!argument) {\n return fakeFunc()\n }\n\n return fakeFunc(argument)\n }\n}\n\nconst getDefinitionFunction = (\n feature_path: string,\n functionName: string,\n functionFile: string\n) => {\n const mjsFiles = fs\n .readdirSync(path.join(feature_path, '../step_definitions'))\n .filter((file) => file === `${functionFile}.js`)\n\n if (mjsFiles.length === 0) {\n throw new Error(`File ${functionFile} not found in step_definitions folder`)\n }\n\n const [mjsData] = mjsFiles.map((file) => {\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n const { [functionName]: func } = require(path.join(\n feature_path,\n '../step_definitions',\n file\n ))\n if (!func)\n throw new Error(`Function ${functionName} not found in file ${file}`)\n\n return func()\n })\n\n return mjsData\n}\n\nconst generateExamplesFromFunction = (\n data: string,\n feature_path: string,\n functionName: string,\n functionFile: string\n) => {\n const examples = data.split('Examples:')[1].split('\\n').slice(1)\n const headers = examples[0]\n .split('|')\n .map((header) => header.trim())\n .filter((header) => header !== '')\n const values = examples[1]\n .split('|')\n .map((value) => value.trim())\n .filter((header) => header !== '')\n\n const mjsData = getDefinitionFunction(\n feature_path,\n functionName,\n functionFile\n )\n\n const newExamples = headers.map((header) => {\n if (mjsData[header]) {\n return mjsData[header]\n }\n return values[headers.indexOf(header)]\n })\n\n let newExamplesString = data.split('Examples:')[1]\n newExamples.forEach((example, index) => {\n newExamplesString = newExamplesString.replace(values[index], example)\n })\n\n const newData = data.replace(data.split('Examples:')[1], newExamplesString)\n\n return { newData, mjsData }\n}\n\nconst generateExamplesFromFunctionGherkin = (\n headers: readonly TableCell[],\n values: readonly TableCell[],\n mjsData: any\n) => {\n const newExamples = headers.map(({ value: header }, index) => {\n if (mjsData[header]) {\n return { header, value: mjsData[header] }\n }\n return { header, value: values[index].value }\n })\n\n return newExamples\n}\n\nexport {\n generateTestData,\n generateExamplesFromFunction,\n generateExamplesFromFunctionGherkin,\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typescript.js","sourceRoot":"","sources":["../../../src/formatter/fixtures/typescript.ts"],"names":[],"mappings":";;AAAA,MAAqB,SAAS;CAAG;AAAjC,4BAAiC","sourcesContent":["export default class Formatter {}\n"]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
/// <reference types="node" />
|
|
3
|
+
import { TestStepResultStatus } from '@cucumber/messages';
|
|
4
|
+
import { Writable } from 'stream';
|
|
5
|
+
export type IColorFn = (text: string) => string;
|
|
6
|
+
export interface IColorFns {
|
|
7
|
+
forStatus: (status: TestStepResultStatus) => IColorFn;
|
|
8
|
+
location: IColorFn;
|
|
9
|
+
tag: IColorFn;
|
|
10
|
+
diffAdded: IColorFn;
|
|
11
|
+
diffRemoved: IColorFn;
|
|
12
|
+
errorMessage: IColorFn;
|
|
13
|
+
errorStack: IColorFn;
|
|
14
|
+
}
|
|
15
|
+
export default function getColorFns(stream: Writable, env: NodeJS.ProcessEnv, enabled?: boolean): IColorFns;
|
|
@@ -0,0 +1,56 @@
|
|
|
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 chalk_1 = __importDefault(require("chalk"));
|
|
7
|
+
const supports_color_1 = require("supports-color");
|
|
8
|
+
const value_checker_1 = require("../value_checker");
|
|
9
|
+
function getColorFns(stream, env, enabled) {
|
|
10
|
+
const support = detectSupport(stream, env, enabled);
|
|
11
|
+
if (support) {
|
|
12
|
+
const chalkInstance = new chalk_1.default.Instance(support);
|
|
13
|
+
return {
|
|
14
|
+
forStatus(status) {
|
|
15
|
+
return {
|
|
16
|
+
AMBIGUOUS: chalkInstance.red.bind(chalk_1.default),
|
|
17
|
+
FAILED: chalkInstance.red.bind(chalk_1.default),
|
|
18
|
+
PASSED: chalkInstance.green.bind(chalk_1.default),
|
|
19
|
+
PENDING: chalkInstance.yellow.bind(chalk_1.default),
|
|
20
|
+
SKIPPED: chalkInstance.cyan.bind(chalk_1.default),
|
|
21
|
+
UNDEFINED: chalkInstance.yellow.bind(chalk_1.default),
|
|
22
|
+
UNKNOWN: chalkInstance.yellow.bind(chalk_1.default),
|
|
23
|
+
}[status];
|
|
24
|
+
},
|
|
25
|
+
location: chalkInstance.gray.bind(chalk_1.default),
|
|
26
|
+
tag: chalkInstance.cyan.bind(chalk_1.default),
|
|
27
|
+
diffAdded: chalkInstance.green.bind(chalk_1.default),
|
|
28
|
+
diffRemoved: chalkInstance.red.bind(chalk_1.default),
|
|
29
|
+
errorMessage: chalkInstance.red.bind(chalk_1.default),
|
|
30
|
+
errorStack: chalkInstance.grey.bind(chalk_1.default),
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
return {
|
|
35
|
+
forStatus(_status) {
|
|
36
|
+
return (x) => x;
|
|
37
|
+
},
|
|
38
|
+
location: (x) => x,
|
|
39
|
+
tag: (x) => x,
|
|
40
|
+
diffAdded: (x) => x,
|
|
41
|
+
diffRemoved: (x) => x,
|
|
42
|
+
errorMessage: (x) => x,
|
|
43
|
+
errorStack: (x) => x,
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
exports.default = getColorFns;
|
|
48
|
+
function detectSupport(stream, env, enabled) {
|
|
49
|
+
const support = (0, supports_color_1.supportsColor)(stream);
|
|
50
|
+
// if we find FORCE_COLOR, we can let the supports-color library handle that
|
|
51
|
+
if ('FORCE_COLOR' in env || (0, value_checker_1.doesNotHaveValue)(enabled)) {
|
|
52
|
+
return support;
|
|
53
|
+
}
|
|
54
|
+
return enabled ? support || { level: 1 } : false;
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=get_color_fns.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get_color_fns.js","sourceRoot":"","sources":["../../src/formatter/get_color_fns.ts"],"names":[],"mappings":";;;;;AAAA,kDAAyB;AACzB,mDAAyD;AAGzD,oDAAmD;AAcnD,SAAwB,WAAW,CACjC,MAAgB,EAChB,GAAsB,EACtB,OAAiB;IAEjB,MAAM,OAAO,GAAc,aAAa,CAAC,MAAM,EAAE,GAAG,EAAE,OAAO,CAAC,CAAA;IAC9D,IAAI,OAAO,EAAE;QACX,MAAM,aAAa,GAAG,IAAI,eAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAA;QACjD,OAAO;YACL,SAAS,CAAC,MAA4B;gBACpC,OAAO;oBACL,SAAS,EAAE,aAAa,CAAC,GAAG,CAAC,IAAI,CAAC,eAAK,CAAC;oBACxC,MAAM,EAAE,aAAa,CAAC,GAAG,CAAC,IAAI,CAAC,eAAK,CAAC;oBACrC,MAAM,EAAE,aAAa,CAAC,KAAK,CAAC,IAAI,CAAC,eAAK,CAAC;oBACvC,OAAO,EAAE,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,eAAK,CAAC;oBACzC,OAAO,EAAE,aAAa,CAAC,I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,4EAA4E;IAC5E,IAAI,aAAa,IAAI,GAAG,IAAI,IAAA,gCAAgB,EAAC,OAAO,CAAC,EAAE;QACrD,OAAO,OAAO,CAAA;KACf;IACD,OAAO,OAAO,CAAC,CAAC,CAAC,OAAO,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAA;AAClD,CAAC","sourcesContent":["import chalk from 'chalk'\nimport { ColorInfo, supportsColor } from 'supports-color'\nimport { TestStepResultStatus } from '@cucumber/messages'\nimport { Writable } from 'stream'\nimport { doesNotHaveValue } from '../value_checker'\n\nexport type IColorFn = (text: string) => string\n\nexport interface IColorFns {\n forStatus: (status: TestStepResultStatus) => IColorFn\n location: IColorFn\n tag: IColorFn\n diffAdded: IColorFn\n diffRemoved: IColorFn\n errorMessage: IColorFn\n errorStack: IColorFn\n}\n\nexport default function getColorFns(\n stream: Writable,\n env: NodeJS.ProcessEnv,\n enabled?: boolean\n): IColorFns {\n const support: ColorInfo = detectSupport(stream, env, enabled)\n if (support) {\n const chalkInstance = new chalk.Instance(support)\n return {\n forStatus(status: TestStepResultStatus) {\n return {\n AMBIGUOUS: chalkInstance.red.bind(chalk),\n FAILED: chalkInstance.red.bind(chalk),\n PASSED: chalkInstance.green.bind(chalk),\n PENDING: chalkInstance.yellow.bind(chalk),\n SKIPPED: chalkInstance.cyan.bind(chalk),\n UNDEFINED: chalkInstance.yellow.bind(chalk),\n UNKNOWN: chalkInstance.yellow.bind(chalk),\n }[status]\n },\n location: chalkInstance.gray.bind(chalk),\n tag: chalkInstance.cyan.bind(chalk),\n diffAdded: chalkInstance.green.bind(chalk),\n diffRemoved: chalkInstance.red.bind(chalk),\n errorMessage: chalkInstance.red.bind(chalk),\n errorStack: chalkInstance.grey.bind(chalk),\n }\n } else {\n return {\n forStatus(_status: TestStepResultStatus) {\n return (x) => x\n },\n location: (x) => x,\n tag: (x) => x,\n diffAdded: (x) => x,\n diffRemoved: (x) => x,\n errorMessage: (x) => x,\n errorStack: (x) => x,\n }\n }\n}\n\nfunction detectSupport(\n stream: Writable,\n env: NodeJS.ProcessEnv,\n enabled?: boolean\n): ColorInfo {\n const support: ColorInfo = supportsColor(stream)\n // if we find FORCE_COLOR, we can let the supports-color library handle that\n if ('FORCE_COLOR' in env || doesNotHaveValue(enabled)) {\n return support\n }\n return enabled ? support || { level: 1 } : false\n}\n"]}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export declare const LOCAL: {
|
|
2
|
+
SSO: string;
|
|
3
|
+
WORKSPACE: string;
|
|
4
|
+
RUNS: string;
|
|
5
|
+
STORAGE: string;
|
|
6
|
+
};
|
|
7
|
+
export declare const DEV: {
|
|
8
|
+
SSO: string;
|
|
9
|
+
WORKSPACE: string;
|
|
10
|
+
RUNS: string;
|
|
11
|
+
STORAGE: string;
|
|
12
|
+
};
|
|
13
|
+
export declare const PROD: {
|
|
14
|
+
SSO: string;
|
|
15
|
+
WORKSPACE: string;
|
|
16
|
+
RUNS: string;
|
|
17
|
+
STORAGE: string;
|
|
18
|
+
};
|
|
19
|
+
export declare const STAGE: {
|
|
20
|
+
SSO: string;
|
|
21
|
+
WORKSPACE: string;
|
|
22
|
+
RUNS: string;
|
|
23
|
+
STORAGE: string;
|
|
24
|
+
};
|
|
25
|
+
export declare const SERVICES_URI: {
|
|
26
|
+
SSO: string;
|
|
27
|
+
WORKSPACE: string;
|
|
28
|
+
RUNS: string;
|
|
29
|
+
STORAGE: string;
|
|
30
|
+
};
|
|
31
|
+
export declare enum ActionEvents {
|
|
32
|
+
record_scenario = "record_scenario",
|
|
33
|
+
download_editor = "download_editor",
|
|
34
|
+
launch_editor = "launch_editor",
|
|
35
|
+
click_start_recording = "click_start_recording",
|
|
36
|
+
click_run_scenario = "click_run_scenario",
|
|
37
|
+
publish_scenario = "publish_scenario",
|
|
38
|
+
click_ai_generate = "click_ai_generate",
|
|
39
|
+
click_run_all = "click_run_all",
|
|
40
|
+
click_open_vscode = "click_open_vscode",
|
|
41
|
+
error_open_vscode = "error_open_vscode",
|
|
42
|
+
cli_run_tests = "cli_run_tests",
|
|
43
|
+
upload_report = "upload_report"
|
|
44
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ActionEvents = exports.SERVICES_URI = exports.STAGE = exports.PROD = exports.DEV = exports.LOCAL = void 0;
|
|
4
|
+
exports.LOCAL = {
|
|
5
|
+
SSO: 'http://localhost:5000/api/auth',
|
|
6
|
+
WORKSPACE: 'http://localhost:6000/api/workspace',
|
|
7
|
+
RUNS: 'http://localhost:5001/api/runs',
|
|
8
|
+
STORAGE: 'http://localhost:5050/api/storage',
|
|
9
|
+
};
|
|
10
|
+
exports.DEV = {
|
|
11
|
+
SSO: 'https://dev.api.blinq.io/api/auth',
|
|
12
|
+
WORKSPACE: 'https://dev.api.blinq.io/api/workspace',
|
|
13
|
+
RUNS: 'https://dev.api.blinq.io/api/runs',
|
|
14
|
+
STORAGE: 'https://dev.api.blinq.io/api/storage',
|
|
15
|
+
};
|
|
16
|
+
exports.PROD = {
|
|
17
|
+
SSO: 'https://api.blinq.io/api/auth',
|
|
18
|
+
WORKSPACE: 'https://api.blinq.io/api/workspace',
|
|
19
|
+
RUNS: 'https://api.blinq.io/api/runs',
|
|
20
|
+
STORAGE: 'https://api.blinq.io/api/storage',
|
|
21
|
+
};
|
|
22
|
+
exports.STAGE = {
|
|
23
|
+
SSO: 'https://stage.api.blinq.io/api/auth',
|
|
24
|
+
WORKSPACE: 'https://stage.api.blinq.io/api/workspace',
|
|
25
|
+
RUNS: 'https://stage.api.blinq.io/api/runs',
|
|
26
|
+
STORAGE: 'https://stage.api.blinq.io/api/storage',
|
|
27
|
+
};
|
|
28
|
+
exports.SERVICES_URI = process.env.NODE_ENV_BLINQ === 'local'
|
|
29
|
+
? exports.LOCAL // eslint-disable-line
|
|
30
|
+
: process.env.NODE_ENV_BLINQ === 'dev'
|
|
31
|
+
? exports.DEV // eslint-disable-line
|
|
32
|
+
: process.env.NODE_ENV_BLINQ === 'stage'
|
|
33
|
+
? exports.STAGE
|
|
34
|
+
: exports.PROD; // eslint-disable-line
|
|
35
|
+
var ActionEvents;
|
|
36
|
+
(function (ActionEvents) {
|
|
37
|
+
ActionEvents["record_scenario"] = "record_scenario";
|
|
38
|
+
ActionEvents["download_editor"] = "download_editor";
|
|
39
|
+
ActionEvents["launch_editor"] = "launch_editor";
|
|
40
|
+
ActionEvents["click_start_recording"] = "click_start_recording";
|
|
41
|
+
ActionEvents["click_run_scenario"] = "click_run_scenario";
|
|
42
|
+
ActionEvents["publish_scenario"] = "publish_scenario";
|
|
43
|
+
ActionEvents["click_ai_generate"] = "click_ai_generate";
|
|
44
|
+
ActionEvents["click_run_all"] = "click_run_all";
|
|
45
|
+
ActionEvents["click_open_vscode"] = "click_open_vscode";
|
|
46
|
+
ActionEvents["error_open_vscode"] = "error_open_vscode";
|
|
47
|
+
ActionEvents["cli_run_tests"] = "cli_run_tests";
|
|
48
|
+
ActionEvents["upload_report"] = "upload_report";
|
|
49
|
+
})(ActionEvents = exports.ActionEvents || (exports.ActionEvents = {}));
|
|
50
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/formatter/helpers/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,KAAK,GAAG;IACnB,GAAG,EAAE,gCAAgC;IACrC,SAAS,EAAE,qCAAqC;IAChD,IAAI,EAAE,gCAAgC;IACtC,OAAO,EAAE,mCAAmC;CAC7C,CAAA;AACY,QAAA,GAAG,GAAG;IACjB,GAAG,EAAE,mCAAmC;IACxC,SAAS,EAAE,wCAAwC;IACnD,IAAI,EAAE,mCAAmC;IACzC,OAAO,EAAE,sCAAsC;CAChD,CAAA;AACY,QAAA,IAAI,GAAG;IAClB,GAAG,EAAE,+BAA+B;IACpC,SAAS,EAAE,oCAAoC;IAC/C,IAAI,EAAE,+BAA+B;IACrC,OAAO,EAAE,kCAAkC;CAC5C,CAAA;AACY,QAAA,KAAK,GAAG;IACnB,GAAG,EAAE,qCAAqC;IAC1C,SAAS,EAAE,0CAA0C;IACrD,IAAI,EAAE,qCAAqC;IAC3C,OAAO,EAAE,wCAAwC;CAClD,CAAA;AAEY,QAAA,YAAY,GACvB,OAAO,CAAC,GAAG,CAAC,cAAc,KAAK,OAAO;IACpC,CAAC,CAAC,aAAK,CAAC,sBAAsB;IAC9B,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,KAAK,KAAK;QACtC,CAAC,CAAC,WAAG,CAAC,sBAAsB;QAC5B,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,KAAK,OAAO;YACxC,CAAC,CAAC,aAAK;YACP,CAAC,CAAC,YAAI,CAAA,CAAC,sBAAsB;AAEjC,IAAY,YAaX;AAbD,WAAY,YAAY;IACtB,mDAAmC,CAAA;IACnC,mDAAmC,CAAA;IACnC,+CAA+B,CAAA;IAC/B,+DAA+C,CAAA;IAC/C,yDAAyC,CAAA;IACzC,qDAAqC,CAAA;IACrC,uDAAuC,CAAA;IACvC,+CAA+B,CAAA;IAC/B,uDAAuC,CAAA;IACvC,uDAAuC,CAAA;IACvC,+CAA+B,CAAA;IAC/B,+CAA+B,CAAA;AACjC,CAAC,EAbW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAavB","sourcesContent":["export const LOCAL = {\n SSO: 'http://localhost:5000/api/auth',\n WORKSPACE: 'http://localhost:6000/api/workspace',\n RUNS: 'http://localhost:5001/api/runs',\n STORAGE: 'http://localhost:5050/api/storage',\n}\nexport const DEV = {\n SSO: 'https://dev.api.blinq.io/api/auth',\n WORKSPACE: 'https://dev.api.blinq.io/api/workspace',\n RUNS: 'https://dev.api.blinq.io/api/runs',\n STORAGE: 'https://dev.api.blinq.io/api/storage',\n}\nexport const PROD = {\n SSO: 'https://api.blinq.io/api/auth',\n WORKSPACE: 'https://api.blinq.io/api/workspace',\n RUNS: 'https://api.blinq.io/api/runs',\n STORAGE: 'https://api.blinq.io/api/storage',\n}\nexport const STAGE = {\n SSO: 'https://stage.api.blinq.io/api/auth',\n WORKSPACE: 'https://stage.api.blinq.io/api/workspace',\n RUNS: 'https://stage.api.blinq.io/api/runs',\n STORAGE: 'https://stage.api.blinq.io/api/storage',\n}\n\nexport const SERVICES_URI =\n process.env.NODE_ENV_BLINQ === 'local'\n ? LOCAL // eslint-disable-line\n : process.env.NODE_ENV_BLINQ === 'dev'\n ? DEV // eslint-disable-line\n : process.env.NODE_ENV_BLINQ === 'stage'\n ? STAGE\n : PROD // eslint-disable-line\n\nexport enum ActionEvents {\n record_scenario = 'record_scenario',\n download_editor = 'download_editor',\n launch_editor = 'launch_editor',\n click_start_recording = 'click_start_recording',\n click_run_scenario = 'click_run_scenario',\n publish_scenario = 'publish_scenario',\n click_ai_generate = 'click_ai_generate',\n click_run_all = 'click_run_all',\n click_open_vscode = 'click_open_vscode',\n error_open_vscode = 'error_open_vscode',\n cli_run_tests = 'cli_run_tests',\n upload_report = 'upload_report',\n}\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.durationToNanoseconds = void 0;
|
|
4
|
+
const NANOS_IN_SECOND = 1000000000;
|
|
5
|
+
function durationToNanoseconds(duration) {
|
|
6
|
+
return Math.floor(duration.seconds * NANOS_IN_SECOND + duration.nanos);
|
|
7
|
+
}
|
|
8
|
+
exports.durationToNanoseconds = durationToNanoseconds;
|
|
9
|
+
//# sourceMappingURL=duration_helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"duration_helpers.js","sourceRoot":"","sources":["../../../src/formatter/helpers/duration_helpers.ts"],"names":[],"mappings":";;;AAEA,MAAM,eAAe,GAAG,UAAa,CAAA;AAErC,SAAgB,qBAAqB,CAAC,QAAkB;IACtD,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,OAAO,GAAG,eAAe,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAA;AACxE,CAAC;AAFD,sDAEC","sourcesContent":["import { Duration } from '@cucumber/messages'\n\nconst NANOS_IN_SECOND = 1_000_000_000\n\nexport function durationToNanoseconds(duration: Duration): number {\n return Math.floor(duration.seconds * NANOS_IN_SECOND + duration.nanos)\n}\n"]}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import * as messages from '@cucumber/messages';
|
|
3
|
+
import { EventEmitter } from 'events';
|
|
4
|
+
export interface ITestCaseAttempt {
|
|
5
|
+
attempt: number;
|
|
6
|
+
willBeRetried: boolean;
|
|
7
|
+
gherkinDocument: messages.GherkinDocument;
|
|
8
|
+
pickle: messages.Pickle;
|
|
9
|
+
stepAttachments: Record<string, messages.Attachment[]>;
|
|
10
|
+
stepResults: Record<string, messages.TestStepResult>;
|
|
11
|
+
testCase: messages.TestCase;
|
|
12
|
+
worstTestStepResult: messages.TestStepResult;
|
|
13
|
+
}
|
|
14
|
+
export default class EventDataCollector {
|
|
15
|
+
private gherkinDocumentMap;
|
|
16
|
+
private pickleMap;
|
|
17
|
+
private testCaseMap;
|
|
18
|
+
private testCaseAttemptDataMap;
|
|
19
|
+
readonly undefinedParameterTypes: messages.UndefinedParameterType[];
|
|
20
|
+
constructor(eventBroadcaster: EventEmitter);
|
|
21
|
+
getGherkinDocument(uri: string): messages.GherkinDocument;
|
|
22
|
+
getPickle(pickleId: string): messages.Pickle;
|
|
23
|
+
getTestCaseAttempts(): ITestCaseAttempt[];
|
|
24
|
+
getTestCaseAttempt(testCaseStartedId: string): ITestCaseAttempt;
|
|
25
|
+
parseEnvelope(envelope: messages.Envelope): void;
|
|
26
|
+
private initTestCaseAttempt;
|
|
27
|
+
storeAttachment(attachment: messages.Attachment): void;
|
|
28
|
+
storeTestStepResult({ testCaseStartedId, testStepId, testStepResult, }: messages.TestStepFinished): void;
|
|
29
|
+
storeTestCaseResult({ testCaseStartedId, willBeRetried, }: messages.TestCaseFinished): void;
|
|
30
|
+
}
|