Repository navigation
Conversation
I.click('a').first() selects a match without step.opts(), and overrides
strict mode like elementIndex does. Puppeteer forceClick now honours strict
mode and the selected index, matching the other helpers.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
WebDriver grabValueFromAll drops empty values, so the array comparison could not tell which field was filled. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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
Selects one match from a multi-element locator without
step.opts():This works because
recordSteponly queues the step, so a chained call runs before the step does and can setstep.opts.elementIndex. The chain overrides strict mode the same wayelementIndexdoes.step.opts()keeps working, so nothing breaks at runtime.Changes
lib/actor.js: adds the chain to the promise of every helper action. Calling it after the step has run throws an error.lib/helper/Puppeteer.js:forceClickhardcodedels[0], ignoring strict mode and the index. It now usesselectElement.CodeceptJS.StepPromise, returned by the actions that enforce strict mode.element-selection,locatorsandmigration-4now lead with the chain.Behaviour to review
Default typings: these actions now return
StepPromiseinstead ofvoid, so projects usingno-floating-promisesget warnings on unawaited calls.Actions that ignore the chain: it exists on every helper action but has no effect where selection isn't used:
amOnPageswitchTomoveCursorTo,focus,blur,scrollTo,forceRightClicksaveElementScreenshot,clickXYNone of these throw in strict mode on those helpers, so they are out of scope here.
Not available yet: custom steps and page object methods don't get the chain.
.timeout()and.retry()aren't included, because chaining them needs recorder changes.Testing
test/acceptance/element_selection_test.js. For each action it checks that the step throwsMultipleElementsFoundwithout the chain, passes with.first(), and rejects.at(100).withinandsessionpassed on Playwright.tsdlocally reports only the cross-fileConfigconflict errors, which don't appear on a fresh install.🤖 Generated with Claude Code