fix(driver): skip pre-erase for replace-on-input drivers

The web driver's InputText already replaces content via select-all, so
the runner's unconditional EraseText was a redundant round-trip on
every InputText. A new optional TextReplacer capability lets a driver
assert replace semantics; the runner skips the erase when asserted.
This commit is contained in:
pj committed 2026-06-06 00:35:13 +05:30
1 parent 6009adac48
commit 29ec13adcd
5 files changed
+64 -3

No files matched your search

+6
View File
@@ -193,6 +193,12 @@ func (d *Driver) InputText(_ context.Context, text string) error {
)
}
// ReplacesTextOnInput reports that InputText replaces existing content via
// select-all, so the runner skips its pre-erase.
func (d *Driver) ReplacesTextOnInput() bool {
return true
}
// EraseText clears the focused field. InputText above already replaces via
// select-all, so the character count is not needed to bound the deletion.
func (d *Driver) EraseText(_ context.Context, _ int) error {