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,94 @@
|
|
1
|
+
require 'hiptest-publisher/nodes'
|
2
|
+
|
3
|
+
module Hiptest
|
4
|
+
# Builds a graph based on calls and computes
|
5
|
+
# longest path from the root.
|
6
|
+
|
7
|
+
class ProjectGrapher
|
8
|
+
attr_reader :graph, :distance_index
|
9
|
+
|
10
|
+
def self.distances_index(project)
|
11
|
+
instance = ProjectGrapher.new(project)
|
12
|
+
instance.compute_graph
|
13
|
+
instance.add_distances
|
14
|
+
instance.index_by_distances
|
15
|
+
|
16
|
+
return instance.distance_index
|
17
|
+
end
|
18
|
+
|
19
|
+
def initialize(project)
|
20
|
+
@project = project
|
21
|
+
@graph = {}
|
22
|
+
end
|
23
|
+
|
24
|
+
def compute_graph
|
25
|
+
add_nodes
|
26
|
+
add_root
|
27
|
+
end
|
28
|
+
|
29
|
+
def add_distances
|
30
|
+
add_node_weight(@graph[:root], [:root])
|
31
|
+
end
|
32
|
+
|
33
|
+
def index_by_distances
|
34
|
+
@distance_index = Hash.new { |hash, key| hash[key] = [] }
|
35
|
+
@graph.each_value do |value|
|
36
|
+
@distance_index[value[:distance_from_root]] << value[:item] if value[:item]
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
private
|
41
|
+
|
42
|
+
def add_nodes
|
43
|
+
@project.each_sub_nodes(Hiptest::Nodes::Scenario, Hiptest::Nodes::Actionword) do |item|
|
44
|
+
name = node_name(item)
|
45
|
+
@graph[name] = {
|
46
|
+
name: name,
|
47
|
+
item: item,
|
48
|
+
calls: [],
|
49
|
+
distance_from_root: -1
|
50
|
+
}
|
51
|
+
|
52
|
+
item.each_sub_nodes(Hiptest::Nodes::Call) do |call|
|
53
|
+
aw_name = node_name(call.children[:actionword], Hiptest::Nodes::Actionword)
|
54
|
+
@graph[name][:calls] << aw_name
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
def add_root
|
60
|
+
@graph[:root] = {
|
61
|
+
calls: [],
|
62
|
+
distance_from_root: 0
|
63
|
+
}
|
64
|
+
|
65
|
+
@project.each_sub_nodes(Hiptest::Nodes::Scenario) do |scenario|
|
66
|
+
@graph[:root][:calls] << node_name(scenario)
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
def add_node_weight(node, path)
|
71
|
+
path << node[:name]
|
72
|
+
|
73
|
+
node[:calls].each do |item_name|
|
74
|
+
next if path.include?(item_name)
|
75
|
+
|
76
|
+
called = @graph[item_name]
|
77
|
+
next if called.nil?
|
78
|
+
|
79
|
+
if called[:distance_from_root] <= node[:distance_from_root]
|
80
|
+
called[:distance_from_root] = node[:distance_from_root] + 1
|
81
|
+
add_node_weight(called, path)
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
85
|
+
path.pop
|
86
|
+
end
|
87
|
+
|
88
|
+
def node_name(node, cls = nil)
|
89
|
+
cls ||= node.class
|
90
|
+
name = node.is_a?(Hiptest::Nodes::Node) ? node.children[:name] : node
|
91
|
+
"#{cls}-#{name}"
|
92
|
+
end
|
93
|
+
end
|
94
|
+
end
|
@@ -0,0 +1,194 @@
|
|
1
|
+
module Hiptest
|
2
|
+
module RenderContextMaker
|
3
|
+
def walk_item(item)
|
4
|
+
{
|
5
|
+
has_description?: !item.children[:description].nil? && !item.children[:description].empty?,
|
6
|
+
has_parameters?: !item.children[:parameters].empty?,
|
7
|
+
has_tags?: !item.children[:tags].empty?,
|
8
|
+
has_step?: has_step?(item),
|
9
|
+
is_empty?: item.children[:body].empty?,
|
10
|
+
declared_variables: item.declared_variables_names,
|
11
|
+
raw_parameter_names: item.children[:parameters].map {|p| p.children[:name] },
|
12
|
+
self_name: item.children[:name]
|
13
|
+
}
|
14
|
+
end
|
15
|
+
|
16
|
+
def walk_relative_item(item)
|
17
|
+
relative_package = @context.relative_path.split('/')[0...-1].join('.')
|
18
|
+
relative_package = ".#{relative_package}" unless relative_package.empty?
|
19
|
+
{
|
20
|
+
needs_to_import_actionwords?: @context.relative_path.count('/') > 0,
|
21
|
+
relative_package: relative_package,
|
22
|
+
}
|
23
|
+
end
|
24
|
+
|
25
|
+
def walk_actionword(aw)
|
26
|
+
walk_item(aw).merge(
|
27
|
+
chunks: aw.chunks || [],
|
28
|
+
extra_inlined_parameters: aw.extra_inlined_parameters || [],
|
29
|
+
has_free_text_parameter?: aw.children[:parameters].select(&:free_text?).count > 0,
|
30
|
+
has_datatable_parameter?: aw.children[:parameters].select(&:datatable?).count > 0,
|
31
|
+
uniq_name: aw.uniq_name
|
32
|
+
)
|
33
|
+
end
|
34
|
+
|
35
|
+
def walk_actionwords(aws)
|
36
|
+
project = aws.parent
|
37
|
+
{
|
38
|
+
uses_library?: project.nil? ? false : project.has_libraries?
|
39
|
+
}
|
40
|
+
end
|
41
|
+
|
42
|
+
def walk_folder(folder)
|
43
|
+
walk_relative_item(folder).merge(
|
44
|
+
self_name: folder.children[:name],
|
45
|
+
has_tags?: !folder.children[:tags].empty?,
|
46
|
+
has_step?: has_step?(folder),
|
47
|
+
is_empty?: folder.children[:body].empty?,
|
48
|
+
datatables_present?: datatable_present?(folder)
|
49
|
+
)
|
50
|
+
end
|
51
|
+
|
52
|
+
def walk_scenario(scenario)
|
53
|
+
walk_item(scenario).merge(walk_relative_item(scenario)).merge(
|
54
|
+
project_name: scenario.parent.parent.children[:name],
|
55
|
+
has_datasets?: has_datasets?(scenario),
|
56
|
+
has_annotations?: has_annotations?(scenario),
|
57
|
+
uniq_name: scenario.children[:name]
|
58
|
+
)
|
59
|
+
end
|
60
|
+
|
61
|
+
def walk_dataset(dataset)
|
62
|
+
datatable = dataset.parent
|
63
|
+
{
|
64
|
+
scenario_name: datatable.parent.children[:name],
|
65
|
+
has_tags?: !datatable.parent.children[:tags].empty?,
|
66
|
+
tags: datatable.parent.children[:tags].map {|tag| @rendered[tag]}
|
67
|
+
}
|
68
|
+
end
|
69
|
+
|
70
|
+
def walk_scenarios(scenarios)
|
71
|
+
project = scenarios.parent
|
72
|
+
{
|
73
|
+
project_name: project.children[:name],
|
74
|
+
self_name: project.children[:name],
|
75
|
+
datatables_present?: datatable_present?(scenarios)
|
76
|
+
}
|
77
|
+
end
|
78
|
+
|
79
|
+
def walk_test(test)
|
80
|
+
{
|
81
|
+
has_description?: !test.children[:description].nil? && !test.children[:description].empty?,
|
82
|
+
has_parameters?: false,
|
83
|
+
has_tags?: !test.children[:tags].empty?,
|
84
|
+
has_step?: has_step?(test),
|
85
|
+
is_empty?: test.children[:body].empty?,
|
86
|
+
has_datasets?: false,
|
87
|
+
project_name: test.parent.parent.children[:name],
|
88
|
+
self_name: test.children[:name]
|
89
|
+
}
|
90
|
+
end
|
91
|
+
|
92
|
+
def walk_tests(tests)
|
93
|
+
project = tests.parent
|
94
|
+
{
|
95
|
+
project_name: project.children[:name],
|
96
|
+
self_name: project.children[:name]
|
97
|
+
}
|
98
|
+
end
|
99
|
+
|
100
|
+
def walk_call(c)
|
101
|
+
{
|
102
|
+
has_arguments?: !c.children[:arguments].empty?,
|
103
|
+
has_annotation?: !c.children[:annotation].nil?,
|
104
|
+
is_shared?: !c.children[:library_name].nil?,
|
105
|
+
in_actionword?: c.parent.is_a?(Hiptest::Nodes::Actionword),
|
106
|
+
in_datatabled_scenario?: c.parent.is_a?(Hiptest::Nodes::Scenario) && has_datasets?(c.parent),
|
107
|
+
chunks: c.chunks || [],
|
108
|
+
extra_inlined_arguments: c.extra_inlined_arguments || []
|
109
|
+
}
|
110
|
+
end
|
111
|
+
|
112
|
+
def walk_ifthen(it)
|
113
|
+
{
|
114
|
+
has_else?: !it.children[:else].empty?
|
115
|
+
}
|
116
|
+
end
|
117
|
+
|
118
|
+
def walk_parameter(p)
|
119
|
+
{
|
120
|
+
is_free_text?: p.free_text?,
|
121
|
+
is_datatable?: p.datatable?,
|
122
|
+
is_bool?: p.children[:type] == :bool,
|
123
|
+
has_default_value?: !p.children[:default].nil?
|
124
|
+
}
|
125
|
+
end
|
126
|
+
|
127
|
+
def walk_tag(t)
|
128
|
+
{
|
129
|
+
has_value?: !t.children[:value].nil?
|
130
|
+
}
|
131
|
+
end
|
132
|
+
|
133
|
+
def walk_template(t)
|
134
|
+
treated = t.children[:chunks].map do |chunk|
|
135
|
+
{
|
136
|
+
is_variable?: chunk.is_a?(Hiptest::Nodes::Variable),
|
137
|
+
raw: chunk
|
138
|
+
}
|
139
|
+
end
|
140
|
+
variable_names = treated.map {|item| item[:raw].children[:name] if item[:is_variable?]}.compact
|
141
|
+
|
142
|
+
{
|
143
|
+
treated_chunks: treated,
|
144
|
+
variable_names: variable_names
|
145
|
+
}
|
146
|
+
end
|
147
|
+
|
148
|
+
def walk_libraryactionword(aw)
|
149
|
+
walk_actionword(aw).merge(
|
150
|
+
library_name: aw.parent.children[:name]
|
151
|
+
)
|
152
|
+
end
|
153
|
+
|
154
|
+
def walk_libraries(libraries)
|
155
|
+
{
|
156
|
+
library_names: libraries.children[:libraries].map {|lib| lib.children[:name]}
|
157
|
+
}
|
158
|
+
end
|
159
|
+
|
160
|
+
private
|
161
|
+
|
162
|
+
def has_step?(item)
|
163
|
+
item.each_sub_nodes(deep: true) do |node|
|
164
|
+
return true if node.is_a?(Hiptest::Nodes::Step)
|
165
|
+
end
|
166
|
+
false
|
167
|
+
end
|
168
|
+
|
169
|
+
def has_annotations?(scenario)
|
170
|
+
scenario.each_sub_nodes(deep: true) do |node|
|
171
|
+
return true if node.is_a?(Hiptest::Nodes::Call) && !node.children[:annotation].nil?
|
172
|
+
end
|
173
|
+
false
|
174
|
+
end
|
175
|
+
|
176
|
+
def has_datasets?(scenario)
|
177
|
+
datatable = scenario.children[:datatable]
|
178
|
+
datatable ? !datatable.children[:datasets].empty? : false
|
179
|
+
end
|
180
|
+
|
181
|
+
def datatable_present?(container)
|
182
|
+
datatables_present = false
|
183
|
+
|
184
|
+
container.children[:scenarios].each do |scenario|
|
185
|
+
if has_datasets?(scenario)
|
186
|
+
datatables_present = true
|
187
|
+
break
|
188
|
+
end
|
189
|
+
end
|
190
|
+
|
191
|
+
return datatables_present
|
192
|
+
end
|
193
|
+
end
|
194
|
+
end
|
@@ -0,0 +1,52 @@
|
|
1
|
+
require 'ruby-handlebars'
|
2
|
+
|
3
|
+
require 'hiptest-publisher/nodes_walker'
|
4
|
+
require 'hiptest-publisher/render_context_maker'
|
5
|
+
|
6
|
+
module Hiptest
|
7
|
+
class Renderer < Hiptest::Nodes::Walker
|
8
|
+
attr_reader :rendered
|
9
|
+
include RenderContextMaker
|
10
|
+
|
11
|
+
def self.render(node, context)
|
12
|
+
renderer = self.new(context)
|
13
|
+
context.renderer_addons.each do |addon|
|
14
|
+
renderer.singleton_class.include(addon)
|
15
|
+
end
|
16
|
+
renderer.walk_node(node)
|
17
|
+
renderer.rendered[node]
|
18
|
+
end
|
19
|
+
|
20
|
+
def initialize(context)
|
21
|
+
@rendered = {}
|
22
|
+
@context = context
|
23
|
+
@template_finder = context.template_finder
|
24
|
+
end
|
25
|
+
|
26
|
+
def call_node_walker(node)
|
27
|
+
if node.is_a? Hiptest::Nodes::Node
|
28
|
+
@rendered_children = {}
|
29
|
+
|
30
|
+
node.children.each do |name, child|
|
31
|
+
@rendered_children[name] = @rendered[child]
|
32
|
+
|
33
|
+
@rendered_children[name].uniq! if name == :actionwords && @rendered_children[name].is_a?(Array)
|
34
|
+
end
|
35
|
+
@rendered[node] = render_node(node, super(node))
|
36
|
+
elsif node.is_a? Array
|
37
|
+
@rendered[node] = node.map {|item| @rendered[item]}
|
38
|
+
else
|
39
|
+
@rendered[node] = node
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
def render_node(node, render_context)
|
44
|
+
render_context ||= {}
|
45
|
+
render_context[:node] = node
|
46
|
+
render_context[:rendered_children] = @rendered_children
|
47
|
+
render_context[:context] = @context
|
48
|
+
|
49
|
+
@template_finder.get_compiled_handlebars(node.kind).call(render_context)
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
require 'hiptest-publisher/nodes'
|
2
|
+
|
3
|
+
module Hiptest
|
4
|
+
module BehaveAddon
|
5
|
+
def walk_actionwords(aws)
|
6
|
+
base = super(aws)
|
7
|
+
sorted_aws = aws.children[:actionwords]
|
8
|
+
.sort_by {|aw|
|
9
|
+
pattern = aw.children.fetch(:gherkin_pattern, "")
|
10
|
+
[pattern.length, pattern]
|
11
|
+
}.reverse
|
12
|
+
|
13
|
+
@rendered_children[:sorted_actionwords] = sorted_aws.map {|aw| @rendered[aw]}
|
14
|
+
return base
|
15
|
+
end
|
16
|
+
|
17
|
+
private
|
18
|
+
|
19
|
+
def get_pattern(aw)
|
20
|
+
name = aw.children["name"]
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,59 @@
|
|
1
|
+
require 'hiptest-publisher/nodes'
|
2
|
+
|
3
|
+
module Hiptest
|
4
|
+
module GherkinAddon
|
5
|
+
def walk_call(call)
|
6
|
+
if call.free_text_arg
|
7
|
+
@rendered_children[:free_text_arg] = rendered_freetext_arg(call)
|
8
|
+
end
|
9
|
+
|
10
|
+
if call.datatable_arg
|
11
|
+
@rendered_children[:datatable_arg] = rendered_datatable_arg(call)
|
12
|
+
end
|
13
|
+
|
14
|
+
super(call)
|
15
|
+
end
|
16
|
+
|
17
|
+
def walk_actionword(aw)
|
18
|
+
parameters = aw.children[:parameters]
|
19
|
+
aw.chunks = replace_parameter_value_with_type(aw.chunks, parameters)
|
20
|
+
aw.extra_inlined_parameters = replace_parameter_value_with_type(aw.extra_inlined_parameters, parameters)
|
21
|
+
|
22
|
+
super(aw)
|
23
|
+
end
|
24
|
+
|
25
|
+
def walk_folder(folder)
|
26
|
+
@rendered_children[:ancestor_tags] = ancestor_tags(folder)
|
27
|
+
|
28
|
+
super(folder)
|
29
|
+
end
|
30
|
+
|
31
|
+
private
|
32
|
+
|
33
|
+
def rendered_datatable_arg(call)
|
34
|
+
@rendered[call.datatable_arg.children[:value]]
|
35
|
+
end
|
36
|
+
|
37
|
+
def rendered_freetext_arg(call)
|
38
|
+
@rendered[call.free_text_arg.children[:value]]
|
39
|
+
end
|
40
|
+
|
41
|
+
def ancestor_tags(folder)
|
42
|
+
ancestor_tags = folder.ancestors.map { |f| f.children[:tags] }.flatten.uniq
|
43
|
+
ancestor_tags.map { |t| Hiptest::Renderer.render(t, @context) }
|
44
|
+
end
|
45
|
+
|
46
|
+
def replace_parameter_value_with_type(collection, parameters)
|
47
|
+
collection.map do |obj|
|
48
|
+
if obj[:is_parameter]
|
49
|
+
parameter = parameters.find { |parameter| parameter.children[:name] == obj[:name] }
|
50
|
+
obj[:typed_value] = parameter ? "{#{parameter.type.downcase}}" : "{}"
|
51
|
+
else
|
52
|
+
obj[:typed_value] = obj[:value]
|
53
|
+
end
|
54
|
+
|
55
|
+
obj
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
require 'hiptest-publisher/nodes'
|
2
|
+
|
3
|
+
module Hiptest
|
4
|
+
module GroovySpockAddon
|
5
|
+
def walk_call(call)
|
6
|
+
base = super(call)
|
7
|
+
use_annotation(call, base)
|
8
|
+
end
|
9
|
+
|
10
|
+
private
|
11
|
+
|
12
|
+
def use_annotation(call, base)
|
13
|
+
base[:use_expect_annotation] = needs_fixing?(call)
|
14
|
+
base[:use_main_annotation?] = !(call.children[:annotation].nil? || ['and', 'but'].include?(call.children[:annotation]))
|
15
|
+
|
16
|
+
base
|
17
|
+
end
|
18
|
+
|
19
|
+
def needs_fixing?(call)
|
20
|
+
scenario = call.parent
|
21
|
+
|
22
|
+
return false unless scenario.is_a?(Hiptest::Nodes::Scenario)
|
23
|
+
return false unless call.children[:annotation].nil? || ignore_case_equal?(call.children[:annotation], 'then')
|
24
|
+
|
25
|
+
return call.parent.children[:body].select do |step|
|
26
|
+
step.is_a?(Hiptest::Nodes::Call) && !step.children[:annotation].nil? && ignore_case_equal?(step.children[:annotation], 'when')
|
27
|
+
end.empty?
|
28
|
+
end
|
29
|
+
|
30
|
+
def ignore_case_equal?(string1, string2)
|
31
|
+
string1.casecmp(string2) == 0
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
require 'hiptest-publisher/nodes'
|
2
|
+
|
3
|
+
module Hiptest
|
4
|
+
module RobotFrameworkAddon
|
5
|
+
def walk_folder(folder)
|
6
|
+
walk_scenario_container(folder)
|
7
|
+
super(folder)
|
8
|
+
end
|
9
|
+
|
10
|
+
def walk_scenarios(scenarios)
|
11
|
+
walk_scenario_container(scenarios)
|
12
|
+
super(scenarios)
|
13
|
+
end
|
14
|
+
|
15
|
+
private
|
16
|
+
|
17
|
+
def walk_scenario_container(container)
|
18
|
+
# For Robot framework, we need direct access to every scenario
|
19
|
+
# datatables and body rendered.
|
20
|
+
|
21
|
+
@rendered_children[:splitted_scenarios] = container.children[:scenarios].map {|sc|
|
22
|
+
{
|
23
|
+
name: @rendered[sc.children[:name]],
|
24
|
+
tags: sc.children[:tags].map {|tag| @rendered[tag]},
|
25
|
+
uid: @rendered[sc.children[:uid]],
|
26
|
+
datatable: @rendered[sc.children[:datatable]],
|
27
|
+
datasets: sc.children[:datatable].children[:datasets].map {|dataset|
|
28
|
+
{
|
29
|
+
scenario_name: @rendered[sc.children[:name]],
|
30
|
+
name: @rendered[dataset.children[:name]],
|
31
|
+
uid: @rendered[dataset.children[:uid]],
|
32
|
+
test_snapshot_uid: @rendered[dataset.children[:test_snapshot_uid]],
|
33
|
+
arguments: @rendered[dataset.children[:arguments]]
|
34
|
+
}
|
35
|
+
},
|
36
|
+
parameters: @rendered[sc.children[:parameters]],
|
37
|
+
body: @rendered[sc.children[:body]]
|
38
|
+
}
|
39
|
+
}
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
@@ -0,0 +1,105 @@
|
|
1
|
+
module Hiptest
|
2
|
+
class SignatureDiffer
|
3
|
+
def self.diff(old, current, library_name: nil)
|
4
|
+
SignatureDiffer.new(old, current).compute_diff(library_name)
|
5
|
+
end
|
6
|
+
|
7
|
+
def initialize(old, current)
|
8
|
+
@old = old
|
9
|
+
@current = current
|
10
|
+
end
|
11
|
+
|
12
|
+
def compute_diff(library_name = nil)
|
13
|
+
if library_name.nil?
|
14
|
+
@old_uid = map_by_uid(@old)
|
15
|
+
@current_uid = map_by_uid(@current)
|
16
|
+
else
|
17
|
+
@old_uid = map_by_uid(get_library_actionwords(@old, library_name))
|
18
|
+
@current_uid = map_by_uid(get_library_actionwords(@current, library_name))
|
19
|
+
end
|
20
|
+
|
21
|
+
compute_created
|
22
|
+
compute_deleted
|
23
|
+
|
24
|
+
compute_definition_changed
|
25
|
+
compute_signature_changed
|
26
|
+
compute_renamed
|
27
|
+
|
28
|
+
diff = {}
|
29
|
+
diff[:created] = @created unless @created.empty?
|
30
|
+
diff[:deleted] = @deleted unless @deleted.empty?
|
31
|
+
diff[:renamed] = @renamed unless @renamed.empty?
|
32
|
+
diff[:signature_changed] = @signature_changed unless @signature_changed.empty?
|
33
|
+
diff[:definition_changed] = @definition_changed unless @definition_changed.empty?
|
34
|
+
|
35
|
+
diff
|
36
|
+
end
|
37
|
+
|
38
|
+
private
|
39
|
+
|
40
|
+
def compute_created
|
41
|
+
@created_uids = @current_uid.keys - @old_uid.keys
|
42
|
+
@created = @created_uids.map {|uid| {name: @current_uid[uid]['name'], node: @current_uid[uid]['node']}}
|
43
|
+
end
|
44
|
+
|
45
|
+
def compute_deleted
|
46
|
+
@deleted_uids = @old_uid.keys - @current_uid.keys
|
47
|
+
@deleted = @deleted_uids.map {|uid| {name: @old_uid[uid]['name']}}
|
48
|
+
end
|
49
|
+
|
50
|
+
def compute_renamed
|
51
|
+
excluded = [
|
52
|
+
@created_uids,
|
53
|
+
@deleted_uids,
|
54
|
+
@definition_changed_uids,
|
55
|
+
@signature_changed_uids
|
56
|
+
].flatten.uniq
|
57
|
+
|
58
|
+
@renamed = @current_uid.map do |uid, aw|
|
59
|
+
next if excluded.include?(uid)
|
60
|
+
next if @old_uid[uid]['name'] == aw['name']
|
61
|
+
|
62
|
+
{name: @old_uid[uid]['name'], new_name: aw['name'], node: aw['node']}
|
63
|
+
end.compact
|
64
|
+
end
|
65
|
+
|
66
|
+
def compute_signature_changed
|
67
|
+
excluded = [
|
68
|
+
@created_uids,
|
69
|
+
@deleted_uids,
|
70
|
+
@definition_changed_uids
|
71
|
+
].flatten.uniq
|
72
|
+
|
73
|
+
@signature_changed_uids = []
|
74
|
+
@signature_changed = @current_uid.map do |uid, aw|
|
75
|
+
next if excluded.include?(uid)
|
76
|
+
next if @old_uid[uid]['parameters'] == aw['parameters']
|
77
|
+
|
78
|
+
@signature_changed_uids << uid
|
79
|
+
{name: aw['name'], node: aw['node']}
|
80
|
+
end.compact
|
81
|
+
end
|
82
|
+
|
83
|
+
def compute_definition_changed
|
84
|
+
@definition_changed_uids = []
|
85
|
+
|
86
|
+
@definition_changed = @current_uid.map do |uid, aw|
|
87
|
+
next if @old_uid[uid].nil?
|
88
|
+
next unless @old_uid[uid].has_key?('body_hash')
|
89
|
+
next if aw['body_hash'] == @old_uid[uid]['body_hash']
|
90
|
+
|
91
|
+
@definition_changed_uids << uid
|
92
|
+
{name: aw['name'], node: aw['node']}
|
93
|
+
end.compact
|
94
|
+
end
|
95
|
+
|
96
|
+
def get_library_actionwords(data, library_name)
|
97
|
+
library = data.select {|item| item['type'] == 'library' && item['name'] == library_name}.first
|
98
|
+
library.nil? ? [] : library['actionwords']
|
99
|
+
end
|
100
|
+
|
101
|
+
def map_by_uid(items)
|
102
|
+
Hash[items.reject {|item| item['type'] == 'library'}.collect { |aw| [aw['uid'], aw] }]
|
103
|
+
end
|
104
|
+
end
|
105
|
+
end
|
@@ -0,0 +1,56 @@
|
|
1
|
+
require 'yaml'
|
2
|
+
require 'digest/md5'
|
3
|
+
|
4
|
+
module Hiptest
|
5
|
+
class SignatureExporter
|
6
|
+
def self.export_actionwords(project, export_nodes = false)
|
7
|
+
exporter = SignatureExporter.new
|
8
|
+
|
9
|
+
[
|
10
|
+
exporter.export_actionwords(project.children[:actionwords], export_nodes),
|
11
|
+
exporter.export_libraries(project.children[:libraries], export_nodes)
|
12
|
+
].flatten
|
13
|
+
end
|
14
|
+
|
15
|
+
def export_actionwords(aws, export_nodes = false)
|
16
|
+
aws.children[:actionwords].map {|aw| export_actionword(aw, export_nodes)}
|
17
|
+
end
|
18
|
+
|
19
|
+
def export_libraries(libraries, export_nodes = false)
|
20
|
+
libraries.children[:libraries].map {|lib| export_library(lib, export_nodes)}
|
21
|
+
end
|
22
|
+
|
23
|
+
def export_library(library, export_nodes = false)
|
24
|
+
{
|
25
|
+
'name' => library.children[:name],
|
26
|
+
'type' => 'library',
|
27
|
+
'actionwords' => library.children[:library_actionwords].map {|aw| export_actionword(aw, export_nodes) }
|
28
|
+
}
|
29
|
+
end
|
30
|
+
|
31
|
+
def export_actionword(item, export_node = false)
|
32
|
+
hash = {
|
33
|
+
'name' => item.children[:name],
|
34
|
+
'uid' => item.children[:uid],
|
35
|
+
'parameters' => export_parameters(item),
|
36
|
+
'body_hash' => make_body_hash(item.children[:body])
|
37
|
+
}
|
38
|
+
hash['node'] = item if export_node
|
39
|
+
hash
|
40
|
+
end
|
41
|
+
|
42
|
+
def export_parameters(item)
|
43
|
+
item.children[:parameters].map {|p| export_parameter(p)}
|
44
|
+
end
|
45
|
+
|
46
|
+
def export_parameter(parameter)
|
47
|
+
{
|
48
|
+
'name' => parameter.children[:name]
|
49
|
+
}
|
50
|
+
end
|
51
|
+
|
52
|
+
def make_body_hash(body)
|
53
|
+
Digest::MD5.hexdigest(body.map(&:flat_string).join(''))
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|