Closed Icaroto closed 7 years ago
In case it makes any difference, heres my pom file:
<properties>
<java.version>1.7</java.version>
<junit.version>4.12</junit.version>
<cucumber.version>1.2.5</cucumber.version>
<selenium.version>2.53.0</selenium.version>
<maven.compiler.version>3.3</maven.compiler.version>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-java</artifactId>
<version>${cucumber.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-core</artifactId>
<version>${cucumber.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-junit</artifactId>
<version>${cucumber.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>net.masterthought</groupId>
<artifactId>cucumber-reporting</artifactId>
<version>3.7.0</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>${selenium.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-chrome-driver</artifactId>
<version>${selenium.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
This file seems to be correct so error is about different file
Hello, I think Ive found the issue.
I opened both json I have here (The one generated by cucumber and the other from a previous project I had and is fully working) on Notepad++.
The one generated by Cucumber in encoded as ANSI, Unix (LF) the one I have that works is encoded as UTF-8, Windows (CR FL).
So my guess is that the plugin doesn't support some type of encodings, like this ANSI? Anyway, just a matter of converting the json file before handing over to plugin I guess :)
Also, is there any place where I can get all the possible tags/properties the json can have? Like a full json example?
Thanks and REALLY sorry any disturbance!
Plugin uses UTF8 . List of supported plugin should be present at cucumber.io
i am facing same issue, what I'm doing wrong?
net.masterthought.cucumber.ValidationException: File './target/cucumberpf.json' is not proper Cucumber report! at net.masterthought.cucumber.ReportParser.parseForFeature(ReportParser.java:87) at net.masterthought.cucumber.ReportParser.parseJsonFiles(ReportParser.java:58) at net.masterthought.cucumber.ReportBuilder.generateReports(ReportBuilder.java:87) at pageobjects.TestCase.tearDown(TestCase.java:89) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at cucumber.runtime.Utils$1.call(Utils.java:40) at cucumber.runtime.Timeout.timeout(Timeout.java:16) at cucumber.runtime.Utils.invoke(Utils.java:34) at cucumber.runtime.java.JavaHookDefinition.execute(JavaHookDefinition.java:60) at cucumber.runtime.Runtime.runHookIfTagsMatch(Runtime.java:224) at cucumber.runtime.Runtime.runHooks(Runtime.java:212) at cucumber.runtime.Runtime.runAfterHooks(Runtime.java:206) at cucumber.runtime.model.CucumberScenario.run(CucumberScenario.java:46) at cucumber.runtime.junit.ExecutionUnitRunner.run(ExecutionUnitRunner.java:91) at org.junit.runners.Suite.runChild(Suite.java:128) at org.junit.runners.Suite.runChild(Suite.java:27) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at cucumber.runtime.junit.ExamplesRunner.run(ExamplesRunner.java:59) at org.junit.runners.Suite.runChild(Suite.java:128) at org.junit.runners.Suite.runChild(Suite.java:27) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at cucumber.runtime.junit.ScenarioOutlineRunner.run(ScenarioOutlineRunner.java:53) at cucumber.runtime.junit.FeatureRunner.runChild(FeatureRunner.java:63) at cucumber.runtime.junit.FeatureRunner.runChild(FeatureRunner.java:18) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at cucumber.runtime.junit.FeatureRunner.run(FeatureRunner.java:70) at cucumber.api.junit.Cucumber.runChild(Cucumber.java:93) at cucumber.api.junit.Cucumber.runChild(Cucumber.java:37) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at cucumber.api.junit.Cucumber.run(Cucumber.java:98) at org.junit.runner.JUnitCore.run(JUnitCore.java:137) at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68) at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:51) at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:237) at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70) Caused by: com.fasterxml.jackson.databind.JsonMappingException: No content to map due to end-of-input at [Source: java.io.InputStreamReader@b3b1ce; line: 1, column: 0] at com.fasterxml.jackson.databind.JsonMappingException.from(JsonMappingException.java:270) at com.fasterxml.jackson.databind.ObjectMapper._initForReading(ObjectMapper.java:3838) at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:3783) at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2887) at net.masterthought.cucumber.ReportParser.parseForFeature(ReportParser.java:81) ... 57 more
that's my pom file
<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<groupId>Suruse</groupId>
<artifactId>Suruse</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Suruse</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.8</version>
<executions>
<execution>
<id>add-source</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>${basedir}</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.6.0</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.19.1</version>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-java</artifactId>
<version>1.2.5</version>
</dependency>
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-testng</artifactId>
<version>1.2.5</version>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>3.5.3</version>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-firefox-driver</artifactId>
<version>3.3.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-chrome-driver</artifactId>
<version>3.3.1</version>
</dependency>
<dependency>
<groupId>org.apache.maven.archetypes</groupId>
<artifactId>maven-archetype-quickstart</artifactId>
<version>1.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.nextrtc.signalingserver</groupId>
<artifactId>nextrtc-signaling-server</artifactId>
<version>0.0.3</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
</dependency>
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-junit</artifactId>
<version>1.2.3</version>
</dependency>
<dependency>
<groupId>com.cloudinary</groupId>
<artifactId>cloudinary-http44</artifactId>
<version>1.16.0</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.0</version>
</dependency>
<dependency>
<groupId>net.masterthought</groupId>
<artifactId>cucumber-reporting</artifactId>
<version>3.11.0</version>
</dependency>
<dependency>
<groupId>io.github.bonigarcia</groupId>
<artifactId>webdrivermanager</artifactId>
<version>1.7.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.github.mkolisnyk</groupId>
<artifactId>cucumber-reports</artifactId>
<version>0.0.2</version>
</dependency>
<dependency>
<groupId>net.sourceforge.htmlunit</groupId>
<artifactId>htmlunit-core-js</artifactId>
<version>2.27</version>
<scope>test</scope>
</dependency>
</dependencies>
That's My code
@After public void tearDown(Scenario scenario) throws Exception {
File reportOutputDirectory = new File("target");
List<String> jsonFiles = new ArrayList<String>();
jsonFiles.add("./target/cucumber.json");
String buildNumber = "1";
String projectName = "Suruse";
boolean runWithJenkins = false;
boolean parallelTesting = false;
Configuration configuration = new Configuration(reportOutputDirectory, projectName);
// optional configuration
configuration.setParallelTesting(parallelTesting);
configuration.setRunWithJenkins(runWithJenkins);
configuration.setBuildNumber(buildNumber);
// addidtional metadata presented on main page
configuration.addClassifications("Platform","Windows");
configuration.addClassifications("Browser","chrome");
configuration.addClassifications("Branch","release/1.0");
ReportBuilder reportBuilder = new ReportBuilder(jsonFiles, configuration);
Reportable result = reportBuilder.generateReports();
}
That's my Json file
[ { "line": 2, "elements": [ { "line": 4, "name": "To verify user SignUp successful", "description": "", "id": "suruse;to-verify-user-signup-successful", "after": [ { "result": { "duration": 854008620, "status": "passed" }, "match": { "location": "TestCase.tearDown(Scenario)" } } ], "type": "scenario", "keyword": "Scenario", "steps": [ { "result": { "duration": 5627599372, "status": "passed" }, "line": 5, "name": "I am open \"chrome\"", "match": { "arguments": [ { "val": "chrome", "offset": 11 } ], "location": "TestCase.I_am_open(String)" }, "keyword": "Given " }, { "result": { "duration": 17682285735, "status": "passed" }, "line": 6, "name": "I am open the suruse signIn page URL \"http://dev.suruse.com/\"", "match": { "arguments": [ { "val": "http://dev.suruse.com/", "offset": 38 } ], "location": "TestCase.I_am_open_the_suruse_signIn_page_URL(String)" }, "keyword": "When " }, { "result": { "duration": 88696914, "status": "passed" }, "line": 7, "name": "I should see signIn page", "match": { "location": "TestCase.I_should_see_signIn_page()" }, "keyword": "Then " }, { "result": { "duration": 3100676288, "status": "passed" }, "line": 8, "name": "I click on SignUp Now link", "match": { "location": "TestCase.I_click_on_SignUp_Now_link()" }, "keyword": "When " }, { "result": { "duration": 49698235, "status": "passed" }, "line": 9, "name": "I should see the SignUp page", "match": { "location": "TestCase.I_should_see_the_SignUp_page()" }, "keyword": "Then " }, { "result": { "duration": 2113878175, "status": "passed" }, "line": 10, "name": "I enter FullName \"Test \"", "match": { "arguments": [ { "val": "Test ", "offset": 18 } ], "location": "TestCase.I_enter_FullName(String)" }, "keyword": "When " }, { "result": { "duration": 2132507529, "status": "passed" }, "line": 11, "name": "I enter UserName \"Test\"", "match": { "arguments": [ { "val": "Test", "offset": 18 } ], "location": "TestCase.I_enter_UserName(String)" }, "keyword": "And " }, { "result": { "duration": 2200323932, "status": "passed" }, "line": 12, "name": "I enter email address", "match": { "location": "TestCase.I_enter_email_address()" }, "keyword": "And " }, { "result": { "duration": 4234134058, "status": "passed" }, "line": 13, "name": "I enter New Password and Confirm password \"test1234\"", "match": { "arguments": [ { "val": "test1234", "offset": 43 } ], "location": "TestCase.I_enter_New_Password_and_Confirm_password(String)" }, "keyword": "And " }, { "result": { "duration": 3100189051, "status": "passed" }, "line": 14, "name": "I click on Agree the terms and policy check box", "match": { "location": "TestCase.I_click_on_Agree_the_terms_and_policy_check_box()" }, "keyword": "And " }, { "result": { "duration": 3128267507, "status": "passed" }, "line": 15, "name": "I click on SignUp button", "match": { "location": "TestCase.I_click_on_SignUp_button()" }, "keyword": "And " }, { "result": { "duration": 2070329853, "status": "passed" }, "line": 16, "name": "I should see the Thank you page", "match": { "location": "TestCase.I_should_see_the_Thank_you_page()" }, "keyword": "Then " }, { "result": { "duration": 596417877, "status": "passed" }, "line": 17, "name": "I close the browser", "match": { "location": "TestCase.I_close_the_browser()" }, "keyword": "And " } ] }, { "line": 32, "name": "To verify user login successful", "description": "", "id": "suruse;to-verify-user-login-successful;;2", "after": [ { "result": { "duration": 82936164, "status": "passed" }, "match": { "location": "TestCase.tearDown(Scenario)" } } ], "type": "scenario", "keyword": "Scenario Outline", "steps": [ { "result": { "duration": 3710199402, "status": "passed" }, "line": 21, "name": "I am open \"chrome\"", "match": { "arguments": [ { "val": "chrome", "offset": 11 } ], "location": "TestCase.I_am_open(String)" }, "keyword": "Given " }, { "result": { "duration": 17691383307, "status": "passed" }, "line": 22, "name": "I am open the suruse signIn page URL \"http://dev.suruse.com/\"", "match": { "arguments": [ { "val": "http://dev.suruse.com/", "offset": 38 } ], "location": "TestCase.I_am_open_the_suruse_signIn_page_URL(String)" }, "keyword": "When " }, { "result": { "duration": 34088386, "status": "passed" }, "line": 23, "name": "I should see signIn page", "match": { "location": "TestCase.I_should_see_signIn_page()" }, "keyword": "Then " }, { "result": { "duration": 2168314502, "status": "passed" }, "line": 24, "name": "I enter user name \"testautomation@mailinator.com\"", "match": { "arguments": [ { "val": "testautomation@mailinator.com", "offset": 19 } ], "location": "TestCase.I_enter_user_name(String)" }, "matchedColumns": [ 0 ], "keyword": "When " }, { "result": { "duration": 2086647039, "status": "passed" }, "line": 25, "name": "I enter Password \"test123455\"", "match": { "arguments": [ { "val": "test123455", "offset": 18 } ], "location": "TestCase.I_enter_Password(String)" }, "matchedColumns": [ 1 ], "keyword": "And " }, { "result": { "duration": 3120016685, "status": "passed" }, "line": 26, "name": "I click on signIn button", "match": { "location": "TestCase.I_click_on_signIn_button()" }, "keyword": "And " }, { "result": { "duration": 67206001, "error_message": "org.openqa.selenium.NoSuchElementException: no such element: Unable to locate element: {\"method\":\"xpath\",\"selector\":\".//a[@class\u003d\u0027capital link icon-24 ion-home ng-isolate-scope active\u0027]\"}\n (Session info: chrome\u003d61.0.3163.100)\n (Driver info: chromedriver\u003d2.33.506120 (e3e53437346286c0bc2d2dc9aa4915ba81d9023f),platform\u003dWindows NT 6.1.7601 SP1 x86) (WARNING: The server did not provide any stacktrace information)\nCommand duration or timeout: 0 milliseconds\nFor documentation on this error, please visit: http://seleniumhq.org/exceptions/no_such_element.html\nBuild info: version: \u00273.5.3\u0027, revision: \u0027a88d25fe6b\u0027, time: \u00272017-08-29T12:42:44.417Z\u0027\nSystem info: host: \u0027DELL-PC\u0027, ip: \u0027192.168.0.3\u0027, os.name: \u0027Windows 7\u0027, os.arch: \u0027x86\u0027, os.version: \u00276.1\u0027, java.version: \u00271.8.0_144\u0027\nDriver info: org.openqa.selenium.chrome.ChromeDriver\nCapabilities [{mobileEmulationEnabled\u003dfalse, hasTouchScreen\u003dfalse, platform\u003dXP, acceptSslCerts\u003dtrue, webStorageEnabled\u003dtrue, browserName\u003dchrome, takesScreenshot\u003dtrue, javascriptEnabled\u003dtrue, platformName\u003dXP, setWindowRect\u003dtrue, unexpectedAlertBehaviour\u003d, applicationCacheEnabled\u003dfalse, rotatable\u003dfalse, networkConnectionEnabled\u003dfalse, chrome\u003d{chromedriverVersion\u003d2.33.506120 (e3e53437346286c0bc2d2dc9aa4915ba81d9023f), userDataDir\u003dC:\Users\dell\AppData\Local\Temp\scoped_dir8792_24282}, takesHeapSnapshot\u003dtrue, pageLoadStrategy\u003dnormal, unhandledPromptBehavior\u003d, databaseEnabled\u003dfalse, handlesAlerts\u003dtrue, version\u003d61.0.3163.100, browserConnectionEnabled\u003dfalse, nativeEvents\u003dtrue, locationContextEnabled\u003dtrue, cssSelectorsEnabled\u003dtrue}]\nSession ID: c21e78f0f2587ad7d49ae72b976503a7\n*** Element info: {Using\u003dxpath, value\u003d.//a[@class\u003d\u0027capital link icon-24 ion-home ng-isolate-scope active\u0027]}\r\n\tat sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)\r\n\tat sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)\r\n\tat sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)\r\n\tat java.lang.reflect.Constructor.newInstance(Constructor.java:423)\r\n\tat org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:215)\r\n\tat org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:167)\r\n\tat org.openqa.selenium.remote.http.JsonHttpResponseCodec.reconstructValue(JsonHttpResponseCodec.java:40)\r\n\tat org.openqa.selenium.remote.http.AbstractHttpResponseCodec.decode(AbstractHttpResponseCodec.java:82)\r\n\tat org.openqa.selenium.remote.http.AbstractHttpResponseCodec.decode(AbstractHttpResponseCodec.java:45)\r\n\tat org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:164)\r\n\tat org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:82)\r\n\tat org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:646)\r\n\tat org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:416)\r\n\tat org.openqa.selenium.remote.RemoteWebDriver.findElementByXPath(RemoteWebDriver.java:518)\r\n\tat org.openqa.selenium.By$ByXPath.findElement(By.java:361)\r\n\tat org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:408)\r\n\tat pageobjects.TestPageObject.VerifyElementIsDisplay(TestPageObject.java:78)\r\n\tat pageobjects.TestCase.I_should_see_the_home_page(TestCase.java:207)\r\n\tat ✽.Then I should see the home page(suruse.feature:27)\r\n", "status": "failed" }, "line": 27, "name": "I should see the home page", "match": { "location": "TestCase.I_should_see_the_home_page()" }, "keyword": "Then " }, { "result": { "status": "skipped" }, "line": 28, "name": "I should see User name on home page", "match": { "location": "TestCase.I_should_see_User_name_on_home_page()" }, "keyword": "And " }, { "result": { "status": "skipped" }, "line": 29, "name": "I close the browser", "match": { "location": "TestCase.I_close_the_browser()" }, "keyword": "And " } ], "tags": [ { "line": 1, "name": "@smokeTest" } ] } ], "name": "Suruse", "description": "", "id": "suruse", "keyword": "Feature", "uri": "suruse.feature", "tags": [ { "line": 1, "name": "@smokeTest" } ] } ]
Hi, not sure if that's going to help you guys, but I found out what my problem was. Although the content was correct, my .json file was NOT encoded using UTF-8, the moment I changed the encoding it worked...
@Icaroto .. how did you changed encoding for your .json file, I am facing the same issue.. tried below properties in my POM...
I have met the same problem, and add below properties in my POM: `
I am facing the similar issue. Any help would be appreciated.
I have Same issue Could you please suggest me any other solution ? I already tried adding UTF-8 encoding to properties
my Pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<groupId>org.cxw</groupId>
<artifactId>UIAuto</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>CXWUIAutomation</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<project.build.resourceEncoding>UTF-8</project.build.resourceEncoding>
<maven.compile.encoding>UTF-8</maven.compile.encoding>
</properties>
<dependencies>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.11</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-dependency-plugin -->
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.0.2</version>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>3.5.3</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/log4j/log4j -->
<!-- Test Comment -->
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-java</artifactId>
<version>1.2.4</version>
</dependency>
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-junit</artifactId>
<version>1.2.2</version>
</dependency>
<!-- https://mvnrepository.com/artifact/info.cukes/cucumber-jvm -->
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-jvm</artifactId>
<version>1.2.5</version>
<type>pom</type>
</dependency>
</dependencies>
Mostly people getting this issue as they are still using old version of cucumber (1.2.5) so update your POM file with latest available cucumber version in order to resolve this issue.
Please use below Maven POM dependencies.
For me issue got resolved when i have place below code in after class:
@AfterClass
public void tearDownClass() {
testNGCucumberRunner.finish();
File reportOutputDirectory = new File("target/cucumber-reports");
List
String buildNumber = "101";
String projectName = "Live Demo Project";
Configuration configuration = new Configuration(reportOutputDirectory, projectName);
configuration.setBuildNumber(buildNumber);
configuration.addClassifications("Browser", "Firefox");
configuration.addClassifications("Branch", "release/1.0");
configuration.setSortingMethod(SortingMethod.NATURAL);
configuration.addPresentationModes(PresentationMode.EXPAND_ALL_STEPS);
// points to the demo trends which is not used for other tests
configuration.setTrendsStatsFile(new File("target/test-classes/demo-trends.json"));
ReportBuilder reportBuilder = new ReportBuilder(jsonFiles, configuration);
reportBuilder.generateReports();
}
Hi, not sure if that's going to help you guys, but I found out what my problem was. Although the content was correct, my .json file was NOT encoded using UTF-8, the moment I changed the encoding it worked...
Super helpful dude, now will you reveal the secret of how you got Cucumber to generate UTF8 files?
hello guys can anyone help me with the below issue https://github.com/jenkinsci/cucumber-reports-plugin/issues/375
<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>com.edb.finance</groupId>
<artifactId>parent-pom</artifactId>
<version>5.0.63</version>
</parent>
<groupId>com.tietoevry.fs.payment.pcr</groupId>
<artifactId>pcr-daemon</artifactId>
<version>0.0.0-SNAPSHOT</version>
<name>${project.artifactId}</name>
<packaging>pom</packaging>
<description>Payment charges module - PCR.</description>
<inceptionYear>2021</inceptionYear>
<modules>
<module>pcr-application</module>
<module>pcr-common</module>
<module>pcr-model</module>
<module>pcr-openapi</module>
<module>pcr-integration</module>
<module>pcr-enrichment</module>
<module>pcr-test</module>
<module>pcr-restassured-automation</module>
</modules>
<developers/>
<scm/>
<issueManagement>
<system>jira</system>
<url>https://jira.finods.com/browse/PRM</url>
</issueManagement>
<properties>
<pcr.integration.client.version>1.0.2</pcr.integration.client.version>
<unique.version>${project.version}-${jgitver.git_sha1_8}</unique.version>
<project.build.java.target>17</project.build.java.target>
<spring.boot.version>2.7.5</spring.boot.version>
<ibm.mq.spring.boot.starter.version>2.7.5</ibm.mq.spring.boot.starter.version>
<spring.cloud.resilience4j.version>2.1.4</spring.cloud.resilience4j.version>
<spring.extensions.version>15.0.1</spring.extensions.version>
<cxf.version>3.5.4</cxf.version>
<cxf.utils.version>11.0.6</cxf.utils.version>
<camel.version>3.19.0</camel.version>
<jasypt.version>3.0.5</jasypt.version>
<logstash.logback.encoder.version>7.3</logstash.logback.encoder.version>
<swagger.version>1.6.10</swagger.version>
<!--Note change in swagger UI version to be updated here in dir -> pcr-application/src/main/resources/META-INF/resources/webjars/swagger-ui/4.18.2/swagger-initializer.js -->
<swagger.ui.version>4.18.2</swagger.ui.version>
<openapi-generator-version>6.5.0</openapi-generator-version>
<jsonSchema-generator-version>1.1.1</jsonSchema-generator-version>
<junit.version>5.8.1</junit.version>
<immutables.version>2.9.3</immutables.version>
<mapstruct.version>1.5.5.Final</mapstruct.version>
<jaxb2-maven-plugin.version>2.5.0</jaxb2-maven-plugin.version>
<javamelody.version>1.76.0</javamelody.version>
<git.commitid.skip>true</git.commitid.skip>
<sonar.coverage.exclusions>
**/pom.xml,
**/*DaoImpl.java
</sonar.coverage.exclusions>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>${spring.boot.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>com.edb.finance.common</groupId>
<artifactId>spring-extensions</artifactId>
<version>${spring.extensions.version}</version>
</dependency>
<dependency>
<groupId>com.edb.finance.common.cxf</groupId>
<artifactId>cxf-utils</artifactId>
<version>${cxf.utils.version}</version>
</dependency>
<dependency>
<groupId>org.apache.camel.springboot</groupId>
<artifactId>camel-spring-boot-dependencies</artifactId>
<version>${camel.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.immutables</groupId>
<artifactId>value</artifactId>
<version>${immutables.version}</version>
</dependency>
<dependency>
<groupId>org.mapstruct</groupId>
<artifactId>mapstruct</artifactId>
<version>${mapstruct.version}</version>
</dependency>
<dependency>
<groupId>net.bull.javamelody</groupId>
<artifactId>javamelody-core</artifactId>
<version>${javamelody.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<encoding>UTF-8</encoding>
<annotationProcessorPaths>
<path>
<groupId>org.mapstruct</groupId>
<artifactId>mapstruct-processor</artifactId>
<version>${mapstruct.version}</version>
</path>
<path>
<groupId>org.immutables</groupId>
<artifactId>value</artifactId>
<version>${immutables.version}</version>
</path>
</annotationProcessorPaths>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
4.0.0
<parent> <groupId>com.edb.finance</groupId> <artifactId>parent-pom</artifactId> <version>5.0.63</version> </parent> <groupId>com.tietoevry.fs.payment.pcr</groupId> <artifactId>pcr-daemon</artifactId> <version>0.0.0-SNAPSHOT</version> <name>${project.artifactId}</name> <packaging>pom</packaging> <description>Payment charges module - PCR.</description> <inceptionYear>2021</inceptionYear> <modules> <module>pcr-application</module> <module>pcr-common</module> <module>pcr-model</module> <module>pcr-openapi</module> <module>pcr-integration</module> <module>pcr-enrichment</module> <module>pcr-test</module> <module>pcr-restassured-automation</module> </modules> <developers/> <scm/> <issueManagement> <system>jira</system> <url>https://jira.finods.com/browse/PRM</url> </issueManagement> <properties> <pcr.integration.client.version>1.0.2</pcr.integration.client.version> <unique.version>${project.version}-${jgitver.git_sha1_8}</unique.version> <project.build.java.target>17</project.build.java.target> <spring.boot.version>2.7.5</spring.boot.version> <ibm.mq.spring.boot.starter.version>2.7.5</ibm.mq.spring.boot.starter.version> <spring.cloud.resilience4j.version>2.1.4</spring.cloud.resilience4j.version> <spring.extensions.version>15.0.1</spring.extensions.version> <cxf.version>3.5.4</cxf.version> <cxf.utils.version>11.0.6</cxf.utils.version> <camel.version>3.19.0</camel.version> <jasypt.version>3.0.5</jasypt.version> <logstash.logback.encoder.version>7.3</logstash.logback.encoder.version> <swagger.version>1.6.10</swagger.version> <!--Note change in swagger UI version to be updated here in dir -> pcr-application/src/main/resources/META-INF/resources/webjars/swagger-ui/4.18.2/swagger-initializer.js --> <swagger.ui.version>4.18.2</swagger.ui.version> <openapi-generator-version>6.5.0</openapi-generator-version> <jsonSchema-generator-version>1.1.1</jsonSchema-generator-version> <junit.version>5.8.1</junit.version> <immutables.version>2.9.3</immutables.version> <mapstruct.version>1.5.5.Final</mapstruct.version> <jaxb2-maven-plugin.version>2.5.0</jaxb2-maven-plugin.version> <javamelody.version>1.76.0</javamelody.version> <git.commitid.skip>true</git.commitid.skip> <sonar.coverage.exclusions> **/pom.xml, **/*DaoImpl.java </sonar.coverage.exclusions> </properties> <dependencyManagement> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-dependencies</artifactId> <version>${spring.boot.version}</version> <type>pom</type> <scope>import</scope> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-security</artifactId> </dependency> <dependency> <groupId>com.edb.finance.common</groupId> <artifactId>spring-extensions</artifactId> <version>${spring.extensions.version}</version> </dependency> <dependency> <groupId>com.edb.finance.common.cxf</groupId> <artifactId>cxf-utils</artifactId> <version>${cxf.utils.version}</version> </dependency> <dependency> <groupId>org.apache.camel.springboot</groupId> <artifactId>camel-spring-boot-dependencies</artifactId> <version>${camel.version}</version> <type>pom</type> <scope>import</scope> </dependency> <dependency> <groupId>org.immutables</groupId> <artifactId>value</artifactId> <version>${immutables.version}</version> </dependency> <dependency> <groupId>org.mapstruct</groupId> <artifactId>mapstruct</artifactId> <version>${mapstruct.version}</version> </dependency> <dependency> <groupId>net.bull.javamelody</groupId> <artifactId>javamelody-core</artifactId> <version>${javamelody.version}</version> </dependency> </dependencies> </dependencyManagement> <build> <pluginManagement> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <configuration> <encoding>UTF-8</encoding> <annotationProcessorPaths> <path> <groupId>org.mapstruct</groupId> <artifactId>mapstruct-processor</artifactId> <version>${mapstruct.version}</version> </path> <path> <groupId>org.immutables</groupId> <artifactId>value</artifactId> <version>${immutables.version}</version> </path> </annotationProcessorPaths> </configuration> </plugin> </plugins> </pluginManagement> </build>
this i smy pom facing , Nov 22, 2023 2:15:10 PM net.masterthought.cucumber.ReportParser parseForFeature INFO: File 'C:\pcr-daemon\pcr-restassured-automation\target\jsonReports\cucumber-report.json' does not contain features Nov 22, 2023 2:15:11 PM net.masterthought.cucumber.ReportParser parseJsonFiles INFO: File 'C:\pcr-daemon\pcr-restassured-automation\target\jsonReports\cucumber-report.json' contains 0 feature(s) Nov 22, 2023 2:15:11 PM net.masterthought.cucumber.ReportBuilder generateErrorPage WARNING: Unexpected error net.masterthought.cucumber.ValidationException: Passed files have no features! at net.masterthought.cucumber.ReportParser.parseJsonFiles(ReportParser.java:78) at net.masterthought.cucumber.ReportBuilder.generateReports(ReportBuilder.java:97) at net.masterthought.cucumber.CucumberReportGeneratorMojo.execute(CucumberReportGeneratorMojo.java:236) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:137) at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute(MojoExecutor.java:301) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:211) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:165) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:157) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:121) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:56) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:127) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:294) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:192) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:105) at org.apache.maven.cli.MavenCli.execute(MavenCli.java:960) at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:293) at org.apache.maven.cli.MavenCli.main(MavenCli.java:196) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:568) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:282) at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:225) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:406) at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:347) at org.codehaus.classworlds.Launcher.main(Launcher.java:47)
Hi!
This might be a very common issue but I'm not sure what I'm doing wrong, honestly!
I've added the code from the main page in my @After scenario like this:
And my Runner has the following options:
The thing is, the generated cucumber.json gives the error on the title of the issue. I dont get how can the json format wrong since is automatically generated. Am I missing something?
Error on the html report generated:
Cucumber.json file: