serenity-bdd / serenity-cucumber-starter

A skeleton project for Serenity BDD and Cucumber JVM
Apache License 2.0
180 stars 285 forks source link

Serenity Run using Cucumber Tags - Serenity Run Console indicates tests for ALL TAGS executed even when Single TAG is executed (Serenity Reports as expected) #54

Closed TarahMo closed 3 years ago

TarahMo commented 3 years ago

Hi John @wakaleo

I am noticing a strange behavior during build run-time within Serenity Console Run when running Serenity Tests using Cucumber Tags.

I have 6 Scenarios in the Feature File each with different Tags. When I run the project using Maven run configuration for a specific TAG e.g. for "GETSERVICES" TAG (for the highlighted scenario in the attached files), observations highlighted under 1) & 2) below.

1) When the build execution starts - I find it ambiguous looking at the Serenity Run Console as it indicates 6 TESTS Executed & 6 TESTS Passed. I have used log().all() in the REST Assured code which is logging the request & response and I can see ALL 6 API's have been executed.

2) Build is successful (Process finished with exit code 0 & BUILD SUCCESS) and when I look at "Serenity Summary Emailable Report" & "Index.HTML Report" -> as expected, I see ONLY 1 TEST (based on the TAG provided) executed & PASSED.

Therefore I am confused why Serenity Run Console indicates 6 TESTS Executed & 6 TESTS Passed & it actually does and I see GET & POST responses for ALL 6 API's in the console logs.

I have attached a few screen prints for the following files & have attached the Full Console Log as well.

Please can you advise what may be the reason for the above behavior?

Attached screen prints & logs for the following:

i) Serenity Run - Console Logs ii) Serenity Run Logs iii) Feature File iv) Serenity Runner File v) Maven Run Configuration vi) Index.html Report vii) serenity-summary.html (Serenity Summary Emailable Report) viii) POM.XML Maven Failsafe Plugin ix) POM.XML (full)

Feature File

Serenity Runner File

Serenity Run - Console Logs.txt

POM XML.txt

Serenity Run Logs

Serenity Summary Emailable Report

Index HTML Report

Maven Run Configuration

POM XML Maven Failsafe Plugin

wakaleo commented 3 years ago

Looks like a bug.

TarahMo commented 3 years ago

Hi John @wakaleo

do you mean a bug in serenity using cucumber with tags? I have spent quite a lot of time looking at the pom & my code & the serenity documentation though everything looks alright to me. I have also added 'serenity.exclude.unrelated.requirements.of.type = capabilities' under serenity.conf but that didn't resolve the issue.

Do you mind taking a quick look at the screenshots I attached above if you see anything that's not right?

wakaleo commented 3 years ago

Probably a bug in the Serenity code.

TarahMo commented 3 years ago

Can we probably clock/register it somewhere?

TarahMo commented 3 years ago

@wakaleo - Can I provide a project that reproduces this behaviour?

wakaleo commented 3 years ago

Yes, but raise this issue on https://github.com/serenity-bdd/serenity-core rather than here.

TarahMo commented 3 years ago

Sure John. I have created the above issue under serenity-core and shared the project details. Closing this issue here.