How to generate HTML reports for functional tests using Intern tool - intern

The intern tutorial doesn't provide how to generate HTML reports for function tests.
I would like to know the below things :
How to generate HTML report in Intern for functional tests.
If we can generate a Junit XML file. best tools to convert XML file to HTML and how to integrate with Intern.

There is currently no built-in way to generate an HTML report for functional tests. Reporters are pretty easy to create, though, and it would be relatively straightforward to create an HTML reporter using the JUnit reporter as a basis. It would just need to be modified to emit an HTML doc header and HTML tags rather than JUnit XML tags. This would be more flexible than trying to convert a generated JUnit report to HTML since you would have total control of the output.

Related

Is it possible to convert a .spec file to a .feature file?

I am using gauge framework for testing. I wish to store the execution results in Jira/Xray. But Jira/Xray only support cucumber for automated testing. I am thinking of converting the .spec file to .feature file and add it to the Xray test scenario. Then after executing the gauge test I am translating the gauge-json report to a cucumber-json myself. I am looking for a tool or a convinient way to translate the .spec file to .feature file.
Gauge does not provide a way to convert specifications(.spec) into Gherkin (.feature). Gauge specifications follow Markdown format, there might be tools which can convert markdown to Gherkin. But Gauge will not be able to execute Gherkin syntax.
For the reporting bit writing a reporting plugin which can generate the report in a format which is accepted by Jira/Xray might be useful.
I'm not aware of a spec=>Gherkin converter but in theory, you could convert the markdown to a Gherkin kind of layout just as means to have visibility of the steps in Xray.
If you aim to have visibility of the spec and detailed results, another option would be to convert the gauge report to Robot Framework XML kind of report that Xray can process. That would give visibility of each step result as seen in this Robot tutorial, on the test run execution screen. Then you would need to submit this transformed report to the respective Robot REST API endpoint.

Handling Excel Spreadsheets with Cucumber

I am planning to work on the Cucumber feature file with Groovy code (Katalon Studio) for step definitions. I wanted to use the excel file in Cucumber file or to see is there any other option to use it.
I have not yet tried as of now any other option. I am thinking just passing the cucumber step file without any parameter and then using the excel file with in the step definition and access excel file and get the corresponding value.
I see there is a post in this forum suggesting to use QMetry Automation Framework for this type of question. But it does not look like this will help on this or should I use the passing the row index from cucumber file and based on that retrieve the value. Please guide on this.
Handling excel spreadsheets with Cucumber Scenario Outline
You should know that this is not supported by Cucumber.
As specified in the FAQ:
"We advise you not to use Excel or csv files to define your test cases; using Excel or csv files is considered an anti-pattern.
One of the goals of Cucumber is to have executable specifications. This means your feature files should contain just the right level of information to document the expected behaviour of the system. If your test cases are kept in separate files, how would you be able to read the documentation?
This also means you shouldn’t have too many details in your feature file. If you do, you might consider moving them to your step definitions or helper methods. For instance, if you have a form where you need to populate lots of different fields, you might use the Builder pattern to do so."
If you are using cucumber java 5+ you can add qaf-cucumber dependency. It should work with groovy as well. It will enable to have examples from external source like CSV, XML, JSON, EXCEL, DB.

How to generate cucumber Extent reports html for every test case

I am trying to use Cucumber Extent Reports to generate my html report. I want to create a consolidated HTML report for the overall test execution and individual HTML report for each test case. I am not able to create individual HTML for every test case but able to create the consolidated HTML by using the following
plugin ={"com.vimalselvam.cucumber.listener.ExtentCucumberFormatter:target/cucumber-reports/report.html"}
How to add the same for generating the HTML for individual test cases? Can someone please help me out
enter image description here

Best template engine for generate javascript from Node.js

For me, to produce HTML or XML, pug is favorite one.
However, when the expected result is not based on mark up language, I used to use Handlebars. But When I produce javascript dynamically using handlebar, It makes very difficulties to maintain templates and terrible readability to keep generated code pretty.
When I do same thing with java, I prefer to use Xtend.
Is there any template engine that is intended to generate code?
(which is not based on AST)
Full Scenario
I made a Java Script library using TypeScript.
To make Eclipse's Java Script type inference engine can support content assist for this library, I needed to create some TS to JS-skeleton trans-compiler. (result js just contains scheme and js-doc for Eclipse JS capability)
I used type-script from NPM to inspect library scheme.
I transformed TypeScript AST to my own purpose model to generate JavaScript files.
Then I need to generate Java Script files from this model, And I'm looking for best template engine.
The template engine should be easy to manage indent, iteration, conditional templates to generate clear code with readable template.

Cucumber + parallel_tests. HTML results?

I currently try to implement parallel_tests for our Cucumber + Watir-WebDriver acceptance tests. As far it goes great.
However, we got used to nice HTML reports from Cucumber with embedded screenshots of failed scenarios. Cucumber creates reports as a single HTML file with all the features. But with parallel_tests, this HTML file is overwritten with the last called Cucumber process and thus incomplete.
Is it possible to generate several HTML reports or generate HTML reports per features file?
Put
default: --format html --out report<%= ENV['TEST_ENV_NUMBER'] %>.html
in ./config/cucumber.yml. Whey you run the tests, you will find report.html, report2.html (...) files in project root.
I don't think you have this out of the box. What we ended up doing was writing a new formatter.
https://github.com/cucumber/cucumber/wiki/Custom-Formatters

Resources