Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion lib/plugin/enhancedRetryFailedStep.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ module.exports = config => {

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

@mirao mirao Sep 2, 2025

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

if (!store.autoRetries) return false
if (customWhen) return customWhen(err)
return true
Expand Down
1 change: 0 additions & 1 deletion lib/plugin/retryFailedStep.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ module.exports = config => {

const when = err => {
if (!enableRetry) return
if (store.debugMode) return false
if (!store.autoRetries) return false
if (customWhen) return customWhen(err)
return true
Expand Down
35 changes: 35 additions & 0 deletions test/unit/plugin/retryFailedStep_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -280,4 +280,39 @@ describe('retryFailedStep', () => {
expect(counter).to.equal(1)
expect(res).to.equal(false)
})

it('should retry failed step when debugMode is enabled', async () => {
// This test ensures that the retryFailedStep plugin works correctly
// when store.debugMode is true, which happens with --verbose or --debug flags
store.debugMode = true

try {
retryFailedStep({ retries: 3, minTimeout: 1 })
event.dispatcher.emit(event.test.before, createTest('test'))
event.dispatcher.emit(event.step.started, { name: 'seeElement' })

let counter = 0
await recorder.add(
() => {
counter++
if (counter < 4) {
throw new Error('Element not found')
}
return 'success'
},
undefined,
undefined,
true,
)

const result = await recorder.promise()

// Should retry 3 times and succeed on 4th attempt
expect(counter).to.equal(4)
expect(result).to.equal('success')
} finally {
// Reset to default value
store.debugMode = false
}
})
})