hiptest-publisher-fork 3.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/CHANGELOG.md +295 -0
- data/LICENSE +21 -0
- data/README.md +265 -0
- data/bin/hiptest-publisher +47 -0
- data/config/i18n-tasks.yml +137 -0
- data/config/locales/en.yml +250 -0
- data/lib/config/behat.conf +44 -0
- data/lib/config/behave.conf +40 -0
- data/lib/config/csharp-nunit.conf +15 -0
- data/lib/config/cucumber-groovy.conf +40 -0
- data/lib/config/cucumber-java.conf +24 -0
- data/lib/config/cucumber-javascript.conf +23 -0
- data/lib/config/cucumber-ruby.conf +22 -0
- data/lib/config/cucumber-typescript.conf +41 -0
- data/lib/config/cucumber_legacy-groovy.conf +40 -0
- data/lib/config/cucumber_legacy-java.conf +24 -0
- data/lib/config/cucumber_legacy-typescript.conf +41 -0
- data/lib/config/groovy-spock.conf +25 -0
- data/lib/config/java-espresso.conf +15 -0
- data/lib/config/java-junit.conf +21 -0
- data/lib/config/java-testng.conf +15 -0
- data/lib/config/javascript-codeceptjs.conf +23 -0
- data/lib/config/javascript-jasmine.conf +12 -0
- data/lib/config/javascript-mocha.conf +12 -0
- data/lib/config/javascript-protractor.conf +12 -0
- data/lib/config/javascript-qunit.conf +12 -0
- data/lib/config/jbehave.conf +24 -0
- data/lib/config/php-phpunit.conf +14 -0
- data/lib/config/python-unittest.conf +13 -0
- data/lib/config/robotframework.conf +13 -0
- data/lib/config/ruby-minitest.conf +11 -0
- data/lib/config/ruby-rspec.conf +11 -0
- data/lib/config/seleniumide.conf +12 -0
- data/lib/config/specflow.conf +25 -0
- data/lib/config/swift-xctest.conf +18 -0
- data/lib/hiptest-publisher/cli_options_checker.rb +270 -0
- data/lib/hiptest-publisher/client.rb +326 -0
- data/lib/hiptest-publisher/export_cache.rb +85 -0
- data/lib/hiptest-publisher/file_writer.rb +30 -0
- data/lib/hiptest-publisher/formatters/console_formatter.rb +101 -0
- data/lib/hiptest-publisher/formatters/diff_displayer.rb +173 -0
- data/lib/hiptest-publisher/formatters/reporter.rb +74 -0
- data/lib/hiptest-publisher/handlebars_helper.rb +314 -0
- data/lib/hiptest-publisher/i18n.rb +5 -0
- data/lib/hiptest-publisher/indexers/actionword_indexer.rb +32 -0
- data/lib/hiptest-publisher/indexers/library_actionword_indexer.rb +32 -0
- data/lib/hiptest-publisher/node_modifiers/actionword_uniq_renamer.rb +39 -0
- data/lib/hiptest-publisher/node_modifiers/add_all.rb +21 -0
- data/lib/hiptest-publisher/node_modifiers/call_arguments_adder.rb +46 -0
- data/lib/hiptest-publisher/node_modifiers/datatable_fixer.rb +32 -0
- data/lib/hiptest-publisher/node_modifiers/gherkin_adder.rb +252 -0
- data/lib/hiptest-publisher/node_modifiers/items_orderer.rb +33 -0
- data/lib/hiptest-publisher/node_modifiers/parameter_type_adder.rb +141 -0
- data/lib/hiptest-publisher/node_modifiers/parent_adder.rb +18 -0
- data/lib/hiptest-publisher/nodes.rb +601 -0
- data/lib/hiptest-publisher/nodes_walker.rb +34 -0
- data/lib/hiptest-publisher/options_parser.rb +826 -0
- data/lib/hiptest-publisher/project_grapher.rb +94 -0
- data/lib/hiptest-publisher/render_context_maker.rb +194 -0
- data/lib/hiptest-publisher/renderer.rb +52 -0
- data/lib/hiptest-publisher/renderer_addons/behave_addon.rb +23 -0
- data/lib/hiptest-publisher/renderer_addons/gherkin_addon.rb +59 -0
- data/lib/hiptest-publisher/renderer_addons/groovy_spock_addon.rb +34 -0
- data/lib/hiptest-publisher/renderer_addons/robot_framework_addon.rb +42 -0
- data/lib/hiptest-publisher/renderer_addons.rb +4 -0
- data/lib/hiptest-publisher/signature_differ.rb +105 -0
- data/lib/hiptest-publisher/signature_exporter.rb +56 -0
- data/lib/hiptest-publisher/string.rb +76 -0
- data/lib/hiptest-publisher/utils.rb +39 -0
- data/lib/hiptest-publisher/version_checker.rb +41 -0
- data/lib/hiptest-publisher/xml_parser.rb +407 -0
- data/lib/hiptest-publisher.rb +261 -0
- data/lib/templates/behat/actionword.hbs +8 -0
- data/lib/templates/behat/actionwords/parameter.hbs +1 -0
- data/lib/templates/behat/actionwords.hbs +16 -0
- data/lib/templates/behat/library.hbs +16 -0
- data/lib/templates/behat/libraryactionword.hbs +8 -0
- data/lib/templates/behat/parameter.hbs +1 -0
- data/lib/templates/behave/actionword.hbs +4 -0
- data/lib/templates/behave/actionwords.hbs +12 -0
- data/lib/templates/behave/library.hbs +7 -0
- data/lib/templates/behave/libraryactionword.hbs +4 -0
- data/lib/templates/behave/nullliteral.hbs +1 -0
- data/lib/templates/common/_gherkin_pattern.hbs +1 -0
- data/lib/templates/common/_gherkin_typed_pattern.hbs +1 -0
- data/lib/templates/common/booleanliteral.hbs +1 -0
- data/lib/templates/common/dataset.hbs +0 -0
- data/lib/templates/common/datatable.hbs +3 -0
- data/lib/templates/common/empty.hbs +0 -0
- data/lib/templates/common/nullliteral.hbs +1 -0
- data/lib/templates/common/numericliteral.hbs +1 -0
- data/lib/templates/common/stringliteral.hbs +1 -0
- data/lib/templates/common/symbol.hbs +1 -0
- data/lib/templates/common/unaryexpression.hbs +1 -0
- data/lib/templates/common/variable.hbs +1 -0
- data/lib/templates/csharp/_body.hbs +5 -0
- data/lib/templates/csharp/_item_as_function.hbs +8 -0
- data/lib/templates/csharp/_scenario.hbs +8 -0
- data/lib/templates/csharp/actionword.hbs +1 -0
- data/lib/templates/csharp/actionwords.hbs +10 -0
- data/lib/templates/csharp/argument.hbs +1 -0
- data/lib/templates/csharp/assign.hbs +1 -0
- data/lib/templates/csharp/binaryexpression.hbs +1 -0
- data/lib/templates/csharp/call.hbs +2 -0
- data/lib/templates/csharp/dataset.hbs +4 -0
- data/lib/templates/csharp/dict.hbs +1 -0
- data/lib/templates/csharp/field.hbs +1 -0
- data/lib/templates/csharp/folder.hbs +22 -0
- data/lib/templates/csharp/ifthen.hbs +7 -0
- data/lib/templates/csharp/index.hbs +1 -0
- data/lib/templates/csharp/list.hbs +1 -0
- data/lib/templates/csharp/nullliteral.hbs +1 -0
- data/lib/templates/csharp/parameter.hbs +1 -0
- data/lib/templates/csharp/parenthesis.hbs +1 -0
- data/lib/templates/csharp/property.hbs +1 -0
- data/lib/templates/csharp/scenario.hbs +1 -0
- data/lib/templates/csharp/scenarios.hbs +20 -0
- data/lib/templates/csharp/single_scenario.hbs +16 -0
- data/lib/templates/csharp/single_test.hbs +15 -0
- data/lib/templates/csharp/step.hbs +1 -0
- data/lib/templates/csharp/stringliteral.hbs +1 -0
- data/lib/templates/csharp/tag.hbs +1 -0
- data/lib/templates/csharp/template.hbs +1 -0
- data/lib/templates/csharp/test.hbs +1 -0
- data/lib/templates/csharp/tests.hbs +15 -0
- data/lib/templates/csharp/variable.hbs +1 -0
- data/lib/templates/csharp/while.hbs +4 -0
- data/lib/templates/cucumber/actionword.hbs +5 -0
- data/lib/templates/cucumber/actionwords.hbs +5 -0
- data/lib/templates/cucumber/groovy/step-definitions/_gherkin_pattern.hbs +1 -0
- data/lib/templates/cucumber/groovy/step-definitions/actionword.hbs +5 -0
- data/lib/templates/cucumber/groovy/step-definitions/actionwords.hbs +11 -0
- data/lib/templates/cucumber/groovy/step-definitions/library.hbs +11 -0
- data/lib/templates/cucumber/groovy/step-definitions/libraryactionword.hbs +5 -0
- data/lib/templates/cucumber/groovy/step-definitions/parameter.hbs +1 -0
- data/lib/templates/cucumber/java/actionword.hbs +6 -0
- data/lib/templates/cucumber/java/actionwords/parameter.hbs +1 -0
- data/lib/templates/cucumber/java/actionwords.hbs +12 -0
- data/lib/templates/cucumber/java/parameter.hbs +1 -0
- data/lib/templates/cucumber/javascript/_after_hook.hbs +4 -0
- data/lib/templates/cucumber/javascript/_before_hook.hbs +4 -0
- data/lib/templates/cucumber/javascript/actionword.hbs +6 -0
- data/lib/templates/cucumber/javascript/actionwords.hbs +8 -0
- data/lib/templates/cucumber/parameter.hbs +1 -0
- data/lib/templates/cucumber/typescript/_after_hook.hbs +4 -0
- data/lib/templates/cucumber/typescript/_before_hook.hbs +4 -0
- data/lib/templates/cucumber/typescript/actionword.hbs +5 -0
- data/lib/templates/cucumber/typescript/actionwords.hbs +10 -0
- data/lib/templates/cucumber/typescript/library.hbs +12 -0
- data/lib/templates/cucumber/typescript/libraryactionword.hbs +5 -0
- data/lib/templates/cucumber_legacy/groovy/step-definitions/actionword.hbs +5 -0
- data/lib/templates/cucumber_legacy/groovy/step-definitions/actionwords.hbs +10 -0
- data/lib/templates/cucumber_legacy/groovy/step-definitions/library.hbs +10 -0
- data/lib/templates/cucumber_legacy/groovy/step-definitions/libraryactionword.hbs +5 -0
- data/lib/templates/cucumber_legacy/java/actionword.hbs +6 -0
- data/lib/templates/cucumber_legacy/java/actionwords.hbs +12 -0
- data/lib/templates/cucumber_legacy/typescript/actionword.hbs +5 -0
- data/lib/templates/cucumber_legacy/typescript/libraryactionword.hbs +5 -0
- data/lib/templates/gherkin/_call.hbs +5 -0
- data/lib/templates/gherkin/_gherkin_text.hbs +1 -0
- data/lib/templates/gherkin/_scenario.hbs +18 -0
- data/lib/templates/gherkin/_scenario_outline_title.hbs +1 -0
- data/lib/templates/gherkin/argument.hbs +1 -0
- data/lib/templates/gherkin/call.hbs +1 -0
- data/lib/templates/gherkin/dataset.hbs +1 -0
- data/lib/templates/gherkin/datatable.hbs +2 -0
- data/lib/templates/gherkin/folder.hbs +10 -0
- data/lib/templates/gherkin/inlined_uids/_scenario_outline_title.hbs +1 -0
- data/lib/templates/gherkin/java/single_scenario.hbs +1 -0
- data/lib/templates/gherkin/parameter.hbs +1 -0
- data/lib/templates/gherkin/scenarios.hbs +3 -0
- data/lib/templates/gherkin/single_scenario.hbs +1 -0
- data/lib/templates/gherkin/single_test.hbs +3 -0
- data/lib/templates/gherkin/step.hbs +1 -0
- data/lib/templates/gherkin/stringliteral.hbs +1 -0
- data/lib/templates/gherkin/tag.hbs +1 -0
- data/lib/templates/gherkin/template.hbs +1 -0
- data/lib/templates/groovy/_body.hbs +8 -0
- data/lib/templates/groovy/_desc.hbs +5 -0
- data/lib/templates/groovy/_scenario.hbs +10 -0
- data/lib/templates/groovy/_steps.hbs +4 -0
- data/lib/templates/groovy/_test.hbs +4 -0
- data/lib/templates/groovy/actionword.hbs +2 -0
- data/lib/templates/groovy/actionwords.hbs +7 -0
- data/lib/templates/groovy/assign.hbs +1 -0
- data/lib/templates/groovy/call.hbs +2 -0
- data/lib/templates/groovy/dataset.hbs +1 -0
- data/lib/templates/groovy/datatable.hbs +2 -0
- data/lib/templates/groovy/dict.hbs +1 -0
- data/lib/templates/groovy/folder.hbs +18 -0
- data/lib/templates/groovy/index.hbs +1 -0
- data/lib/templates/groovy/libraries.hbs +9 -0
- data/lib/templates/groovy/library.hbs +8 -0
- data/lib/templates/groovy/libraryactionword.hbs +2 -0
- data/lib/templates/groovy/list.hbs +1 -0
- data/lib/templates/groovy/nullliteral.hbs +1 -0
- data/lib/templates/groovy/parameter.hbs +1 -0
- data/lib/templates/groovy/property.hbs +1 -0
- data/lib/templates/groovy/scenario.hbs +1 -0
- data/lib/templates/groovy/scenarios.hbs +10 -0
- data/lib/templates/groovy/single_scenario.hbs +9 -0
- data/lib/templates/groovy/single_test.hbs +10 -0
- data/lib/templates/groovy/template.hbs +1 -0
- data/lib/templates/groovy/test.hbs +1 -0
- data/lib/templates/groovy/tests.hbs +10 -0
- data/lib/templates/java/_body.hbs +5 -0
- data/lib/templates/java/_item_as_function.hbs +8 -0
- data/lib/templates/java/_scenario.hbs +7 -0
- data/lib/templates/java/actionword.hbs +1 -0
- data/lib/templates/java/actionwords.hbs +8 -0
- data/lib/templates/java/argument.hbs +1 -0
- data/lib/templates/java/assign.hbs +1 -0
- data/lib/templates/java/binaryexpression.hbs +1 -0
- data/lib/templates/java/call.hbs +2 -0
- data/lib/templates/java/dataset.hbs +3 -0
- data/lib/templates/java/dict.hbs +1 -0
- data/lib/templates/java/espresso/_scenario.hbs +8 -0
- data/lib/templates/java/espresso/dataset.hbs +4 -0
- data/lib/templates/java/espresso/folder.hbs +29 -0
- data/lib/templates/java/espresso/scenarios.hbs +23 -0
- data/lib/templates/java/espresso/single_scenario.hbs +24 -0
- data/lib/templates/java/espresso/single_test.hbs +22 -0
- data/lib/templates/java/espresso/tests.hbs +23 -0
- data/lib/templates/java/field.hbs +1 -0
- data/lib/templates/java/folder.hbs +18 -0
- data/lib/templates/java/ifthen.hbs +7 -0
- data/lib/templates/java/index.hbs +1 -0
- data/lib/templates/java/libraries.hbs +9 -0
- data/lib/templates/java/library.hbs +7 -0
- data/lib/templates/java/libraryactionword.hbs +1 -0
- data/lib/templates/java/list.hbs +1 -0
- data/lib/templates/java/nullliteral.hbs +1 -0
- data/lib/templates/java/parameter.hbs +1 -0
- data/lib/templates/java/parenthesis.hbs +1 -0
- data/lib/templates/java/property.hbs +1 -0
- data/lib/templates/java/scenario.hbs +1 -0
- data/lib/templates/java/scenarios.hbs +11 -0
- data/lib/templates/java/single_scenario.hbs +12 -0
- data/lib/templates/java/single_test.hbs +11 -0
- data/lib/templates/java/step.hbs +1 -0
- data/lib/templates/java/stringliteral.hbs +1 -0
- data/lib/templates/java/tag.hbs +1 -0
- data/lib/templates/java/template.hbs +1 -0
- data/lib/templates/java/test.hbs +1 -0
- data/lib/templates/java/testng/_scenario.hbs +8 -0
- data/lib/templates/java/testng/dataset.hbs +4 -0
- data/lib/templates/java/testng/folder.hbs +19 -0
- data/lib/templates/java/testng/scenarios.hbs +16 -0
- data/lib/templates/java/testng/single_scenario.hbs +12 -0
- data/lib/templates/java/testng/single_test.hbs +11 -0
- data/lib/templates/java/testng/tests.hbs +16 -0
- data/lib/templates/java/tests.hbs +11 -0
- data/lib/templates/java/variable.hbs +1 -0
- data/lib/templates/java/while.hbs +4 -0
- data/lib/templates/javascript/_body.hbs +10 -0
- data/lib/templates/javascript/_item_as_function.hbs +3 -0
- data/lib/templates/javascript/_item_as_hash_key.hbs +3 -0
- data/lib/templates/javascript/_module_declaration.hbs +5 -0
- data/lib/templates/javascript/_scenario.hbs +4 -0
- data/lib/templates/javascript/actionword.hbs +1 -0
- data/lib/templates/javascript/actionwords.hbs +4 -0
- data/lib/templates/javascript/argument.hbs +1 -0
- data/lib/templates/javascript/assign.hbs +1 -0
- data/lib/templates/javascript/binaryexpression.hbs +1 -0
- data/lib/templates/javascript/call.hbs +2 -0
- data/lib/templates/javascript/codeceptjs/actionword.hbs +5 -0
- data/lib/templates/javascript/codeceptjs/actionwords.hbs +9 -0
- data/lib/templates/javascript/dataset.hbs +3 -0
- data/lib/templates/javascript/dict.hbs +1 -0
- data/lib/templates/javascript/es6/actionwords.hbs +4 -0
- data/lib/templates/javascript/field.hbs +1 -0
- data/lib/templates/javascript/folder.hbs +14 -0
- data/lib/templates/javascript/ifthen.hbs +7 -0
- data/lib/templates/javascript/index.hbs +1 -0
- data/lib/templates/javascript/jasmine/_before_each.hbs +3 -0
- data/lib/templates/javascript/jasmine/_scenario.hbs +8 -0
- data/lib/templates/javascript/jasmine/dataset.hbs +3 -0
- data/lib/templates/javascript/jasmine/folder.hbs +11 -0
- data/lib/templates/javascript/jasmine/scenarios.hbs +8 -0
- data/lib/templates/javascript/jasmine/single_scenario.hbs +6 -0
- data/lib/templates/javascript/jasmine/single_test.hbs +6 -0
- data/lib/templates/javascript/jasmine/tests.hbs +8 -0
- data/lib/templates/javascript/list.hbs +1 -0
- data/lib/templates/javascript/mocha/_before_each.hbs +4 -0
- data/lib/templates/javascript/mocha/folder.hbs +11 -0
- data/lib/templates/javascript/nullliteral.hbs +1 -0
- data/lib/templates/javascript/parameter.hbs +1 -0
- data/lib/templates/javascript/parenthesis.hbs +1 -0
- data/lib/templates/javascript/project.hbs +2 -0
- data/lib/templates/javascript/property.hbs +1 -0
- data/lib/templates/javascript/scenario.hbs +1 -0
- data/lib/templates/javascript/scenarios.hbs +8 -0
- data/lib/templates/javascript/single_scenario.hbs +6 -0
- data/lib/templates/javascript/single_test.hbs +6 -0
- data/lib/templates/javascript/step.hbs +1 -0
- data/lib/templates/javascript/tag.hbs +1 -0
- data/lib/templates/javascript/template.hbs +1 -0
- data/lib/templates/javascript/test.hbs +1 -0
- data/lib/templates/javascript/tests.hbs +8 -0
- data/lib/templates/javascript/while.hbs +5 -0
- data/lib/templates/jbehave/_scenario.hbs +9 -0
- data/lib/templates/jbehave/actionwords/parameter.hbs +1 -0
- data/lib/templates/jbehave/call.hbs +5 -0
- data/lib/templates/jbehave/folder.hbs +16 -0
- data/lib/templates/jbehave/single_test.hbs +3 -0
- data/lib/templates/jbehave/steps/_gherkin_pattern.hbs +1 -0
- data/lib/templates/jbehave/steps/actionword.hbs +6 -0
- data/lib/templates/jbehave/steps/actionwords.hbs +18 -0
- data/lib/templates/php/_body.hbs +9 -0
- data/lib/templates/php/_item_as_function.hbs +3 -0
- data/lib/templates/php/_scenario.hbs +4 -0
- data/lib/templates/php/_setup.hbs +4 -0
- data/lib/templates/php/actionword.hbs +1 -0
- data/lib/templates/php/actionwords.hbs +9 -0
- data/lib/templates/php/argument.hbs +1 -0
- data/lib/templates/php/assign.hbs +1 -0
- data/lib/templates/php/binaryexpression.hbs +1 -0
- data/lib/templates/php/call.hbs +2 -0
- data/lib/templates/php/dataset.hbs +3 -0
- data/lib/templates/php/dict.hbs +1 -0
- data/lib/templates/php/field.hbs +1 -0
- data/lib/templates/php/folder.hbs +17 -0
- data/lib/templates/php/ifthen.hbs +7 -0
- data/lib/templates/php/index.hbs +1 -0
- data/lib/templates/php/libraries.hbs +11 -0
- data/lib/templates/php/library.hbs +20 -0
- data/lib/templates/php/libraryactionword.hbs +1 -0
- data/lib/templates/php/list.hbs +1 -0
- data/lib/templates/php/nullliteral.hbs +1 -0
- data/lib/templates/php/parameter.hbs +1 -0
- data/lib/templates/php/parenthesis.hbs +1 -0
- data/lib/templates/php/project.hbs +2 -0
- data/lib/templates/php/property.hbs +1 -0
- data/lib/templates/php/scenario.hbs +1 -0
- data/lib/templates/php/scenarios.hbs +13 -0
- data/lib/templates/php/single_scenario.hbs +11 -0
- data/lib/templates/php/single_test.hbs +11 -0
- data/lib/templates/php/step.hbs +1 -0
- data/lib/templates/php/tag.hbs +1 -0
- data/lib/templates/php/template.hbs +1 -0
- data/lib/templates/php/test.hbs +1 -0
- data/lib/templates/php/tests.hbs +13 -0
- data/lib/templates/php/variable.hbs +1 -0
- data/lib/templates/php/while.hbs +5 -0
- data/lib/templates/python/_body.hbs +11 -0
- data/lib/templates/python/_item_as_def.hbs +2 -0
- data/lib/templates/python/_parameters.hbs +1 -0
- data/lib/templates/python/_scenario.hbs +4 -0
- data/lib/templates/python/actionword.hbs +1 -0
- data/lib/templates/python/actionwords.hbs +12 -0
- data/lib/templates/python/argument.hbs +1 -0
- data/lib/templates/python/assign.hbs +1 -0
- data/lib/templates/python/binaryexpression.hbs +1 -0
- data/lib/templates/python/booleanliteral.hbs +1 -0
- data/lib/templates/python/call.hbs +2 -0
- data/lib/templates/python/dataset.hbs +2 -0
- data/lib/templates/python/dict.hbs +1 -0
- data/lib/templates/python/field.hbs +1 -0
- data/lib/templates/python/folder.hbs +12 -0
- data/lib/templates/python/ifthen.hbs +4 -0
- data/lib/templates/python/index.hbs +1 -0
- data/lib/templates/python/libraries.hbs +9 -0
- data/lib/templates/python/library.hbs +17 -0
- data/lib/templates/python/libraryactionword.hbs +1 -0
- data/lib/templates/python/list.hbs +1 -0
- data/lib/templates/python/nullliteral.hbs +1 -0
- data/lib/templates/python/parameter.hbs +1 -0
- data/lib/templates/python/parenthesis.hbs +1 -0
- data/lib/templates/python/project.hbs +2 -0
- data/lib/templates/python/property.hbs +1 -0
- data/lib/templates/python/scenario.hbs +1 -0
- data/lib/templates/python/scenarios.hbs +11 -0
- data/lib/templates/python/single_scenario.hbs +9 -0
- data/lib/templates/python/single_test.hbs +9 -0
- data/lib/templates/python/step.hbs +1 -0
- data/lib/templates/python/tag.hbs +1 -0
- data/lib/templates/python/template.hbs +1 -0
- data/lib/templates/python/test.hbs +1 -0
- data/lib/templates/python/tests.hbs +11 -0
- data/lib/templates/python/unittest/actionwords.hbs +9 -0
- data/lib/templates/python/while.hbs +4 -0
- data/lib/templates/robotframework/_keyword.hbs +1 -0
- data/lib/templates/robotframework/_keyword_body.hbs +4 -0
- data/lib/templates/robotframework/_scenario.hbs +12 -0
- data/lib/templates/robotframework/actionword.hbs +3 -0
- data/lib/templates/robotframework/actionwords.hbs +4 -0
- data/lib/templates/robotframework/argument.hbs +1 -0
- data/lib/templates/robotframework/call.hbs +1 -0
- data/lib/templates/robotframework/dataset.hbs +1 -0
- data/lib/templates/robotframework/datatable.hbs +2 -0
- data/lib/templates/robotframework/folder.hbs +35 -0
- data/lib/templates/robotframework/ifthen.hbs +1 -0
- data/lib/templates/robotframework/parameter.hbs +1 -0
- data/lib/templates/robotframework/property.hbs +1 -0
- data/lib/templates/robotframework/scenarios.hbs +25 -0
- data/lib/templates/robotframework/single_scenario.hbs +10 -0
- data/lib/templates/robotframework/single_test.hbs +10 -0
- data/lib/templates/robotframework/stringliteral.hbs +1 -0
- data/lib/templates/robotframework/template.hbs +1 -0
- data/lib/templates/robotframework/test.hbs +1 -0
- data/lib/templates/robotframework/tests.hbs +7 -0
- data/lib/templates/robotframework/variable.hbs +1 -0
- data/lib/templates/robotframework/while.hbs +1 -0
- data/lib/templates/ruby/_body.hbs +10 -0
- data/lib/templates/ruby/_item_as_def.hbs +3 -0
- data/lib/templates/ruby/_scenario.hbs +5 -0
- data/lib/templates/ruby/actionword.hbs +1 -0
- data/lib/templates/ruby/actionwords.hbs +6 -0
- data/lib/templates/ruby/argument.hbs +1 -0
- data/lib/templates/ruby/assign.hbs +1 -0
- data/lib/templates/ruby/binaryexpression.hbs +1 -0
- data/lib/templates/ruby/call.hbs +2 -0
- data/lib/templates/ruby/dataset.hbs +3 -0
- data/lib/templates/ruby/dict.hbs +1 -0
- data/lib/templates/ruby/field.hbs +1 -0
- data/lib/templates/ruby/folder.hbs +16 -0
- data/lib/templates/ruby/ifthen.hbs +7 -0
- data/lib/templates/ruby/index.hbs +1 -0
- data/lib/templates/ruby/list.hbs +1 -0
- data/lib/templates/ruby/minitest/_item_as_def.hbs +3 -0
- data/lib/templates/ruby/minitest/_scenario.hbs +4 -0
- data/lib/templates/ruby/minitest/dataset.hbs +3 -0
- data/lib/templates/ruby/minitest/folder.hbs +18 -0
- data/lib/templates/ruby/minitest/scenario.hbs +1 -0
- data/lib/templates/ruby/minitest/scenarios.hbs +13 -0
- data/lib/templates/ruby/minitest/single_scenario.hbs +11 -0
- data/lib/templates/ruby/minitest/single_test.hbs +11 -0
- data/lib/templates/ruby/minitest/test.hbs +1 -0
- data/lib/templates/ruby/minitest/tests.hbs +13 -0
- data/lib/templates/ruby/parameter.hbs +1 -0
- data/lib/templates/ruby/parenthesis.hbs +1 -0
- data/lib/templates/ruby/project.hbs +2 -0
- data/lib/templates/ruby/property.hbs +1 -0
- data/lib/templates/ruby/scenario.hbs +1 -0
- data/lib/templates/ruby/scenarios.hbs +12 -0
- data/lib/templates/ruby/single_scenario.hbs +11 -0
- data/lib/templates/ruby/single_test.hbs +11 -0
- data/lib/templates/ruby/step.hbs +1 -0
- data/lib/templates/ruby/symbol.hbs +1 -0
- data/lib/templates/ruby/tag.hbs +1 -0
- data/lib/templates/ruby/template.hbs +1 -0
- data/lib/templates/ruby/test.hbs +1 -0
- data/lib/templates/ruby/tests.hbs +12 -0
- data/lib/templates/ruby/while.hbs +5 -0
- data/lib/templates/seleniumide/argument.hbs +1 -0
- data/lib/templates/seleniumide/call.hbs +6 -0
- data/lib/templates/seleniumide/single_test.hbs +28 -0
- data/lib/templates/seleniumide/step.hbs +0 -0
- data/lib/templates/seleniumide/stringliteral.hbs +1 -0
- data/lib/templates/seleniumide/template.hbs +1 -0
- data/lib/templates/seleniumide/test.hbs +4 -0
- data/lib/templates/seleniumide/tests.hbs +19 -0
- data/lib/templates/specflow/actionword.hbs +6 -0
- data/lib/templates/specflow/actionwords/parameter.hbs +1 -0
- data/lib/templates/specflow/actionwords.hbs +14 -0
- data/lib/templates/specflow/gherkin/tag.hbs +1 -0
- data/lib/templates/specflow/parameter.hbs +1 -0
- data/lib/templates/swift/_body.hbs +11 -0
- data/lib/templates/swift/_item_as_def.hbs +5 -0
- data/lib/templates/swift/_scenario.hbs +7 -0
- data/lib/templates/swift/actionword.hbs +1 -0
- data/lib/templates/swift/actionwords.hbs +6 -0
- data/lib/templates/swift/argument.hbs +1 -0
- data/lib/templates/swift/assign.hbs +1 -0
- data/lib/templates/swift/binaryexpression.hbs +1 -0
- data/lib/templates/swift/call.hbs +2 -0
- data/lib/templates/swift/dataset.hbs +4 -0
- data/lib/templates/swift/dict.hbs +1 -0
- data/lib/templates/swift/field.hbs +1 -0
- data/lib/templates/swift/folder.hbs +23 -0
- data/lib/templates/swift/ifthen.hbs +7 -0
- data/lib/templates/swift/index.hbs +1 -0
- data/lib/templates/swift/list.hbs +1 -0
- data/lib/templates/swift/parameter.hbs +1 -0
- data/lib/templates/swift/parenthesis.hbs +1 -0
- data/lib/templates/swift/project.hbs +2 -0
- data/lib/templates/swift/property.hbs +1 -0
- data/lib/templates/swift/scenario.hbs +1 -0
- data/lib/templates/swift/scenarios.hbs +25 -0
- data/lib/templates/swift/single_scenario.hbs +24 -0
- data/lib/templates/swift/single_test.hbs +23 -0
- data/lib/templates/swift/step.hbs +1 -0
- data/lib/templates/swift/stringliteral.hbs +1 -0
- data/lib/templates/swift/symbol.hbs +1 -0
- data/lib/templates/swift/tag.hbs +1 -0
- data/lib/templates/swift/template.hbs +1 -0
- data/lib/templates/swift/test.hbs +1 -0
- data/lib/templates/swift/tests.hbs +25 -0
- data/lib/templates/swift/while.hbs +5 -0
- data/lib/templates/typescript/_item_as_function.hbs +3 -0
- data/lib/templates/typescript/actionword.hbs +1 -0
- data/lib/templates/typescript/actionwords.hbs +7 -0
- data/lib/templates/typescript/libraries.hbs +9 -0
- data/lib/templates/typescript/library.hbs +18 -0
- data/lib/templates/typescript/libraryactionword.hbs +1 -0
- data/lib/templates/typescript/parameter.hbs +1 -0
- metadata +783 -0
@@ -0,0 +1,261 @@
|
|
1
|
+
require 'colorize'
|
2
|
+
require 'json'
|
3
|
+
require 'yaml'
|
4
|
+
|
5
|
+
require 'hiptest-publisher/node_modifiers/add_all'
|
6
|
+
require 'hiptest-publisher/cli_options_checker'
|
7
|
+
require 'hiptest-publisher/client'
|
8
|
+
require 'hiptest-publisher/formatters/diff_displayer'
|
9
|
+
require 'hiptest-publisher/formatters/reporter'
|
10
|
+
require 'hiptest-publisher/file_writer'
|
11
|
+
require 'hiptest-publisher/handlebars_helper'
|
12
|
+
require 'hiptest-publisher/i18n'
|
13
|
+
require 'hiptest-publisher/options_parser'
|
14
|
+
require 'hiptest-publisher/renderer'
|
15
|
+
require 'hiptest-publisher/signature_differ'
|
16
|
+
require 'hiptest-publisher/signature_exporter'
|
17
|
+
require 'hiptest-publisher/string'
|
18
|
+
require 'hiptest-publisher/utils'
|
19
|
+
require 'hiptest-publisher/version_checker'
|
20
|
+
require 'hiptest-publisher/xml_parser'
|
21
|
+
|
22
|
+
module Hiptest
|
23
|
+
class Publisher
|
24
|
+
attr_reader :reporter
|
25
|
+
|
26
|
+
def initialize(args, listeners: nil, exit_on_bad_arguments: true)
|
27
|
+
@reporter = Reporter.new(listeners)
|
28
|
+
@cli_options = OptionsParser.parse(args, reporter)
|
29
|
+
@client = Hiptest::Client.new(@cli_options, reporter)
|
30
|
+
@file_writer = Hiptest::FileWriter.new(@reporter)
|
31
|
+
|
32
|
+
# pass false to prevent hiptest-publisher from exiting, useful when used embedded
|
33
|
+
@exit_on_bad_arguments = exit_on_bad_arguments
|
34
|
+
end
|
35
|
+
|
36
|
+
def run
|
37
|
+
if @cli_options.check_version
|
38
|
+
return VersionChecker.check_version
|
39
|
+
end
|
40
|
+
|
41
|
+
begin
|
42
|
+
CliOptionsChecker.new(@cli_options, reporter).check!
|
43
|
+
rescue CliOptionError => e
|
44
|
+
puts e.message
|
45
|
+
exit 1 if @exit_on_bad_arguments
|
46
|
+
raise
|
47
|
+
end
|
48
|
+
|
49
|
+
if @cli_options.only == 'list'
|
50
|
+
print_categories
|
51
|
+
return
|
52
|
+
end
|
53
|
+
|
54
|
+
if @cli_options.push?
|
55
|
+
post_results
|
56
|
+
return
|
57
|
+
end
|
58
|
+
|
59
|
+
xml = get_xml_file
|
60
|
+
return if xml.nil?
|
61
|
+
|
62
|
+
@project = get_project(xml)
|
63
|
+
|
64
|
+
if @cli_options.actionwords_signature
|
65
|
+
export_actionword_signature
|
66
|
+
return
|
67
|
+
end
|
68
|
+
|
69
|
+
if @cli_options.actionwords_diff?
|
70
|
+
show_actionwords_diff
|
71
|
+
return
|
72
|
+
end
|
73
|
+
|
74
|
+
export
|
75
|
+
end
|
76
|
+
|
77
|
+
def get_xml_file
|
78
|
+
if @cli_options.xml_file
|
79
|
+
IO.read(@cli_options.xml_file)
|
80
|
+
else
|
81
|
+
fetch_xml_file
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
85
|
+
def fetch_xml_file
|
86
|
+
@client.fetch_project
|
87
|
+
rescue ClientError => err
|
88
|
+
# This should not be an error that needs reporting to an exception monitoring app
|
89
|
+
reporter.show_error(err.message)
|
90
|
+
if @exit_on_bad_arguments == false # means we are embedded in hiptest-publisher
|
91
|
+
raise
|
92
|
+
end
|
93
|
+
rescue => err
|
94
|
+
reporter.show_failure(I18n.t("errors.default"))
|
95
|
+
reporter.dump_error(err)
|
96
|
+
end
|
97
|
+
|
98
|
+
def get_project(xml)
|
99
|
+
reporter.with_status_message I18n.t('build_data.title') do
|
100
|
+
parser = Hiptest::XMLParser.new(xml, reporter)
|
101
|
+
return parser.build_project
|
102
|
+
end
|
103
|
+
rescue => err
|
104
|
+
reporter.dump_error(err)
|
105
|
+
end
|
106
|
+
|
107
|
+
def write_to_file(path, message, ask_overwrite: false)
|
108
|
+
return if ask_overwrite && !overwrite_file?(path)
|
109
|
+
@file_writer.write_to_file(path, message) { yield }
|
110
|
+
end
|
111
|
+
|
112
|
+
def overwrite_file?(path)
|
113
|
+
return true unless File.file?(path)
|
114
|
+
return true if @cli_options.force_overwrite
|
115
|
+
|
116
|
+
if $stdout.tty?
|
117
|
+
answer = reporter.ask(I18n.t('overwrite.ask_confirmation', path: path))
|
118
|
+
return ['y', 'yes'].include?(answer)
|
119
|
+
else
|
120
|
+
reporter.warning_message(I18n.t('overwrite.warning_message', path: path))
|
121
|
+
return false
|
122
|
+
end
|
123
|
+
end
|
124
|
+
|
125
|
+
def add_listener(listener)
|
126
|
+
reporter.add_listener(listener)
|
127
|
+
end
|
128
|
+
|
129
|
+
def write_node_to_file(path, node, context, message, ask_overwrite: false)
|
130
|
+
write_to_file(path, message, ask_overwrite: ask_overwrite) do
|
131
|
+
Hiptest::Renderer.render(node, context)
|
132
|
+
end
|
133
|
+
end
|
134
|
+
|
135
|
+
def export_files
|
136
|
+
@language_config.language_group_configs.each do |language_group_config|
|
137
|
+
next if ['library', 'libraries'].include?(language_group_config[:group_name]) && !@project.has_libraries?
|
138
|
+
ask_overwrite = ['actionwords', 'libraries'].include?(language_group_config[:group_name])
|
139
|
+
|
140
|
+
language_group_config.each_node_rendering_context(@project) do |node_rendering_context|
|
141
|
+
write_node_to_file(
|
142
|
+
node_rendering_context.path,
|
143
|
+
node_rendering_context.node,
|
144
|
+
node_rendering_context,
|
145
|
+
I18n.t(:exporting_file, name: node_rendering_context.description),
|
146
|
+
ask_overwrite: ask_overwrite
|
147
|
+
)
|
148
|
+
end
|
149
|
+
end
|
150
|
+
end
|
151
|
+
|
152
|
+
def export_actionword_signature
|
153
|
+
analyze_project_data
|
154
|
+
|
155
|
+
write_to_file(
|
156
|
+
"#{@cli_options.output_directory}/actionwords_signature.yaml",
|
157
|
+
I18n.t('actionwords_diff.exporting_title'),
|
158
|
+
ask_overwrite: true
|
159
|
+
) { Hiptest::SignatureExporter.export_actionwords(@project).to_yaml }
|
160
|
+
end
|
161
|
+
|
162
|
+
def compute_actionwords_diff
|
163
|
+
old = nil
|
164
|
+
reporter.with_status_message I18n.t('actionwords_diff.loading_previous_definition') do
|
165
|
+
old = YAML.load_file("#{@cli_options.output_directory}/actionwords_signature.yaml")
|
166
|
+
end
|
167
|
+
|
168
|
+
analyze_project_data
|
169
|
+
|
170
|
+
current = Hiptest::SignatureExporter.export_actionwords(@project, true)
|
171
|
+
diff = Hiptest::SignatureDiffer.diff(old, current, library_name: @cli_options.library_name)
|
172
|
+
end
|
173
|
+
|
174
|
+
def show_actionwords_diff
|
175
|
+
Hiptest::DiffDisplayer.new(compute_actionwords_diff, @cli_options, @language_config, @file_writer).display
|
176
|
+
rescue => err
|
177
|
+
reporter.dump_error(err)
|
178
|
+
end
|
179
|
+
|
180
|
+
def analyze_project_data
|
181
|
+
return if @project_data_analyzed
|
182
|
+
reporter.with_status_message I18n.t(:analyzing_data) do
|
183
|
+
@language_config = LanguageConfigParser.new(@cli_options)
|
184
|
+
Hiptest::NodeModifiers.add_all(@project, @cli_options.sort)
|
185
|
+
end
|
186
|
+
@project_data_analyzed = true
|
187
|
+
end
|
188
|
+
|
189
|
+
def export
|
190
|
+
return if @project.nil?
|
191
|
+
|
192
|
+
analyze_project_data
|
193
|
+
export_files
|
194
|
+
export_actionword_signature if @language_config.include_group?("actionwords")
|
195
|
+
end
|
196
|
+
|
197
|
+
def print_categories
|
198
|
+
language_config = LanguageConfigParser.new(@cli_options)
|
199
|
+
group_names = language_config.group_names
|
200
|
+
puts I18n.t('help.categories.title', language: @cli_options.language)
|
201
|
+
group_names.each do |group_name|
|
202
|
+
puts " - #{group_name}"
|
203
|
+
end
|
204
|
+
puts I18n.t('help.categories.usage_example', language: @cli_options.language, first: group_names.first, second: group_names[1])
|
205
|
+
end
|
206
|
+
|
207
|
+
def post_results
|
208
|
+
response = nil
|
209
|
+
reporter.with_status_message I18n.t('push.posting_results', file: @cli_options.push, site: @cli_options.site) do
|
210
|
+
response = @client.push_results
|
211
|
+
end
|
212
|
+
if valid_hiptest_api_response?(response)
|
213
|
+
report_imported_results(response)
|
214
|
+
else
|
215
|
+
report_hiptest_api_error(response)
|
216
|
+
end
|
217
|
+
rescue => err
|
218
|
+
reporter.dump_error(err)
|
219
|
+
end
|
220
|
+
|
221
|
+
def valid_hiptest_api_response?(response)
|
222
|
+
response.is_a?(Net::HTTPSuccess)
|
223
|
+
end
|
224
|
+
|
225
|
+
def report_imported_results(response)
|
226
|
+
json = JSON.parse(response.body)
|
227
|
+
|
228
|
+
reported_tests = json.has_key?('test_import') ? json['test_import'] : []
|
229
|
+
passed_count = reported_tests.size
|
230
|
+
|
231
|
+
reporter.with_status_message I18n.t('push.tests_imported_summary', count: passed_count) do
|
232
|
+
if @cli_options.verbose
|
233
|
+
reported_tests.each do |imported_test|
|
234
|
+
puts I18n.t('push.test_imported', name: imported_test['name'])
|
235
|
+
end
|
236
|
+
end
|
237
|
+
end
|
238
|
+
|
239
|
+
display_empty_push_help if passed_count == 0
|
240
|
+
end
|
241
|
+
|
242
|
+
def report_hiptest_api_error(response)
|
243
|
+
reporter.failure_message(I18n.t('errors.api_error', code: response.code))
|
244
|
+
if response.code == "422" && response.body.start_with?("Unknown format")
|
245
|
+
STDERR.print response.body.chomp + "\n"
|
246
|
+
elsif response.code == "404"
|
247
|
+
STDERR.print I18n.t('errors.project_not_found')
|
248
|
+
end
|
249
|
+
end
|
250
|
+
|
251
|
+
def display_empty_push_help
|
252
|
+
command = @cli_options.command_line_used(exclude: [:push, :push_format, :execution_environment])
|
253
|
+
enhanced_command = "#{command} --without=actionwords"
|
254
|
+
if @cli_options.test_run_id.nil? || @cli_options.test_run_id.empty?
|
255
|
+
enhanced_command += " --test-run-id=<#{I18n.t('push.test_run_id')}>"
|
256
|
+
end
|
257
|
+
|
258
|
+
puts I18n.t('push.empty_results', enhanced_command: enhanced_command)
|
259
|
+
end
|
260
|
+
end
|
261
|
+
end
|
@@ -0,0 +1,8 @@
|
|
1
|
+
{{#if rendered_children.gherkin_annotation }}
|
2
|
+
/**
|
3
|
+
* @{{{ rendered_children.gherkin_annotation }}} /{{> gherkin_pattern}}/
|
4
|
+
*/
|
5
|
+
public function {{{ camelize_lower rendered_children.name }}}({{#if has_parameters?}}{{{ join rendered_children.parameters_ordered_by_pattern ', '}}}{{/if}}){{#curly}}{{#indent}}
|
6
|
+
$this->actionwords->{{{ camelize_lower rendered_children.name }}}({{#if has_parameters?}}{{#join raw_parameter_names ', ' as |param|}}${{{underscore param}}}{{/join}}{{/if}});
|
7
|
+
{{/indent}}
|
8
|
+
{{/curly}}{{/if}}
|
@@ -0,0 +1 @@
|
|
1
|
+
{{#if is_datatable?}}TableNode {{/if}}{{#if is_free_text?}}PyStringNode {{/if}}${{{underscore rendered_children.name}}}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
<?php
|
2
|
+
use Behat\Behat\Tester\Exception\PendingException;
|
3
|
+
use Behat\Behat\Context\SnippetAcceptingContext;
|
4
|
+
use Behat\Gherkin\Node\PyStringNode;
|
5
|
+
use Behat\Gherkin\Node\TableNode;
|
6
|
+
|
7
|
+
require_once('Actionwords.php');
|
8
|
+
|
9
|
+
class FeatureContext implements SnippetAcceptingContext {{#curly}}{{#indent}}
|
10
|
+
public function __construct() {{#curly}}{{#indent}}
|
11
|
+
$this->actionwords = new Actionwords();{{/indent}}
|
12
|
+
{{/curly}}
|
13
|
+
{{#each rendered_children.actionwords as |actionword|}}
|
14
|
+
{{{actionword}}}{{/each}}{{/indent}}
|
15
|
+
{{/curly}}
|
16
|
+
?>
|
@@ -0,0 +1,16 @@
|
|
1
|
+
<?php
|
2
|
+
use Behat\Behat\Tester\Exception\PendingException;
|
3
|
+
use Behat\Behat\Context\SnippetAcceptingContext;
|
4
|
+
use Behat\Gherkin\Node\PyStringNode;
|
5
|
+
use Behat\Gherkin\Node\TableNode;
|
6
|
+
|
7
|
+
require_once('Actionwords.php');
|
8
|
+
|
9
|
+
class {{camelize rendered_children.name}}FeatureContext implements SnippetAcceptingContext {{#curly}}{{#indent}}
|
10
|
+
public function __construct() {{#curly}}{{#indent}}
|
11
|
+
$this->actionwords = new Actionwords();{{/indent}}
|
12
|
+
{{/curly}}
|
13
|
+
{{#each rendered_children.library_actionwords as |actionword|}}
|
14
|
+
{{{actionword}}}{{/each}}{{/indent}}
|
15
|
+
{{/curly}}
|
16
|
+
?>
|
@@ -0,0 +1,8 @@
|
|
1
|
+
{{#if rendered_children.gherkin_annotation }}
|
2
|
+
/**
|
3
|
+
* @{{{ rendered_children.gherkin_annotation }}} /{{> gherkin_pattern}}/
|
4
|
+
*/
|
5
|
+
public function {{{ camelize_lower rendered_children.name }}}({{#if has_parameters?}}{{{ join rendered_children.parameters_ordered_by_pattern ', '}}}{{/if}}){{#curly}}{{#indent}}
|
6
|
+
$this->actionwords->get{{{camelize library_name}}}Library()->{{{ camelize_lower rendered_children.name }}}({{#if has_parameters?}}{{#join raw_parameter_names ', ' as |param|}}${{{underscore param}}}{{/join}}{{/if}});
|
7
|
+
{{/indent}}
|
8
|
+
{{/curly}}{{/if}}
|
@@ -0,0 +1 @@
|
|
1
|
+
{{#if is_datatable?}}TableNode {{/if}}{{#if is_free_text?}}PyStringNode {{/if}}${{{underscore rendered_children.name}}}
|
@@ -0,0 +1,4 @@
|
|
1
|
+
{{#if rendered_children.gherkin_used_annotations}}
|
2
|
+
{{#each rendered_children.gherkin_used_annotations as |annotation|}}@{{{downcase annotation }}}(r'{{#remove_last_character ':'}}{{#escape_single_quotes}}{{#strip_regexp_delimiters}}{{> gherkin_pattern}}{{/strip_regexp_delimiters}}{{/escape_single_quotes}}{{/remove_last_character}}')
|
3
|
+
{{/each}}def impl(context{{#if has_parameters?}}, {{{ join rendered_children.parameters_ordered_by_pattern ', '}}}{{/if}}):{{#indent}}
|
4
|
+
context.actionwords.{{{ underscore rendered_children.name }}}({{#if has_parameters?}}{{#join raw_parameter_names ', ' as |param|}}{{#replace "__datatable" "context.table"}}{{#replace "__free_text" "context.text"}}{{{underscore param}}}{{/replace}}{{/replace}}{{/join}}{{/if}}){{/indent}}{{/if}}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
from behave import *
|
2
|
+
|
3
|
+
# This should be added to environment.py
|
4
|
+
# from steps.actionwords import Actionwords
|
5
|
+
#
|
6
|
+
# def before_scenario(context, scenario):
|
7
|
+
# context.actionwords = Actionwords()
|
8
|
+
|
9
|
+
use_step_matcher('re')
|
10
|
+
{{#each rendered_children.sorted_actionwords as |actionword|}}
|
11
|
+
{{{ actionword }}}
|
12
|
+
{{/each}}
|
@@ -0,0 +1,4 @@
|
|
1
|
+
{{#if rendered_children.gherkin_used_annotations}}
|
2
|
+
{{#each rendered_children.gherkin_used_annotations as |annotation|}}@{{{downcase annotation }}}(r'{{#remove_last_character ':'}}{{#escape_single_quotes}}{{#strip_regexp_delimiters}}{{> gherkin_pattern}}{{/strip_regexp_delimiters}}{{/escape_single_quotes}}{{/remove_last_character}}')
|
3
|
+
{{/each}}def impl(context{{#if has_parameters?}}, {{{ join rendered_children.parameters_ordered_by_pattern ', '}}}{{/if}}):{{#indent}}
|
4
|
+
context.actionwords.get{{capitalize library_name}}Library().{{{ underscore rendered_children.name }}}({{#if has_parameters?}}{{#join raw_parameter_names ', ' as |param|}}{{#replace "__datatable" "context.table"}}{{#replace "__free_text" "context.text"}}{{{underscore param}}}{{/replace}}{{/replace}}{{/join}}{{/if}}){{/indent}}{{/if}}
|
@@ -0,0 +1 @@
|
|
1
|
+
None
|
@@ -0,0 +1 @@
|
|
1
|
+
^{{#strip}}{{#join chunks context.parameter_delimiter as |treated_chunk|}}{{treated_chunk.value}}{{/join}}{{#each extra_inlined_parameters as |param|}} {{context.parameter_delimiter}}{{param.value}}{{context.parameter_delimiter}}{{/each}}{{/strip}}$
|
@@ -0,0 +1 @@
|
|
1
|
+
{{#strip}}{{#each chunks as |treated_chunk|}}{{treated_chunk.typed_value}}{{/each}}{{#each extra_inlined_parameters as |param|}} {{param.typed_value}}{{/each}}{{/strip}}
|
@@ -0,0 +1 @@
|
|
1
|
+
{{to_string rendered_children.value }}
|
File without changes
|
File without changes
|
@@ -0,0 +1 @@
|
|
1
|
+
nil
|
@@ -0,0 +1 @@
|
|
1
|
+
{{ rendered_children.value }}
|
@@ -0,0 +1 @@
|
|
1
|
+
'{{ rendered_children.value }}'
|
@@ -0,0 +1 @@
|
|
1
|
+
{{to_string rendered_children.value }}
|
@@ -0,0 +1 @@
|
|
1
|
+
{{{ rendered_children.operator }}}{{{ rendered_children.expression }}}
|
@@ -0,0 +1 @@
|
|
1
|
+
{{ underscore rendered_children.name }}
|
@@ -0,0 +1,8 @@
|
|
1
|
+
public void {{{ camelize_upper rendered_children.name }}}({{#if has_parameters?}}{{{join rendered_children.parameters ', '}}}{{/if}}) {{#curly}}
|
2
|
+
{{#clear_empty_lines}}
|
3
|
+
{{#indent}}{{#comment '//'}}{{#if has_tags?}}Tags: {{{ join rendered_children.tags ' '}}}
|
4
|
+
{{/if}}{{#if has_description?}}{{rendered_children.description}}
|
5
|
+
{{/if}}{{/comment}}{{/indent}}
|
6
|
+
{{> body}}
|
7
|
+
{{/clear_empty_lines}}
|
8
|
+
{{/curly}}
|
@@ -0,0 +1,8 @@
|
|
1
|
+
{{#if has_datasets?}}{{> item_as_function}}
|
2
|
+
{{{ rendered_children.datatable }}}
|
3
|
+
{{else}}{{#comment '//'}}{{{ rendered_children.description }}}
|
4
|
+
{{#if has_tags?}}Tags: {{{ join rendered_children.tags ' '}}}{{/if}}
|
5
|
+
{{/comment}}
|
6
|
+
[Test]
|
7
|
+
public void {{{ camelize rendered_children.name }}}{{#if rendered_children.uid}}Uid{{{ normalize rendered_children.uid}}}{{/if}}() {{#curly}}{{> body}}
|
8
|
+
{{/curly}}{{/if}}
|
@@ -0,0 +1 @@
|
|
1
|
+
{{> item_as_function}}
|
@@ -0,0 +1 @@
|
|
1
|
+
{{{escape_new_line rendered_children.value }}}
|
@@ -0,0 +1 @@
|
|
1
|
+
{{{ rendered_children.to }}} = {{{ rendered_children.value }}};
|
@@ -0,0 +1 @@
|
|
1
|
+
{{{ rendered_children.left }}} {{{ rendered_children.operator }}} {{{ rendered_children.right }}}
|
@@ -0,0 +1,4 @@
|
|
1
|
+
[Test]
|
2
|
+
public void {{{ camelize scenario_name}}}{{{ camelize rendered_children.name}}}{{#if rendered_children.test_snapshot_uid}}Uid{{{ normalize rendered_children.test_snapshot_uid}}}{{/if}}() {{#curly}}
|
3
|
+
{{#indent}}{{{ camelize scenario_name }}}({{{ join rendered_children.arguments ', '}}});{{/indent}}
|
4
|
+
{{/curly}}
|
@@ -0,0 +1 @@
|
|
1
|
+
new Dictionary<String, String>() {{#curly}}{{{ join rendered_children.items ', '}}}{{/curly}}
|
@@ -0,0 +1 @@
|
|
1
|
+
{{{ rendered_children.base }}}.{{{ rendered_children.name }}}
|
@@ -0,0 +1,22 @@
|
|
1
|
+
namespace {{{ context.namespace }}}{{{ relative_package }}} {{#curly}}{{#indent}}
|
2
|
+
|
3
|
+
using System;
|
4
|
+
using NUnit.Framework;
|
5
|
+
{{#if needs_to_import_actionwords? }}using {{{ context.namespace }}};
|
6
|
+
{{/if}}
|
7
|
+
[TestFixture]
|
8
|
+
public class {{{ clear_extension context.filename }}} {{#curly}}
|
9
|
+
{{#indent}}
|
10
|
+
public Actionwords {{{ context.call_prefix }}};
|
11
|
+
|
12
|
+
[SetUp]
|
13
|
+
protected void SetUp() {{#curly}}{{#indent}}
|
14
|
+
{{{ context.call_prefix}}} = new Actionwords();{{/indent}}{{#unless is_empty?}}
|
15
|
+
{{> body}}{{/unless}}
|
16
|
+
{{/curly}}
|
17
|
+
{{#each rendered_children.scenarios as |scenario|}}{{{scenario}}}
|
18
|
+
{{/each}}
|
19
|
+
{{/indent}}
|
20
|
+
{{/curly}}
|
21
|
+
{{/indent}}
|
22
|
+
{{/curly}}
|
@@ -0,0 +1,7 @@
|
|
1
|
+
if ({{{ rendered_children.condition }}}) {{#curly}}
|
2
|
+
{{#indent}}{{#each rendered_children.then as |then_statement|}}{{{then_statement}}}
|
3
|
+
{{/each}}{{/indent}}
|
4
|
+
{{#if has_else?}}} else {
|
5
|
+
{{#indent}}{{#each rendered_children.else as |else_statement|}}{{{else_statement}}}
|
6
|
+
{{/each}}{{/indent}}
|
7
|
+
{{/if}}{{/curly}}
|
@@ -0,0 +1 @@
|
|
1
|
+
{{{ rendered_children.base }}}[{{{ rendered_children.expression }}}]
|
@@ -0,0 +1 @@
|
|
1
|
+
{{#curly}}{{{ join rendered_children.items ', '}}}{{/curly}}
|
@@ -0,0 +1 @@
|
|
1
|
+
null
|
@@ -0,0 +1 @@
|
|
1
|
+
{{{ downcase node.type }}} {{{ camelize_lower rendered_children.name }}}
|
@@ -0,0 +1 @@
|
|
1
|
+
({{{ rendered_children.content }}})
|
@@ -0,0 +1 @@
|
|
1
|
+
{{#curly}}{{{ rendered_children.key }}}, {{{ rendered_children.value }}}{{/curly}}
|
@@ -0,0 +1 @@
|
|
1
|
+
{{> scenario}}
|
@@ -0,0 +1,20 @@
|
|
1
|
+
namespace {{{ context.namespace }}} {{#curly}}{{#indent}}
|
2
|
+
|
3
|
+
using System;
|
4
|
+
using NUnit.Framework;
|
5
|
+
|
6
|
+
[TestFixture]
|
7
|
+
public class {{{ clear_extension context.filename }}} {{#curly}}
|
8
|
+
{{#indent}}
|
9
|
+
public Actionwords {{{ context.call_prefix }}};
|
10
|
+
|
11
|
+
[SetUp]
|
12
|
+
protected void SetUp() {{#curly}}
|
13
|
+
{{{ context.call_prefix}}} = new Actionwords();
|
14
|
+
{{/curly}}
|
15
|
+
{{#each rendered_children.scenarios as |scenario|}}{{{scenario}}}
|
16
|
+
{{/each}}
|
17
|
+
{{/indent}}
|
18
|
+
{{/curly}}
|
19
|
+
{{/indent}}
|
20
|
+
{{/curly}}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
namespace {{{ context.namespace }}}{{{ relative_package }}} {{#curly}}{{#indent}}
|
2
|
+
|
3
|
+
using System;
|
4
|
+
using NUnit.Framework;
|
5
|
+
{{#if needs_to_import_actionwords? }}using {{{ context.namespace }}};
|
6
|
+
{{/if}}
|
7
|
+
[TestFixture]
|
8
|
+
public class {{{ clear_extension context.filename }}} {{#curly}}
|
9
|
+
{{#indent}}
|
10
|
+
public Actionwords {{{ context.call_prefix }}} = new Actionwords();
|
11
|
+
|
12
|
+
{{> scenario}}
|
13
|
+
{{/indent}}
|
14
|
+
{{/curly}}
|
15
|
+
{{/indent}}
|
16
|
+
{{/curly}}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
namespace {{{ context.namespace }}} {{#curly}}{{#indent}}
|
2
|
+
|
3
|
+
using System;
|
4
|
+
using NUnit.Framework;
|
5
|
+
|
6
|
+
[TestFixture]
|
7
|
+
public class {{{ clear_extension context.filename }}} {{#curly}}
|
8
|
+
{{#indent}}
|
9
|
+
public Actionwords {{{ context.call_prefix }}} = new Actionwords();
|
10
|
+
|
11
|
+
{{> scenario}}
|
12
|
+
{{/indent}}
|
13
|
+
{{/curly}}
|
14
|
+
{{/indent}}
|
15
|
+
{{/curly}}
|
@@ -0,0 +1 @@
|
|
1
|
+
{{#comment '//'}}TODO: Implement {{{ rendered_children.key }}}: {{{ rendered_children.value }}}{{/comment}}
|
@@ -0,0 +1 @@
|
|
1
|
+
"{{escape_double_quotes rendered_children.value }}"
|
@@ -0,0 +1 @@
|
|
1
|
+
{{{ rendered_children.key }}}{{#if has_value? }}:{{{ rendered_children.value }}}{{/if}}
|
@@ -0,0 +1 @@
|
|
1
|
+
{{#join treated_chunks ' + ' as |treated_chunk|}}{{#if treated_chunk.is_variable?}}{{{treated_chunk.raw.children.name}}}{{else}}"{{{ escape_double_quotes treated_chunk.raw.children.value }}}"{{/if}}{{else}}""{{/join}}
|
@@ -0,0 +1 @@
|
|
1
|
+
{{> scenario}}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
namespace {{{ context.namespace }}} {{#curly}}{{#indent}}
|
2
|
+
|
3
|
+
using System;
|
4
|
+
using NUnit.Framework;
|
5
|
+
|
6
|
+
[TestFixture]
|
7
|
+
public class {{{ clear_extension context.filename }}} {{#curly}}
|
8
|
+
{{#indent}}
|
9
|
+
public Actionwords {{{ context.call_prefix }}} = new Actionwords();
|
10
|
+
{{#each rendered_children.tests as |test|}}{{{test}}}
|
11
|
+
{{/each}}
|
12
|
+
{{/indent}}
|
13
|
+
{{/curly}}
|
14
|
+
{{/indent}}
|
15
|
+
{{/curly}}
|
@@ -0,0 +1 @@
|
|
1
|
+
{{ camelize_lower rendered_children.name }}
|
@@ -0,0 +1,5 @@
|
|
1
|
+
{{#if rendered_children.gherkin_annotation }}
|
2
|
+
{{{ rendered_children.gherkin_annotation }}} /{{> gherkin_pattern}}/ do{{#if has_parameters?}} |{{{ join rendered_children.parameters_ordered_by_pattern ', '}}}|{{/if}}
|
3
|
+
{{#indent}}{{ underscore rendered_children.name }}{{#if has_parameters?}}({{{ join rendered_children.parameters ', '}}}){{/if}}{{/indent}}
|
4
|
+
end
|
5
|
+
{{/if}}
|
@@ -0,0 +1 @@
|
|
1
|
+
{{#strip}}{{#join chunks context.parameter_delimiter as |treated_chunk|}}{{treated_chunk.value}}{{/join}}{{#each extra_inlined_parameters as |param|}} {{context.parameter_delimiter}}{{param.value}}{{context.parameter_delimiter}}{{/each}}{{/strip}}
|
@@ -0,0 +1,5 @@
|
|
1
|
+
{{#if rendered_children.gherkin_annotation }}{{{ rendered_children.gherkin_annotation }}}("{{#escape_backslashes_and_double_quotes}}{{> gherkin_typed_pattern}}{{/escape_backslashes_and_double_quotes}}") { {{{ join rendered_children.parameters_ordered_by_pattern ', '}}} ->{{#indent}}
|
2
|
+
{{{ context.call_prefix }}}.{{{camelize_lower uniq_name}}}({{#if has_parameters?}}{{#join raw_parameter_names ', ' as |param|}}{{{camelize_lower param}}}{{/join}}{{/if}})
|
3
|
+
{{/indent}}
|
4
|
+
}
|
5
|
+
{{/if}}
|