Report when error

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Report when error

hlopez
Hello when I ran a test it generated the following html report (wrong number of total test).


Integration Test Summary

Total
1

Skipped
0  |  0.0%

Failed
1  |  100.0%

Successful
0  |  0.0%


But in my console I see the following:

Tests run: 6, Failures: 1, Errors: 0, Skipped: 0

Using the Citrus version 2.7.3
Reply | Threaded
Open this post in threaded view
|

Re: Report when error

Christoph Deppisch
Administrator
Are you using Citrus Cucumber integration? Because Cucumber will report each step as successful test.
Reply | Threaded
Open this post in threaded view
|

Re: Report when error

Christoph Deppisch
Administrator
Which report is wrong? Did you execute 1 test or 7?
Reply | Threaded
Open this post in threaded view
|

Re: Report when error

hlopez
Actually after fixing it and they passed it was 5 test. Don't know why it showed 6. But I only saw one error in the HTML report. Maybe something weird happened when generating the report?
Reply | Threaded
Open this post in threaded view
|

Re: Report when error

hlopez
This post was updated on .
Got the error again:
2018-01-24 22:06:22.022  INFO   --- [           main] c.consol.citrus.report.LoggingReporter   :  HomeControllerIT.testHome ...................................... SUCCESS
2018-01-24 22:06:22.022  INFO   --- [           main] c.consol.citrus.report.LoggingReporter   :  IgniteControllerIT.testCreate .................................. FAILED
2018-01-24 22:06:22.022  INFO   --- [           main] c.consol.citrus.report.LoggingReporter   :  FAILURE: Caused by: TestCaseFailedException: Failed to validate JSON text:
{"id":3001,"firstName":"Lindsey","lastName":"Craft","email":"isheadphones@ma1lbox.net","account":618284,"address":"869 Southard Blvd"} Values not equal for entry: 'id', expected '1' but was '3001'
2018-01-24 22:06:22.022  INFO   --- [           main] c.consol.citrus.report.LoggingReporter   :
2018-01-24 22:06:22.022  INFO   --- [           main] c.consol.citrus.report.LoggingReporter   : TOTAL: 2
2018-01-24 22:06:22.023  INFO   --- [           main] c.consol.citrus.report.LoggingReporter   : FAILED:        1 (50.0%)
2018-01-24 22:06:22.023  INFO   --- [           main] c.consol.citrus.report.LoggingReporter   : SUCCESS:       1 (50.0%)
2018-01-24 22:06:22.023  INFO   --- [           main] c.consol.citrus.report.LoggingReporter   :
2018-01-24 22:06:22.023  INFO   --- [           main] c.consol.citrus.report.LoggingReporter   : ------------------------------------------------------------------------
2018-01-24 22:06:22.049  INFO   --- [           main] com.consol.citrus.report.HtmlReporter    : Generated HTML test report: target\citrus-reports\citrus-test-results.html

...

Results :

Failed tests:
  IgniteControllerIT>TestNGCitrusTest.run:56->TestNGCitrusTest.run:110->TestNGCitrusTest.invokeTestMethod:149 ยป TestCaseFailed

Tests run: 6, Failures: 1, Errors: 0, Skipped: 4

[INFO]
[INFO] --- maven-failsafe-plugin:2.18.1:integration-test (integration-tests) @ citrus-integration ---
[INFO] Skipping execution of surefire because it has already been run for this configuration

---
Here is the HTML
---

Integration Test Summary

Total      2 
Skipped    0  |  0.0% 
Failed     1  |  50.0% 
Successful  1  |  50.0% 

Tests results (2 Tests)

HomeControllerIT.testHome    SUCCESS 
IgniteControllerIT.testCreate   FAILURE 
com.consol.citrus.exceptions.TestCaseFailedException: Failed to validate JSON text:
{"id":3001,"firstName":"Lindsey","lastName":"Craft","email":"isheadphones@ma1lbox.net","account":618284,"address":"869 Southard Blvd"} Values not equal for entry: 'id', expected '1' but was '3001'
	 at com.consol.citrus.TestCase.executeAction(TestCase.java:237)

In my code I have two Test Classes, 1st one has 1 test-method and 2nd one has 6 test-method of which 1 is disabled (enabled=false). So in total, I should have 7 test method of which 1 is disabled. (Not sure how he is handling that disabled one)

Actually, they both are wrong:
The console logging should give Tests run: 2, Failures: 1, Errors: 0, Skipped: 4 (or 5)

And the HTML (target/citrus-reports/citrus-test-results.html) is not showing the skipped one, but the rest seems good.

...
hmm just noticed I forgot to put @CitrusTest on one of the methods in the second Class.

Humphrey