CodeceptJS icon indicating copy to clipboard operation
CodeceptJS copied to clipboard

Gherkin retry on failed features and scenario

Open mayankchincholkar opened this issue 7 years ago • 1 comments

Retry failed scenario and feature in gherkin BDD format

What do you get instead?

Retry feature is present when using the spec implementation where we can actually do something like Feature('test something').retry(3);

Is it possible to use or have the similar feature in gherkin feature file, where we can retry the failed scenario or feature?

Details

  • CodeceptJS version: 2.0.6
  • NodeJS Version:10.14
  • Operating System:win 10
  • Protractor
  • Configuration file:

mayankchincholkar avatar Mar 06 '19 02:03 mayankchincholkar

There is https://codecept.io/bdd/#before (CodeceptJS 2.6.6) where in /step_definitions/steps.js I have the following:

Before((test) => {
  const retryCount = 3;
  test.retries(retryCount);
});

This works like a charm.
However, that same page suggests to use Fail(); with which works sort of.... Attempting to do something like Fail((test, error) => { console.log(test); console.log(error); }); only winds up crashing my framework due to Max Heap usage.
Using console.log(test) in other areas like Before() or After() works just fine.
I'm still troubleshooting but maybe that'll point you in a useful direction?

ryust-ax avatar Sep 02 '20 16:09 ryust-ax