Skip to content

fix(playwright): make qase.step expectedResult and data optional#982

Merged
gibiw merged 2 commits into
mainfrom
fix/playwright-qase-step-optional-params
Jul 1, 2026
Merged

fix(playwright): make qase.step expectedResult and data optional#982
gibiw merged 2 commits into
mainfrom
fix/playwright-qase-step-optional-params

Conversation

@gibiw

@gibiw gibiw commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #981.

qase.step in playwright-qase-reporter typed expectedResult and data as string | undefined but positionally required them. This meant the documented callback-free calls did not compile:

qase.step('action')                  // ts(2554): Expected 3 arguments, but got 1
qase.step('action', 'expected')      // ts(2554): Expected 3 arguments, but got 2

Callers were forced to pass undefined explicitly to omit optional arguments.

Changes

  • Mark expectedResult and data as optional (?) in the qase.step signature. Body logic is unchanged — fully backward compatible (existing 3-argument calls and calls passing undefined still work identically).
  • Clarify the docstring: qase.step is a title decorator meant to be passed to Playwright's test.step(), not a step runner. Added a one-argument example.
  • Add tests for the one- and two-argument forms that previously failed to type-check.

Scope

This PR covers only the type fix (requests #1 partially and #2 from the issue). The ergonomic callback overload (qase.step(title, callback), request #3) and the external docs update on developers.qase.io are out of scope for this change.

Verification

  • npm run build — 0 errors; generated dist/playwright.d.ts now shows step(action: string, expectedResult?: string, data?: string): string
  • npm test — 101 passed (2 new)
  • npm run lint — 0 errors

gibiw added 2 commits July 1, 2026 10:15
The qase.step signature typed expectedResult and data as
string | undefined but positionally required, forcing callers to pass
undefined explicitly to omit them. Documented callback-free calls like
qase.step('action') failed to compile (ts2554).

Mark both parameters optional (?) so one- and two-argument calls
type-check. Behavior is unchanged and backward compatible. Also clarify
the docstring that qase.step is a title decorator, not a step runner.

Closes #981
Bump playwright-qase-reporter to 2.5.6 and add changelog entry for the
qase.step optional-parameters type fix.
@gibiw gibiw merged commit d77a157 into main Jul 1, 2026
52 checks passed
@gibiw gibiw deleted the fix/playwright-qase-step-optional-params branch July 1, 2026 07:43
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 this pull request may close these issues.

qase.step() API doesn't match documentation, and documented callback-style usage fails to compile

1 participant