java - Maven build not failing when gherkin tests fails -
i have maven project executes gherkin files tests, when of these tests fails maven doesn't care , succesfully complete build.
my configuration like:
public class appstepdefs extends appspringintegrationtest { @autowired contentservicemock contentmock; @autowired filestorageservicemock filestoragemock; @given("^following stuff stored in content service$") public void given_following_stuff(datatable datatable) { datatable.asmaps(string.class, string.class) .stream() .map(stuffconverter::fromdatatablerow) .foreach(stuff -> contentmock.insert(stuff.get("id").tostring(), stuff)); } //...all other steps } then appspringintegrationtests:
@contextconfiguration( classes = appfunctionaltestconfiguration.class, loader = springapplicationcontextloader.class ) @integrationtest public class appspringintegrationtest { @bean public filestorageservice filestorageclient() { return new filestorageservicemock(); } //...all other beans } and cucumber configuration class:
@runwith(cucumber.class) @cucumberoptions( features = "src/test/resources/functional/features", format = {"pretty", "html:target/cucumber"} ) public class cucumbertest { } all tests executed when fail:
failed scenarios: cucumber_conf.feature:12 # scenario: test creation stuff 22 scenarios (1 failed, 21 passed) 65 steps (1 failed, 64 passed) 0m12,586s tests run: 10, failures: 0, errors: 0, skipped: 0, time elapsed: 17.866 sec - in testsuite results : tests run: 10, failures: 0, errors: 0, skipped: 0 [info] ------------------------------------------------------------------------ [info] reactor summary: [info] [info] stuffservice parent ............ success [ 1.012 s] [info] stuffservice ................... success [ 22.588 s] [info] ------------------------------------------------------------------------ [info] build success [info] ------------------------------------------------------------------------ [info] total time: 32.992 s [info] finished at: 2017-07-28t14:46:35+02:00 [info] final memory: 60m/419m [info] ------------------------------------------------------------------------ these cucumber dependencies i'm using:
<dependency> <groupid>info.cukes</groupid> <artifactid>cucumber-java</artifactid> <version>1.2.4</version> <scope>test</scope> </dependency> <dependency> <groupid>info.cukes</groupid> <artifactid>cucumber-spring</artifactid> <version>1.2.4</version> <scope>test</scope> </dependency> <dependency> <groupid>info.cukes</groupid> <artifactid>cucumber-testng</artifactid> <version>1.2.4</version> <scope>test</scope> </dependency>
Comments
Post a Comment