fix(playwright): make qase.step expectedResult and data optional#982
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #981.
qase.stepinplaywright-qase-reportertypedexpectedResultanddataasstring | undefinedbut positionally required them. This meant the documented callback-free calls did not compile:Callers were forced to pass
undefinedexplicitly to omit optional arguments.Changes
expectedResultanddataas optional (?) in theqase.stepsignature. Body logic is unchanged — fully backward compatible (existing 3-argument calls and calls passingundefinedstill work identically).qase.stepis a title decorator meant to be passed to Playwright'stest.step(), not a step runner. Added a one-argument example.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; generateddist/playwright.d.tsnow showsstep(action: string, expectedResult?: string, data?: string): stringnpm test— 101 passed (2 new)npm run lint— 0 errors