scenarioo / scenarioo-js

Scenarioo writer library to produce feature rich e2e test reports, e.g. from Protractor/WebDriverJS tests with Jasmine
http://www.scenarioo.org
MIT License
10 stars 3 forks source link

Feature/80 save last step does not save xml and Feature/88 Scenario summary not created #85

Closed davidlahner closed 5 years ago

davidlahner commented 5 years ago

Fixes #80 Fixes #88

When saveLastStep is activated in the configuration then a step (with screenshot and step.xml) would be created after a test has completed. Currently, however only the screenshot was created and the step.xml was missing.

The reason for this was that the test runner closed the browser during the execution of docuWriter.writeStepXml(). And this happened because saveLastStep returned nothing instead of the promise of saveStep and thus the test runner did not wait for saveLastStep to complete and terminated the browser too soon.

I tested this with the supplied example https://github.com/sbrugnoni/scenarioo-js-minimal-example using scenario-js from this branch and the step.xml was correctly created and displayed in the Scenarioo web client.

davidlahner commented 5 years ago

Added bugfix for issue #88 to this branch as well, because it made testing Scenarioo too complicated with two different branches.

The issue here was, that for e2e tests without a description scenario.xml was not written and thus no scenarios were displayed in the Scenario Viewer Web Application.

The reason why the scenario.xml was not written turned out to be that a json validation exception occurred after the test succeeded (and thus the test itself did not fail). The validation exception occurred because description was defined without a value in fluentDsl.js and if it wasn't set by a test it remained at undefined, which caused the validation exception.