Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Console output reporting all examples as failed after 1st failed example #1224

Closed
lnm2 opened this issue Apr 26, 2018 · 2 comments
Closed

Console output reporting all examples as failed after 1st failed example #1224

lnm2 opened this issue Apr 26, 2018 · 2 comments

Comments

@lnm2
Copy link

lnm2 commented Apr 26, 2018

If you have a scenario outline with multiple examples, the console output will report test passed for each successful example untill it reaches the first example which fails and then the console output says failed.

This is expected. But after that, each example is reported as failed after it executes even if it is successful.

The serenity report is displaying the results correctly/with no problems.

<serenity.version>1.9.10
<serenity.cucumber.version>1.9.5

@wakaleo
Copy link
Member

wakaleo commented Apr 26, 2018

Thanks for raising this. I suspect that in this case Serenity is logging the overall result rather than the individual results. If you would like to have a go at troubleshooting, the class in question is ConsoleLoggingListener.

@lnm2
Copy link
Author

lnm2 commented Apr 27, 2018

Here is the feature file:

Feature: Login and Authentication

Background:

Given I navigate to the login page 

@yyy
Scenario Outline: Login test with valid credentials

When I am logged on with the username <username> and password <password> 
Then I will be directed to the home page 
And I log out 

Examples: 
	| username  	| password |
	| User1			| Password1|
	| User2			| Password2|
	| User3			| Password3|		

Example 1 and 3 are setup to pass and example 2 is setup to fail

Here is the console output.
Every example following the first failed one references the failed one.

[main] INFO net.serenitybdd.core.Serenity -


 _______. _______ .______       _______ .__   __.  __  .___________.____    ____ 
/       ||   ____||   _  \     |   ____||  \ |  | |  | |           |\   \  /   / 

| (----| |__ | |_) | | |__ | \| | | | ---| |----\ \/ / \ \ | __| | / | __| | . | | | | | _ /
.----) | | |
___ | |\ ----.| |____ | |\ | | | | | | |
|/ ||| | `._____||_____||__| _| || || |__|

News and tutorials at http://www.serenity-bdd.info
Documentation at https://wakaleo.gitbooks.io/the-serenity-book/content/
Join the Serenity Community on Rocket Chat at https://serenity-bdd.rocket.chat
Serenity BDD Support and Training at http://serenity-bdd.info/#/trainingandsupport
Learn Serenity BDD online at http://serenity-dojo.com
----------------------------------------------7
[main] INFO net.serenitybdd.core.Serenity - Test Suite Started: Login and Authentication
[main] INFO net.serenitybdd.core.Serenity -


|_ | / | _| / | |/ \ | _ _ | | _ \
| | | | _
\ | | _
\ | | / _ \ | |
) || | | | | | | |
| | | |
) || | ) || |/ ___ | _ < | | | || || |
|
| |
|
/ |
| |/ |// __| _|| |_____|___/

TEST STARTED: Login test with valid credentials
-------------------------------------------------------------------(login-and-authentication;login-test-with-valid-credentials)
Started InternetExplorerDriver server (32-bit)
2.53.1.0
Listening on port 45852
Only local connections are allowed
Apr 27, 2018 10:32:23 AM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected dialect: OSS
[main] INFO net.serenitybdd.core.Serenity -
__ _____ _____ ____ _____ ____ _ ____ ____ _____ ____
_ \ \ |_ | / | | | _ \ / \ / |/ || ___| _ \
(
)
| | | | | | _
\ | | | |
) / _ \ _ \
| | | | | |
|__| | | | | | ) || | | / ___ \ ) |) | || || |
(
) | | |
| |_____|
/ || || // __/|/|_____|__/
/
/

TEST PASSED: Login test with valid credentials

[main] INFO net.serenitybdd.core.Serenity -
__ _____ _____ ____ _____ ____ _ ____ ____ _____ ____
_ \ \ |_ | / | | | _ \ / \ / |/ || ___| _ \
(
)
| | | | | | _
\ | | | |
) / _ \ _ \
| | | | | |
|__| | | | | | ) || | | / ___ \ ) |) | || || |
(
) | | |
| |_____|
/ || || // __/|/|_____|__/
/
/

TEST PASSED: Login test with valid credentials

[main] ERROR net.serenitybdd.core.Serenity -
__ _____ _____ ____ _____ _____ _ ___ _ _____ ____
_ / / |_ | / | _| | / \ | _| | | ___| _ \
(
)
| | | | | | _ \ | | | |
/ _ \ | || | | | | | | |
|| | | | | | ) || | | / ___ \ | || || || || |
(
) | | |
| |_____|
/ || ||// __||__|____/
_\

TEST FAILED: Login test with valid credentials

[main] ERROR net.serenitybdd.core.Serenity - TEST FAILED AT STEP Logged on with credentials: User2, Password2
[main] ERROR net.serenitybdd.core.Serenity - The home page did not appear as expected.
[main] ERROR net.serenitybdd.core.Serenity -
__ _____ _____ ____ _____ _____ _ ___ _ _____ ____
_ / / |_ | / | _| | / \ | _| | | ___| _ \
(
)
| | | | | | _ \ | | | |
/ _ \ | || | | | | | | |
|| | | | | | ) || | | / ___ \ | || || || || |
(
) | | |
| |_____|
/ || ||// __||__|____/
_\

TEST FAILED: Login test with valid credentials

[main] ERROR net.serenitybdd.core.Serenity - TEST FAILED AT STEP Logged on with credentials: User2, Password2
[main] ERROR net.serenitybdd.core.Serenity - The home page did not appear as expected.
[main] ERROR net.serenitybdd.core.Serenity -
__ _____ _____ ____ _____ _____ _ ___ _ _____ ____
_ / / |_ | / | _| | / \ | _| | | ___| _ \
(
)
| | | | | | _ \ | | | |
/ _ \ | || | | | | | | |
|| | | | | | ) || | | / ___ \ | || || || || |
(
) | | |
| |_____|
/ || ||// __||__|____/
_\

TEST FAILED: Login test with valid credentials

[main] ERROR net.serenitybdd.core.Serenity - TEST FAILED AT STEP Logged on with credentials: User2, Password2
[main] ERROR net.serenitybdd.core.Serenity - The home page did not appear as expected.
[main] ERROR net.serenitybdd.core.Serenity -
__ _____ _____ ____ _____ _____ _ ___ _ _____ ____
_ / / |_ | / | _| | / \ | _| | | ___| _ \
(
)
| | | | | | _ \ | | | |
/ _ \ | || | | | | | | |
|| | | | | | ) || | | / ___ \ | || || || || |
(
) | | |
| |_____|
/ || ||// __||__|____/
_\

TEST FAILED: Login test with valid credentials

[main] ERROR net.serenitybdd.core.Serenity - TEST FAILED AT STEP Logged on with credentials: User2, Password2
[main] ERROR net.serenitybdd.core.Serenity - The home page did not appear as expected.

Failed scenarios:
src/test/resources/features/Login.feature:16 # Login test with valid credentials

3 Scenarios (1 failed, 2 passed)

@wakaleo wakaleo closed this as completed Feb 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants