codeceptjs / CodeceptJS

Supercharged End 2 End Testing Framework for NodeJS
http://codecept.io
MIT License
4.11k stars 724 forks source link

dynamic configs ignored for test retries #1809

Open cviejo opened 5 years ago

cviejo commented 5 years ago

What are you trying to achieve?

Dynamic configs applied to retries as well

What do you get instead?

Dynamic configs are ignored for retries after a test fails

Feature('test');

Scenario('test', I => {
   I.amOnPage('http://github.com');
   I.waitInUrl('fail');
})
   .retry(1)
   .config({ show: true }); // will be ignored for the second run

Details

cviejo commented 5 years ago

Just looked into this, mocha creates a copy of the test object for each retry, so the configs set here are lost, or at least not copied to the new object. Can't find a quick and clean solution for this. Feature().retry().config() works however so for now i'd organize the tests differently