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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: respect retries from retryfailedstep plugin in helpers #4028

Conversation

kobenguyent
Copy link
Collaborator

Motivation/Description of the PR

Currently inside the _before() of helpers for example Playwright, the retries is set there https://github.com/codeceptjs/CodeceptJS/blob/3.x/lib/helper/Playwright.js#L477, however, when retryFailedStep plugin is enabled, the retries of recorder is still using the value from _before() not the value from retryFailedStep plugin.

Fix:

  • introduce the process.env.FAILED_STEP_RETIRES which could be access everywhere as the helper won't know anything about the plugin.
  • set default retries of Playwright to 3 to be on the same page with Puppeteer.

Applicable helpers:

  • Playwright
  • Puppeteer

Applicable plugins:

  • retryFailedStep

Type of change

  • 馃悰 Bug fix

Checklist:

  • Tests have been added
  • Documentation has been added (Run npm run docs)
  • Lint checking (Run npm run lint)
  • Local tests are passed (Run npm test)

@kobenguyent kobenguyent linked an issue Nov 25, 2023 that may be closed by this pull request
@kobenguyent kobenguyent merged commit c286f42 into 3.x Nov 29, 2023
12 checks passed
@kobenguyent kobenguyent deleted the 3268-argument-retries-for-plugin-retryfailedstep-is-not-working branch November 29, 2023 06:16
@mirao
Copy link
Contributor

mirao commented Nov 29, 2023

@kobenguyent Did you mean FAILED_STEP_RETRIES instead of FAILED_STEP_RETIRES ?

@kobenguyent
Copy link
Collaborator Author

@kobenguyent Did you mean FAILED_STEP_RETRIES instead of FAILED_STEP_RETIRES ?

Thanks @mirao my typo!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants