Page MenuHomePhabricator

Test multiple files into same input
Closed, DeclinedPublic

Description

Author: neilk

Description:
Summary: At the moment, it's impossible to write an automated test for multiple files into the same input. Neither Selenium nor Watir support this. However, this is a heavily used feature. So, this bug just a TODO for figuring it out some day, and some notes on why we can't now.

Background:

If you click on an "add file" button, UploadWizard can accept a single file, or multiple files. Very old browsers only accept single files.

The script will add one Upload, with a related UploadWizardUploadInterface object for every file. So a single file input might actually be related to multiple UWUIs on the screen, with an index.

How to test this?

For security reasons, browsers don't allow scripts to set the contents of file fields.

Our testing frameworks[1] have a workaround: it's possible to send keystrokes (sendKeys) to a form input element. While there is no human UI for this, most web browsers will accept keystroke events that "type out" the full path.

However, it seems there is no convention for sending multiple file paths to an input this way. The Selenium people have a bug for this issue[2].

[1] right now, Cucumber -> PageObject -> Watir -> Webdriver -> Selenium -> an actual web browser.

[2] https://code.google.com/p/selenium/issues/detail?id=2239


Version: unspecified
Severity: enhancement

Details

Reference
bz71397

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 3:46 AM
bzimport added a project: UploadWizard.
bzimport set Reference to bz71397.
bzimport added a subscriber: Unknown Object (MLST).
bzimport created this task.Sep 28 2014, 8:25 PM
Gilles triaged this task as Low priority.Nov 24 2014, 1:56 PM
Gilles added a subscriber: Gilles.
Jdforrester-WMF moved this task from Untriaged to Backlog on the Multimedia board.Sep 4 2015, 6:09 PM
Restricted Application added subscribers: Matanya, Aklapper. · View Herald TranscriptSep 4 2015, 6:09 PM
matmarex closed this task as Declined.Oct 27 2016, 12:07 AM
matmarex added a subscriber: matmarex.

We removed the browser tests this is about in 9bec2f4f3754eb70906a56204aaf4852d5e92c11, so I guess this is declined now.

Seeing all these browser tests being deleted, I assume that the new interface has equally complete integration testing coverage, right?

Also, giving UploadWizard a spin on Vagrant right now, I fail to see what is dramatically different about the steps and the interface that would have prevented existing tests from being adapted.

I took that conversation to T94161 since there was more context there about the tests deletion.