Closed Bug 1486485 Opened 2 years ago Closed 2 years ago

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

Categories

(Testing :: Marionette, enhancement, P2)

Version 3
enhancement

Tracking

(firefox63 fixed)

RESOLVED FIXED
mozilla63
Tracking Status
firefox63 --- fixed

People

(Reporter: whimboo, Assigned: whimboo)

References

(Blocks 1 open bug, )

Details

Attachments

(2 files)

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+
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.
https://hg.mozilla.org/mozilla-central/rev/f3ea8e988254
https://hg.mozilla.org/mozilla-central/rev/82dc592c7293
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla63
You need to log in before you can comment on or make changes to this bug.