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,76 @@
|
|
1
|
+
require 'i18n'
|
2
|
+
|
3
|
+
require_relative 'utils'
|
4
|
+
|
5
|
+
class String
|
6
|
+
def literate
|
7
|
+
I18n.enforce_available_locales = false
|
8
|
+
I18n.transliterate(self)
|
9
|
+
end
|
10
|
+
|
11
|
+
def normalize(keep_dashes=false, keep_spaces=false)
|
12
|
+
literated = self.literate
|
13
|
+
literated.strip!
|
14
|
+
|
15
|
+
if keep_spaces
|
16
|
+
literated.gsub!(/\s+/, ' ')
|
17
|
+
literated.gsub!(/[^a-zA-Z0-9_\- "']/, '')
|
18
|
+
else
|
19
|
+
literated.gsub!(/\s+/, '_')
|
20
|
+
if keep_dashes
|
21
|
+
literated.gsub!(/[^a-zA-Z0-9_\-]/, '')
|
22
|
+
else
|
23
|
+
literated.gsub!(/\W/, '')
|
24
|
+
end
|
25
|
+
end
|
26
|
+
literated
|
27
|
+
end
|
28
|
+
|
29
|
+
def normalize_lower
|
30
|
+
normalized = self.normalize
|
31
|
+
normalized.downcase!
|
32
|
+
normalized
|
33
|
+
end
|
34
|
+
|
35
|
+
def normalize_with_dashes
|
36
|
+
self.normalize(true)
|
37
|
+
end
|
38
|
+
|
39
|
+
def normalize_with_spaces
|
40
|
+
self.normalize(false, true)
|
41
|
+
end
|
42
|
+
|
43
|
+
def underscore
|
44
|
+
# based on:
|
45
|
+
# http://stackoverflow.com/questions/1509915/converting-camel-case-to-underscore-case-in-ruby
|
46
|
+
normalized = self.normalize
|
47
|
+
normalized.gsub!(/([A-Z]+)([A-Z][a-z])/,'\1_\2')
|
48
|
+
normalized.gsub!(/([a-z\d])([A-Z])/,'\1_\2')
|
49
|
+
normalized.tr!("-", "_")
|
50
|
+
normalized.downcase!
|
51
|
+
normalized
|
52
|
+
end
|
53
|
+
|
54
|
+
def camelize
|
55
|
+
normalized = self.normalize.split('_')
|
56
|
+
normalized.map! {|w| w.empty? ? "" : "#{w[0].upcase}#{w[1..-1]}"}
|
57
|
+
normalized.join
|
58
|
+
end
|
59
|
+
|
60
|
+
def camelize_lower
|
61
|
+
camelized = self.camelize
|
62
|
+
if camelized.empty?
|
63
|
+
""
|
64
|
+
else
|
65
|
+
"#{camelized[0].downcase}#{camelized[1..-1]}"
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
def camelize_upper
|
70
|
+
self.camelize
|
71
|
+
end
|
72
|
+
|
73
|
+
def clear_extension
|
74
|
+
self.split('.')[0]
|
75
|
+
end
|
76
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
require 'colorize'
|
2
|
+
require 'io/console'
|
3
|
+
require 'openssl'
|
4
|
+
require 'net/http/post/multipart'
|
5
|
+
require 'pathname'
|
6
|
+
|
7
|
+
|
8
|
+
def hiptest_publisher_path
|
9
|
+
Gem.loaded_specs['hiptest-publisher'].full_gem_path
|
10
|
+
rescue
|
11
|
+
'.'
|
12
|
+
end
|
13
|
+
|
14
|
+
def hiptest_publisher_version
|
15
|
+
Gem.loaded_specs['hiptest-publisher'].version.to_s
|
16
|
+
rescue
|
17
|
+
File.read("#{hiptest_publisher_path}/VERSION").strip if File.exists?("#{hiptest_publisher_path}/VERSION")
|
18
|
+
end
|
19
|
+
|
20
|
+
def pluralize_word(count, singular, plural=nil)
|
21
|
+
if count == 1
|
22
|
+
singular
|
23
|
+
else
|
24
|
+
"#{singular}s"
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
def pluralize(count, singular, plural=nil)
|
29
|
+
word = pluralize_word(count, singular, plural)
|
30
|
+
"#{count} #{word}"
|
31
|
+
end
|
32
|
+
|
33
|
+
def singularize(name)
|
34
|
+
name.to_s.chomp("s")
|
35
|
+
end
|
36
|
+
|
37
|
+
def clean_path(path)
|
38
|
+
Pathname.new(path).cleanpath.to_s
|
39
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
require 'hiptest-publisher/formatters/reporter'
|
2
|
+
require 'hiptest-publisher/utils'
|
3
|
+
|
4
|
+
module Hiptest
|
5
|
+
class VersionChecker
|
6
|
+
attr_reader :reporter
|
7
|
+
|
8
|
+
def self.check_version(reporter: nil)
|
9
|
+
reporter ||= Reporter.new
|
10
|
+
|
11
|
+
VersionChecker.new(reporter).check_version
|
12
|
+
end
|
13
|
+
|
14
|
+
def initialize(reporter)
|
15
|
+
@reporter = reporter
|
16
|
+
end
|
17
|
+
|
18
|
+
def check_version
|
19
|
+
latest = get_latest_version
|
20
|
+
return if latest.nil?
|
21
|
+
|
22
|
+
current = hiptest_publisher_version
|
23
|
+
|
24
|
+
if latest == current
|
25
|
+
puts I18n.t('check_version.up_to_date', current: current)
|
26
|
+
else
|
27
|
+
puts I18n.t('check_version.outdated', current: current, latest: latest)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
def get_latest_version
|
32
|
+
reporter.with_status_message I18n.t('check_version.title') do
|
33
|
+
latest_gem = Gem.latest_version_for('hiptest-publisher')
|
34
|
+
|
35
|
+
raise RuntimeError, I18n.t('check_version.error') if latest_gem.nil?
|
36
|
+
|
37
|
+
latest = latest_gem.version
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
@@ -0,0 +1,407 @@
|
|
1
|
+
require 'nokogiri'
|
2
|
+
require 'colorize'
|
3
|
+
|
4
|
+
require_relative 'nodes'
|
5
|
+
require_relative 'utils'
|
6
|
+
require_relative 'formatters/reporter'
|
7
|
+
|
8
|
+
module Hiptest
|
9
|
+
class XMLParser
|
10
|
+
attr_reader :project
|
11
|
+
|
12
|
+
def initialize(source, reporter = nil)
|
13
|
+
@source = source
|
14
|
+
@xml = Nokogiri::XML(source)
|
15
|
+
@reporter = reporter || NullReporter.new
|
16
|
+
end
|
17
|
+
|
18
|
+
def build_nullliteral(value = nil)
|
19
|
+
Hiptest::Nodes::NullLiteral.new
|
20
|
+
end
|
21
|
+
|
22
|
+
def build_stringliteral(value)
|
23
|
+
if value.is_a? String
|
24
|
+
Hiptest::Nodes::StringLiteral.new(value)
|
25
|
+
else
|
26
|
+
Hiptest::Nodes::StringLiteral.new(value.content)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
def build_numericliteral(value)
|
31
|
+
if value.is_a? Numeric
|
32
|
+
Hiptest::Nodes::NumericLiteral.new(value)
|
33
|
+
else
|
34
|
+
Hiptest::Nodes::NumericLiteral.new(value.content)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
def build_booleanliteral(value)
|
39
|
+
if value.is_a?(TrueClass) || value.is_a?(FalseClass)
|
40
|
+
Hiptest::Nodes::BooleanLiteral.new(value)
|
41
|
+
else
|
42
|
+
Hiptest::Nodes::BooleanLiteral.new(value.content)
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
def build_var(variable)
|
47
|
+
Hiptest::Nodes::Variable.new(variable.content)
|
48
|
+
end
|
49
|
+
|
50
|
+
def build_symbol(symbol)
|
51
|
+
Hiptest::Nodes::Symbol.new(
|
52
|
+
css_first_content(symbol, '> value'),
|
53
|
+
css_first_content(symbol, '> delimiter')
|
54
|
+
)
|
55
|
+
end
|
56
|
+
|
57
|
+
def build_field(field)
|
58
|
+
Hiptest::Nodes::Field.new(
|
59
|
+
build_node(css_first(field, '> base > *')),
|
60
|
+
css_first_content(field, '> name'))
|
61
|
+
end
|
62
|
+
|
63
|
+
def build_index(index)
|
64
|
+
Hiptest::Nodes::Index.new(
|
65
|
+
build_node(css_first(index, '> base > *')),
|
66
|
+
build_node(css_first(index, '> expression > *')))
|
67
|
+
end
|
68
|
+
|
69
|
+
def build_binary_expression(operation)
|
70
|
+
Hiptest::Nodes::BinaryExpression.new(
|
71
|
+
build_node(css_first(operation, '> left > *')),
|
72
|
+
css_first_content(operation, '> operator'),
|
73
|
+
build_node(css_first(operation, '> right > *')))
|
74
|
+
end
|
75
|
+
|
76
|
+
def build_unary_expression(operation)
|
77
|
+
Hiptest::Nodes::UnaryExpression.new(
|
78
|
+
css_first_content(operation, '> operator'),
|
79
|
+
build_node(css_first(operation, '> expression > *')))
|
80
|
+
end
|
81
|
+
|
82
|
+
def build_operation(operation)
|
83
|
+
if css_first(operation, '> left').nil?
|
84
|
+
build_unary_expression(operation)
|
85
|
+
else
|
86
|
+
build_binary_expression(operation)
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
90
|
+
def build_parenthesis(parenthesis)
|
91
|
+
Hiptest::Nodes::Parenthesis.new(
|
92
|
+
build_node(css_first(parenthesis)))
|
93
|
+
end
|
94
|
+
|
95
|
+
def build_list(list)
|
96
|
+
Hiptest::Nodes::List.new(build_node_list(list.css('> item > *')))
|
97
|
+
end
|
98
|
+
|
99
|
+
def build_dict(dict)
|
100
|
+
items = dict.element_children.map do |item|
|
101
|
+
Hiptest::Nodes::Property.new(
|
102
|
+
item.name,
|
103
|
+
build_node(css_first(item)))
|
104
|
+
end
|
105
|
+
Hiptest::Nodes::Dict.new(items)
|
106
|
+
end
|
107
|
+
|
108
|
+
def build_template(template)
|
109
|
+
Hiptest::Nodes::Template.new(build_node_list(template.css('> *')))
|
110
|
+
end
|
111
|
+
|
112
|
+
def build_assign(assign)
|
113
|
+
Hiptest::Nodes::Assign.new(
|
114
|
+
build_node(css_first(assign, 'to > *')),
|
115
|
+
build_node(css_first(assign, 'value > *')))
|
116
|
+
end
|
117
|
+
|
118
|
+
def build_call(call)
|
119
|
+
Hiptest::Nodes::Call.new(
|
120
|
+
css_first_content(call, '> actionword'),
|
121
|
+
build_arguments(call),
|
122
|
+
css_first_content(call, '> annotation'))
|
123
|
+
end
|
124
|
+
|
125
|
+
def build_arguments(arguments)
|
126
|
+
build_node_list(arguments.css('> arguments > argument'))
|
127
|
+
end
|
128
|
+
|
129
|
+
def build_argument(argument)
|
130
|
+
value = css_first(argument, '> value')
|
131
|
+
Hiptest::Nodes::Argument.new(
|
132
|
+
css_first_content(argument, 'name'),
|
133
|
+
value ? build_node(value) : nil)
|
134
|
+
end
|
135
|
+
|
136
|
+
def build_if(if_then)
|
137
|
+
Hiptest::Nodes::IfThen.new(
|
138
|
+
build_node(css_first(if_then, '> condition > *')),
|
139
|
+
build_node_list(if_then.css('> then > *')),
|
140
|
+
build_node_list(if_then.css('> else > *')))
|
141
|
+
end
|
142
|
+
|
143
|
+
def build_step(step)
|
144
|
+
first_prop = css_first(step)
|
145
|
+
step_value_node = css_first(first_prop)
|
146
|
+
step_value = step_value_node ? build_node(step_value_node) : first_prop.text
|
147
|
+
Hiptest::Nodes::Step.new(
|
148
|
+
first_prop.name,
|
149
|
+
step_value)
|
150
|
+
end
|
151
|
+
|
152
|
+
def build_while(while_loop)
|
153
|
+
Hiptest::Nodes::While.new(
|
154
|
+
build_node(css_first(while_loop, '> condition > *')),
|
155
|
+
build_node_list(while_loop.css('> body > *')))
|
156
|
+
end
|
157
|
+
|
158
|
+
def build_tag(tag)
|
159
|
+
Hiptest::Nodes::Tag.new(
|
160
|
+
css_first_content(tag, '> key'),
|
161
|
+
css_first_content(tag, '> value'))
|
162
|
+
end
|
163
|
+
|
164
|
+
def build_parameter(parameter)
|
165
|
+
default_value = css_first(parameter, '> default_value')
|
166
|
+
|
167
|
+
Hiptest::Nodes::Parameter.new(
|
168
|
+
css_first_content(parameter, 'name'),
|
169
|
+
default_value ? build_node(default_value) : nil)
|
170
|
+
end
|
171
|
+
|
172
|
+
def build_default_value(node)
|
173
|
+
build_node(css_first(node))
|
174
|
+
end
|
175
|
+
|
176
|
+
def build_value(node)
|
177
|
+
build_node(css_first(node))
|
178
|
+
end
|
179
|
+
|
180
|
+
def build_tags(item)
|
181
|
+
build_node_list(item.css('> tags tag'))
|
182
|
+
end
|
183
|
+
|
184
|
+
def build_parameters(item)
|
185
|
+
build_node_list(item.css('> parameters > parameter'))
|
186
|
+
end
|
187
|
+
|
188
|
+
def build_steps(item)
|
189
|
+
build_node_list(item.css('> steps > *'))
|
190
|
+
end
|
191
|
+
|
192
|
+
def build_actionword(actionword)
|
193
|
+
Hiptest::Nodes::Actionword.new(
|
194
|
+
css_first_content(actionword, '> name'),
|
195
|
+
build_tags(actionword),
|
196
|
+
build_parameters(actionword),
|
197
|
+
build_steps(actionword),
|
198
|
+
css_first_content(actionword, '> uid'),
|
199
|
+
css_first_content(actionword, '> description'))
|
200
|
+
end
|
201
|
+
|
202
|
+
def build_libraryActionword(libraryActionword)
|
203
|
+
Hiptest::Nodes::LibraryActionword.new(
|
204
|
+
css_first_content(libraryActionword, '> name'),
|
205
|
+
build_tags(libraryActionword),
|
206
|
+
build_parameters(libraryActionword),
|
207
|
+
build_steps(libraryActionword),
|
208
|
+
css_first_content(libraryActionword, '> uid'),
|
209
|
+
css_first_content(libraryActionword, '> description'))
|
210
|
+
end
|
211
|
+
|
212
|
+
def build_actionwordSnapshot(actionword)
|
213
|
+
Hiptest::Nodes::Actionword.new(
|
214
|
+
css_first_content(actionword, '> name'),
|
215
|
+
build_tags(actionword),
|
216
|
+
build_parameters(actionword),
|
217
|
+
build_steps(actionword),
|
218
|
+
css_first_content(actionword, '> actionwordUid'),
|
219
|
+
css_first_content(actionword, '> description'))
|
220
|
+
end
|
221
|
+
|
222
|
+
def build_scenario(scenario)
|
223
|
+
Hiptest::Nodes::Scenario.new(
|
224
|
+
css_first_content(scenario, '> name'),
|
225
|
+
css_first_content(scenario, '> description'),
|
226
|
+
build_tags(scenario),
|
227
|
+
build_parameters(scenario),
|
228
|
+
build_steps(scenario),
|
229
|
+
css_first_content(scenario, '> folderUid'),
|
230
|
+
build_node(css_first(scenario, '> datatable'), Hiptest::Nodes::Datatable),
|
231
|
+
css_first_content(scenario, 'order_in_parent').to_i)
|
232
|
+
end
|
233
|
+
|
234
|
+
def build_scenarioSnapshot(scs)
|
235
|
+
scenario = build_scenario(scs)
|
236
|
+
datasets = scenario.each_sub_nodes(Hiptest::Nodes::Dataset).to_a
|
237
|
+
|
238
|
+
scenario.add_tags(scs.css('testSnapshot').flat_map { |test| build_tags(test)}.compact)
|
239
|
+
|
240
|
+
if datasets.empty?
|
241
|
+
scenario.set_uid(css_first_content(scs, 'testSnapshot > uid'))
|
242
|
+
else
|
243
|
+
scenario.set_uid(css_first_content(scs, ' > uid'))
|
244
|
+
|
245
|
+
scs.css('testSnapshot').each do |testSnapshot|
|
246
|
+
test_snapshot_uid = css_first_content(testSnapshot, '> uid')
|
247
|
+
dataset_uid = css_first_content(testSnapshot, '> datasetUid')
|
248
|
+
|
249
|
+
dataset = datasets.find { |ds| ds.children[:uid] == dataset_uid }
|
250
|
+
dataset.set_test_snapshot_uid(test_snapshot_uid) if dataset
|
251
|
+
end
|
252
|
+
end
|
253
|
+
scenario
|
254
|
+
end
|
255
|
+
|
256
|
+
def build_datatable(datatable)
|
257
|
+
Hiptest::Nodes::Datatable.new(build_node_list(datatable.css('> dataset')))
|
258
|
+
end
|
259
|
+
|
260
|
+
def build_dataset(dataset)
|
261
|
+
Hiptest::Nodes::Dataset.new(
|
262
|
+
css_first_content(dataset, '> name'),
|
263
|
+
build_node_list(dataset.css('> arguments argument')),
|
264
|
+
css_first_content(dataset, '> datasetUid'))
|
265
|
+
end
|
266
|
+
|
267
|
+
def build_actionwords(actionwords, actionwords_query = '> actionword')
|
268
|
+
build_node_list(actionwords.css(actionwords_query), Hiptest::Nodes::Actionwords)
|
269
|
+
end
|
270
|
+
|
271
|
+
def build_actionwordSnapshots(actionword_snapshots)
|
272
|
+
build_actionwords(actionword_snapshots, '> actionwordSnapshot')
|
273
|
+
end
|
274
|
+
|
275
|
+
def build_scenarios(scenarios, scenarios_query = '> scenario')
|
276
|
+
build_node_list(scenarios.css(scenarios_query), Hiptest::Nodes::Scenarios)
|
277
|
+
end
|
278
|
+
|
279
|
+
def build_scenarioSnapshots(scenario_snapshots)
|
280
|
+
build_scenarios(scenario_snapshots, '> scenarioSnapshot')
|
281
|
+
end
|
282
|
+
|
283
|
+
def build_tests(tests)
|
284
|
+
build_node_list(tests.css('> test'), Hiptest::Nodes::Tests)
|
285
|
+
end
|
286
|
+
|
287
|
+
def build_test(test)
|
288
|
+
Hiptest::Nodes::Test.new(
|
289
|
+
css_first_content(test, 'name'),
|
290
|
+
css_first_content(test, 'description'),
|
291
|
+
build_tags(test),
|
292
|
+
build_steps(test)
|
293
|
+
)
|
294
|
+
end
|
295
|
+
|
296
|
+
def build_folder(folder)
|
297
|
+
Hiptest::Nodes::Folder.new(
|
298
|
+
css_first_content(folder, 'uid'),
|
299
|
+
css_first_content(folder, 'parentUid'),
|
300
|
+
css_first_content(folder, 'name'),
|
301
|
+
css_first_content(folder, 'description'),
|
302
|
+
build_tags(folder),
|
303
|
+
css_first_content(folder, 'order_in_parent').to_i,
|
304
|
+
build_steps(folder))
|
305
|
+
end
|
306
|
+
alias :build_folderSnapshot :build_folder
|
307
|
+
|
308
|
+
def build_testPlan(test_plan, folders_query = '> folder')
|
309
|
+
tp = Hiptest::Nodes::TestPlan.new(
|
310
|
+
build_node_list(test_plan.css(folders_query)))
|
311
|
+
|
312
|
+
tp.organize_folders
|
313
|
+
return tp
|
314
|
+
end
|
315
|
+
|
316
|
+
def build_actionwordLibraries(libraries)
|
317
|
+
Hiptest::Nodes::Libraries.new(
|
318
|
+
build_node_list(libraries.css('> actionwordLibrary'))
|
319
|
+
)
|
320
|
+
end
|
321
|
+
|
322
|
+
def build_actionwordLibrarySnapshots(libraries)
|
323
|
+
Hiptest::Nodes::Libraries.new(
|
324
|
+
build_node_list(libraries.css('> actionwordLibrarySnapshot'))
|
325
|
+
)
|
326
|
+
end
|
327
|
+
|
328
|
+
def build_actionwordLibrary(library)
|
329
|
+
Hiptest::Nodes::Library.new(
|
330
|
+
css_first_content(library, '> name'),
|
331
|
+
build_node_list(library.css('> libraryActionwords libraryActionword'))
|
332
|
+
)
|
333
|
+
end
|
334
|
+
|
335
|
+
def build_actionwordLibrarySnapshot(library)
|
336
|
+
Hiptest::Nodes::Library.new(
|
337
|
+
css_first_content(library, '> name'),
|
338
|
+
build_node_list(library.css('> libraryActionwordSnapshots actionwordSnapshot'))
|
339
|
+
)
|
340
|
+
end
|
341
|
+
|
342
|
+
def build_folderSnapshots(folder_snapshots)
|
343
|
+
build_testPlan(folder_snapshots, '> folderSnapshot')
|
344
|
+
end
|
345
|
+
|
346
|
+
def build_project
|
347
|
+
project = css_first(@xml, 'project')
|
348
|
+
test_run = css_first(project, '> testRuns > testRun')
|
349
|
+
|
350
|
+
if test_run.nil?
|
351
|
+
test_plan_node = css_first(project, '> testPlan')
|
352
|
+
scenarios_node = css_first(project, '> scenarios')
|
353
|
+
actionwords_node = css_first(project, '> actionwords')
|
354
|
+
libraries_node = css_first(project, '> actionwordLibraries')
|
355
|
+
else
|
356
|
+
test_plan_node = css_first(test_run, '> folderSnapshots')
|
357
|
+
scenarios_node = css_first(test_run, '> scenarioSnapshots')
|
358
|
+
actionwords_node = css_first(test_run, '> actionwordSnapshots')
|
359
|
+
libraries_node = css_first(test_run, '> actionwordLibrarySnapshots')
|
360
|
+
end
|
361
|
+
|
362
|
+
@project = Hiptest::Nodes::Project.new(
|
363
|
+
css_first_content(project, '> name'),
|
364
|
+
css_first_content(project, '> description'),
|
365
|
+
build_node(test_plan_node, Hiptest::Nodes::TestPlan),
|
366
|
+
build_node(scenarios_node, Hiptest::Nodes::Scenarios),
|
367
|
+
build_node(actionwords_node, Hiptest::Nodes::Actionwords),
|
368
|
+
build_node(css_first(project, '> tests'), Hiptest::Nodes::Tests),
|
369
|
+
build_node(libraries_node, Hiptest::Nodes::Libraries)
|
370
|
+
)
|
371
|
+
|
372
|
+
@project.assign_scenarios_to_folders
|
373
|
+
return @project
|
374
|
+
end
|
375
|
+
|
376
|
+
private
|
377
|
+
|
378
|
+
def build_node(node, default_node=nil)
|
379
|
+
if node.nil? && default_node
|
380
|
+
return default_node.new
|
381
|
+
end
|
382
|
+
self.send("build_#{node.name}", node)
|
383
|
+
rescue => error
|
384
|
+
@reporter.dump_error(error, I18n.t('build_data.error', node: node.to_s))
|
385
|
+
nil
|
386
|
+
end
|
387
|
+
|
388
|
+
def build_node_list(l, container_class=nil)
|
389
|
+
items = l.map {|item| build_node(item)}
|
390
|
+
|
391
|
+
unless container_class.nil?
|
392
|
+
container_class.new(items)
|
393
|
+
else
|
394
|
+
items
|
395
|
+
end
|
396
|
+
end
|
397
|
+
|
398
|
+
def css_first(node, selector = '> *')
|
399
|
+
node.css(selector).first
|
400
|
+
end
|
401
|
+
|
402
|
+
def css_first_content(node, selector = '> *')
|
403
|
+
sub_node = css_first(node, selector)
|
404
|
+
sub_node.nil? ? nil : sub_node.content
|
405
|
+
end
|
406
|
+
end
|
407
|
+
end
|