serenity-bdd / serenity-cucumber4

Other
13 stars 10 forks source link

fix: bugfix for issue #21 #22

Closed scormaq closed 4 years ago

scormaq commented 4 years ago

Summary of this PR

Fix loading scenarios in suiteslicing mechanizm. Issue was caused by changes in cucumber-jvm 4.8.0 (previously used 4.2.0). With latter cucumber version there is an issue to create java.io.File from java.net.URI, because now cucumber stores feature file URI in different format, causing error in File constructor (see related issue for details).

Description of PR:

Create utility class PathUtils to correctly transform URI strings like file:/path/to/feature or classpath:/path/to/feature into existing files. This class is applied in methods CucumberScenarioLoader#getScenarios and CucumberSerenityRunner#forIncludedFeatures

Fix was tested on windows 10 environment.

How should this be manually tested?

Run Serenity tests using suiteslicing mechanizm (i.e. using properties serenity.batch.count and serenity.batch.number). Also, CucumberScenarioLoaderTest test is auto fixed.

Relevant tickets

This is a fix for issue #21