serenity-bdd / serenity-core

Serenity BDD is a test automation library designed to make writing automated acceptance tests easier, and more fun.
http://serenity-bdd.info
Other
720 stars 519 forks source link

Serenity + cucumber how to rerun failed tests #1476

Closed AndriySinchuk closed 2 years ago

AndriySinchuk commented 5 years ago

Is there are any possibility to automatically rerun failed cucumber scenarios?
I use serenity core 2.0.11, serenity-cucumber 1.9.18,

Jacobvu84 commented 5 years ago

Should to try with this . Rerun Failed Tests in JUnit

wakaleo commented 5 years ago

No, that won’t work. The feature exists, but I need to write it up

AndriySinchuk commented 5 years ago

And how much time approximately need to implement this functionality? It`s really important feature because i have a task to automatically create tasks in jira with failed tests and without rerurns some number of false tasks will be created, and my suite is too large and complicated to painfully rewrite it without cucumber. Btw tasks in jira are generated when report is aggregated?

AndriySinchuk commented 5 years ago

Should to try with this . Rerun Failed Tests in JUnit

Thank you for reply, i tried this approach before and it unable to rerun failed cucumber scenarios.

wakaleo commented 5 years ago

@AndriySinchuk if you need this quickly please raise a support ticket to allow it to be taken care of as a priority. (see https://johnfergusonsmart.com/serenity-bdd-mentoring#support)

william0096 commented 5 years ago

Any answer on this??? I'm actually using the following command with maven "mvn verify -Dfailsafe.rerunFailingTestsCount=2", and it works properly, but I still have the issue with gradle, did someone solve it?

ssuriset1 commented 4 years ago

@william0096 Could you please let us know the exact steps to implement this?

miroslaf commented 4 years ago

@wakaleo any progress? I am currently trying to get tests to rerun but with no success as any documented option work..

Swetha-pa commented 4 years ago

can someone suggest how to rerun failed stories in serenity jbehave

wakaleo commented 4 years ago

This feature exists in Cucumber but I don’t think it exists in JBehave

ssuriset1 commented 4 years ago

Hi John,

Can you help me with how to rerun failed scenarios in serenity cucumber?

On Tue, Jun 9, 2020 at 3:59 PM John Ferguson Smart notifications@github.com wrote:

This feature exists in Cucumber but I don’t think it exists in JBehave

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/serenity-bdd/serenity-core/issues/1476#issuecomment-641198040, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKH674572AYLH4OTHZ4VEN3RVYFJZANCNFSM4GIDABKA .

wakaleo commented 4 years ago

It's a standard Cucumber feature; see for example https://www.qaautomation.co.in/2019/01/re-running-failed-scenarios-in-cucumber-junit.html

ssuriset1 commented 4 years ago

Hi John,

In my framework, I am generating runner classes at runtime to achieve parallel execution. In this case, how can I run the failed scenarios automatically?

Ex: pom.xml

Under this "src/test/resources/features/LM" I have multiple feature files.

Using this plugin, I am managing the fork count at runtime.

=====================================================================

org.apache.maven.plugins maven-surefire-plugin 2.21.0 ${forkCount} true **/*IT.class

=====================================================================

ui_lm com.github.temyers cucumber-jvm-parallel-plugin 4.2.0 generateRunners generate-test-sources generateRunners com.qa.stepDefinitions target/generated-test-sources/cucumber src/test/resources/features/LM target/cucumber-parallel Parallel{c}IT FEATURE src/test/resources/cucumber-serenity-runner.vm

========================================================================

This is my "cucumber-serenity-runner.vm" file.

parse("/array.java.vm")

if ($packageName)

package $packageName;

end

import org.junit.runner.RunWith;

import cucumber.api.CucumberOptions; import net.serenitybdd.cucumber.CucumberWithSerenity;

@RunWith(CucumberWithSerenity.class) @CucumberOptions( strict = true, features = {"$featureFile"}, plugin = #stringArray($plugins), monochrome = true,

if(!$featureFile.contains(".feature:") && $tags)

tags = #stringArray($tags),

end

glue = #stringArray($glue)) public class $className { }

Please help me.

On Tue, Jun 9, 2020 at 4:16 PM John Ferguson Smart notifications@github.com wrote:

It's a standard Cucumber feature; see for example https://www.qaautomation.co.in/2019/01/re-running-failed-scenarios-in-cucumber-junit.html

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/serenity-bdd/serenity-core/issues/1476#issuecomment-641206956, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKH6747ZUXA46IMUPFE35HTRVYHJLANCNFSM4GIDABKA .