Skip to content

fix: retryFailedStep plugin works in debug/verbose mode - #5128

Open
mirao wants to merge 1 commit into
codeceptjs:4.xfrom
mirao:fix-retry-failed-step-debug-mode
Open

fix: retryFailedStep plugin works in debug/verbose mode#5128
mirao wants to merge 1 commit into
codeceptjs:4.xfrom
mirao:fix-retry-failed-step-debug-mode

Conversation

@mirao

@mirao mirao commented Sep 2, 2025

Copy link
Copy Markdown
Contributor

Fixed by VSCode Copilot with Claude Sonnet 4.

Personally I checked that the added unit test fails as expected before the fix.

Motivation/Description of the PR

  • Remove debugMode check that prevented retries when --verbose or --debug flags are used
  • Add regression test to ensure retries work correctly in debug mode
  • Resolves issue where plugin was disabled in debug mode without clear reason

Fixes #4384

Applicable helpers:

  • Playwright
  • Puppeteer
  • WebDriver
  • REST
  • FileHelper
  • Appium
  • TestCafe

Applicable plugins:

  • allure
  • autoDelay
  • autoLogin
  • customLocator
  • pauseOnFail
  • coverage
  • retryFailedStep
  • screenshotOnFail
  • selenoid
  • stepByStepReport
  • stepTimeout
  • wdio
  • subtitles

Type of change

  • 🔥 Breaking changes
  • 🚀 New functionality
  • 🐛 Bug fix
  • 🧹 Chore
  • 📋 Documentation changes/updates
  • ♨️ Hot fix
  • 🔨 Markdown files fix - not related to source code
  • 💅 Polish code

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)

Comment thread lib/plugin/enhancedRetryFailedStep.js Outdated

const when = err => {
if (!enableRetry) return false
if (store.debugMode) return false

@mirao mirao Sep 2, 2025

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if the fix is needed here too, because enhancedRetryFailedStep plugin seems the quite hot new feature: #5103

@kobenguyent
kobenguyent requested a review from Copilot September 23, 2025 08:53

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes a bug where the retryFailedStep and enhancedRetryFailedStep plugins were disabled when running CodeceptJS with --verbose or --debug flags. The fix removes the debugMode check that prevented retries from working in debug mode.

  • Removes if (store.debugMode) return false check from both retry plugins
  • Adds regression test to verify retries work correctly when debugMode is enabled
  • Ensures retry functionality is available regardless of debug/verbose mode settings

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
lib/plugin/retryFailedStep.js Removes debugMode check that blocked retries in debug mode
lib/plugin/enhancedRetryFailedStep.js Removes debugMode check that blocked retries in debug mode
test/unit/plugin/retryFailedStep_test.js Adds regression test to ensure retries work in debug mode

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

- Remove debugMode check that prevented retries when --verbose or --debug flags are used
- Add regression test to ensure retries work correctly in debug mode
- Resolves issue where plugin was disabled in debug mode without clear reason

Fixes codeceptjs#4384

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@mirao
mirao force-pushed the fix-retry-failed-step-debug-mode branch from f5cc169 to c156f79 Compare September 11, 2026 07:02
@mirao

mirao commented Sep 11, 2026

Copy link
Copy Markdown
Contributor Author

@kobenguyent @DavertMik
Please review it.

The issue was already reported (and PR created) in 3.x and I today I solved conflicts with 4.x:
image
The issue is present in 4.x too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Plugin "retryFailedStep" doesn't work in --debug or --verbose mode, searching for element fails immediately

3 participants