mirror of
https://github.com/priyanshujain/sanderling.git
synced 2026-10-04 12:07:09 +00:00
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:
1 parent
6009adac48
commit
29ec13adcd
5 files changed
+64
-3
No files matched your search
@@ -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 {
|
||||
|
||||
Reference in new issue
Block a user