"Send Alert Text" doesn't replace default user prompt value if text is an empty string

RESOLVED FIXED in Firefox 63

Status

enhancement
P2
normal
RESOLVED FIXED
9 months ago
9 months ago

People

(Reporter: whimboo, Assigned: whimboo)

Tracking

(Blocks 1 bug)

Version 3
mozilla63
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox63 fixed)

Details

()

Attachments

(2 attachments)

Because we only type when keys exist the default value will remain, and it is not possible to clear it.

To make this possible the input field needs to be cleared first.
Here the WebDriver spec definition of setting the text:

> Perform user agent dependent steps to set the value of current user prompt’s text field to text.

As such internally Marionette uses `interaction.sendKeysToElement()` similar to the `Element Send Keys` command. Hereby the latter command doesn't replace the content, but concatenates the given `text` at the end.
The patch refactors the test file, and also adds an additional test,
which makes sure that the default text of the prompt is replaced in
case of an empty string is send as text.
Attachment #9004245 - Flags: review?(james)
Attachment #9004246 - Flags: review?(james)
Attachment #9004245 - Flags: review?(james) → review+
Attachment #9004246 - Flags: review?(james) → review+

Comment 5

9 months ago
Pushed by hskupin@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/f3ea8e988254
[marionette] Replace and not append text for "WebDriver:SendAlertText". r=jgraham
https://hg.mozilla.org/integration/mozilla-inbound/rev/82dc592c7293
[wdspec] Add test for empty text to send_alert_text/send.py. r=jgraham
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/12735 for changes under testing/web-platform/tests
Upstream web-platform-tests status checks passed, PR will merge once commit reaches central.

Comment 8

9 months ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/f3ea8e988254
https://hg.mozilla.org/mozilla-central/rev/82dc592c7293
Status: ASSIGNED → RESOLVED
Last Resolved: 9 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla63
Upstream PR merged
You need to log in before you can comment on or make changes to this bug.