feat: Within() with begin/end pattern by DavertMik · Pull Request #5481 · codeceptjs/CodeceptJS

@DavertMik changed the base branch from 3.x to 4.x

March 8, 2026 01:59

DenysKuchma

DavertMik and others added 3 commits

March 26, 2026 22:39
Add Within() function with three signatures:
- Within(locator) to begin scoped context
- Within() to end current context
- Within(locator, fn) callback pattern (existing behavior)

Lowercase within() kept as deprecated alias with one-time warning.
switchTo() in helpers auto-ends any active Within context.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ner test

Add back @param/@return JSDoc annotations on the deprecated within()
wrapper so jsdoc generates the TypeScript definition (fixes dtslint).

Filter [deprecated] lines in within runner test so the deprecation
warning doesn't break step order assertion.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ontext control

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

@claude

…text

Addresses review feedback from DenysKuchma.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>