diff --git a/bitbucket-pipelines.yml b/bitbucket-pipelines.yml index b877db6..587b828 100644 --- a/bitbucket-pipelines.yml +++ b/bitbucket-pipelines.yml @@ -1,10 +1,3 @@ -# Template maven-build - -# This template allows you to test and build your Java project with Maven. -# The workflow allows running tests, code checkstyle and security scans on the default branch. - -# Prerequisites: pom.xml and appropriate project structure should exist in the repository. - pipelines: default: - parallel: @@ -20,3 +13,5 @@ pipelines: - mvn compiler:compile - mvn compiler:testCompile - mvn surefire:test + - export REPORTPATH="target/test-reports/*.*" + - curl -H "Authorization: Bearer ${BEARER_TOKEN}" -X POST "https://api.bitbucket.org/2.0/repositories/${BITBUCKET_REPO_OWNER}/${BITBUCKET_REPO_SLUG}/downloads" --form files=@"${REPORTPATH}" diff --git a/pom.xml b/pom.xml index 240eb9f..e0ac0b6 100644 --- a/pom.xml +++ b/pom.xml @@ -127,11 +127,11 @@ plugin={ "pretty", - "html:test-reports/cucumber-html-report.html", - "json:test-reports/cucumber.json", - "pretty:test-reports/cucumber-pretty.txt", - "usage:test-reports/cucumber-usage.json", - "junit:test-reports/cucumber-results.xml" + "html:target/test-reports/cucumber-html-report.html", + "json:target/test-reports/cucumber.json", + "pretty:target/test-reports/cucumber-pretty.txt", + "usage:target/test-reports/cucumber-usage.json", + "junit:target/test-reports/cucumber-results.xml" }, publish=false, stepNotifications=true @@ -164,6 +164,12 @@ **/*DemoRunner.java + + + junit.platform.reporting.open.xml.enabled = true + junit.platform.reporting.output.dir = target/surefire-reports + + ${cucumber.options} diff --git a/src/test/java/org/example/webtests/runner/DemoRunner.java b/src/test/java/org/example/webtests/runner/DemoRunner.java index 626e4ca..f5198cc 100644 --- a/src/test/java/org/example/webtests/runner/DemoRunner.java +++ b/src/test/java/org/example/webtests/runner/DemoRunner.java @@ -10,11 +10,11 @@ import org.junit.runner.RunWith; glue = {"org.example.webtests.steps"}, plugin = { "pretty", - "html:test-reports/cucumber-html-report.html", - "json:test-reports/cucumber.json", - "pretty:test-reports/cucumber-pretty.txt", - "usage:test-reports/cucumber-usage.json", - "junit:test-reports/cucumber-results.xml" + "html:target/test-reports/cucumber-report.html", + "json:target/test-reports/cucumber.json", + "pretty:target/test-reports/cucumber-pretty.txt", + "usage:target/test-reports/cucumber-usage.json", + "junit:target/test-reports/cucumber-results.xml" }, publish = false, stepNotifications = true