Note: There are a few cases of duplicates in user autocompletion which are being worked on.

Need a function to clear a textbox

RESOLVED WONTFIX

Status

Testing Graveyard
Mozmill
--
enhancement
RESOLVED WONTFIX
7 years ago
11 months ago

People

(Reporter: Marc-Aurèle DARCHE, Unassigned)

Tracking

Details

(Whiteboard: [MozMillAddonTestday][mozmill-2.0-], URL)

(Reporter)

Description

7 years ago
User-Agent:       Mozilla/5.0 (X11; U; Linux i686; fr; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3
Build Identifier: 

A new method in the Mozmill Controller Object to blank a textbox, without having to use the controller keypress method with 'VK_BACK_SPACE' for each letter, would be much welcome.

The keypress method is effective only on the input of the textfield element, which is impossible to get through the element id, one has to resort to use a mochi path. That's why this new blanking method should be given the textfield element, just like the type method.

Reproducible: Always
This function could do the following:

keypress: select all
keypress: delete
Status: UNCONFIRMED → NEW
Ever confirmed: true
Summary: Add a Textbox blanking method in the Mozmill Controller Object → Need a function to clear a textbox
Whiteboard: [MozMillAddonTestday]
Whiteboard: [MozMillAddonTestday] → [MozMillAddonTestday][good first bug]
I'm not sure if this is worthy of a new controller method.  Maybe we can pass in an optional flag to the type method which tells it to either append to the text box or overwrite it.

So you could do:
controller.type(textbox, '', true)

to clear it.
Whiteboard: [MozMillAddonTestday][good first bug] → [MozMillAddonTestday][good first bug][mozmill-2.0?]
I would more tend to say a wontfix. If you want to work on an empty textbox, clear it first. I don't see a reason to bundle that into type(). With our refactoring of the shared modules it will also be much clearer.

Comment 4

7 years ago
wontfix per comment 3, which I agree with.
Status: NEW → RESOLVED
Last Resolved: 7 years ago
Resolution: --- → WONTFIX
Whiteboard: [MozMillAddonTestday][good first bug][mozmill-2.0?] → [MozMillAddonTestday][mozmill-2.0-]
(Reporter)

Comment 5

6 years ago
We can't expect developers to come up with the following code which is not straightforward at all:

  var utils = require('../../../../lib/utils');
  var select_all_key = utils.getEntity(['chrome://browser/locale/browser.dtd'],
      'selectAllCmd.key');
  controller.keypress(elem, select_all_key, { accelKey: true });
  controller.keypress(elem, 'VK_DELETE', {});

The fact that this code is used in tests/addons/ide@seleniumhq.org/lib/selenium.js through the "clearBaseURLField" method as well as in the fidesfit-client extension advocates for its factoring out.

So reopening.

Could we add this method in mozmill-tests/lib/utils.js please?
Status: RESOLVED → REOPENED
Resolution: WONTFIX → ---
(Reporter)

Comment 6

6 years ago
(In reply to comment #5)
> 
> Could we add this method in mozmill-tests/lib/utils.js please?

I will gladly provide a patch once I have your agreement on the interest of such a method.

Thank you
Mozmill will reach its end of life soon. We are currently working on getting all the tests for Firefox ported to Marionette. For status updates please see bug 1080766.
Status: REOPENED → RESOLVED
Last Resolved: 7 years ago3 years ago
Resolution: --- → WONTFIX
(Assignee)

Updated

11 months ago
Product: Testing → Testing Graveyard
You need to log in before you can comment on or make changes to this bug.