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

Add support for retries specified in each individual test (as opposed to global config) #311

Open
svegalopez opened this issue Jan 12, 2023 · 1 comment

Comments

@svegalopez
Copy link

svegalopez commented Jan 12, 2023

Hi @bahmutov,

I was wondering if this is something that could be useful ? If so I can open a PR.
I noticed the plugin reads the retries configuration when it is first imported (in this line)

Let's say that I have the retries set to 2 in the global cypress.config.js but I want to change that for a specific test.
So I do this :

it('dummy', { retries: 3 }, () => {
  // ... some commands ...
})

I think the retries setting of 3 will not be honoured given the place where the plugin reads it, am I correct ?
If so, I was wondering if this could help instead :

// inside of onFailed function

if (this.currentTest.final) {
    const filepath = writeFailedTestInfo(info)
    debug('saving the log file %s', filepath)
    info.filepath = filepath
  }

If the final property is not available in older versions of cypress (not sure), then maybe the plugin could fallback to reading the Cypress.config('retries') ad-hoc, inside the onFailed function as opposed to once at the beginning ?

Let me know if this is something you would be open to ?

@bahmutov
Copy link
Owner

bahmutov commented Jan 12, 2023 via email

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

Successfully merging a pull request may close this issue.

2 participants