codeceptjs / codeceptjs/ui

_stringifyMetaStep crashes

Open
#685 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
84
Forks
30
PR merge metrics
No merged PRs in 30d

Description

When using the auth plugin with codecept-ui, tests fail with:

```
Cannot read properties of null (reading 'replace')
TypeError:
at RealtimeReporterHelper._stringifyMetaStep (node_modules/@codeceptjs/ui/lib/codeceptjs/realtime-reporter.helper.js:204:30)
at RealtimeReporterHelper._generateSection (node_modules/@codeceptjs/ui/lib/codeceptjs/realtime-reporter.helper.js:174:23)
```

Cause:
Line 204 in realtime-reporter.helper.js assumes metaStep.actor is always a string:
line = `${metaStep.actor.replace(/[\W_]+/g, '') || ''}-${metaStep.name.replace(/[\W_]+/g, '') || ''}...`

But when using the auth plugin's login function, metaStep.actor is null.

Versions:
- @codeceptjs/ui: 1.3.8
- codeceptjs: 3.7.6

Contributor guide

Open the contributing guide

Research direction

Start at node_modules/@codeceptjs/ui/lib/codeceptjs/realtime-reporter.helper.js:204 and inspect RealtimeReporterHelper._stringifyMetaStep, then reproduce the auth plugin login flow with @codeceptjs/ui 1.3.8 and codeceptjs 3.7.6. Done means codecept-ui no longer throws when metaStep.actor is null during _generateSection.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
testing-qa
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.