Skip to content

Commit

Permalink
Merge pull request #13 from PrivaliaTech/feature/cucumber-html-reports
Browse files Browse the repository at this point in the history
Feature/cucumber html reports
  • Loading branch information
josefd8 authored Jan 22, 2020
2 parents c5476b1 + a92554e commit dd3aa45
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/main/resources/archetype-resources/.gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ CucumberBackendIT:
stage: test
script:
- 'mvn verify -Dit.test=${groupId}.${artifactId}.${package}.CucumberBackendIT'
allow_failure: true
artifacts:
paths:
- target/*.json
Expand All @@ -42,6 +43,7 @@ CucumberRestIT:
stage: test
script:
- 'mvn verify -Dit.test=${groupId}.${artifactId}.${package}.CucumberRestIT'
allow_failure: true
artifacts:
paths:
- target/*.json
Expand All @@ -51,9 +53,25 @@ CucumberSeleniumIT:
stage: test
script:
- 'mvn verify -Dit.test=${groupId}.${artifactId}.${package}.CucumberSeleniumIT -DSELENIUM_NODE=node:4444'
allow_failure: true
artifacts:
paths:
- target/executions/**
- target/*.json
when: always


# At the end of the mvn verify phase, a cucumber json report is generated for each feature. This file serves as the seed to create an
# HTML report in target/cucumber-html-reports. this job takes all json files found in target/ to generate an HTML cucumber report which
# is then published in Github pages. You need to activate the 'Github pages' functionality in your repo for this to work
pages:
stage: deploy
script:
- mvn verify -Dmaven.test.skip=true
- mkdir -p ./public
- cp -r target/cucumber-html-reports/* public/
- cp public/overview-features.html public/index.html
artifacts:
paths:
- public

23 changes: 23 additions & 0 deletions src/main/resources/archetype-resources/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,29 @@
<useSystemClassloader>true</useSystemClassloader>
</configuration>
</plugin>
<plugin>
<groupId>net.masterthought</groupId>
<artifactId>maven-cucumber-reporting</artifactId>
<version>5.0.0</version>
<executions>
<execution>
<id>execution</id>
<phase>verify</phase>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<projectName>${artifactId}</projectName>
<outputDirectory>${project.build.directory}</outputDirectory>
<inputDirectory>${project.build.directory}</inputDirectory>
<jsonFiles>
<param>*.json</param>
</jsonFiles>
<checkBuildResult>false</checkBuildResult>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

Expand Down

0 comments on commit dd3aa45

Please sign in to comment.