Skip to content

setFilesToUpload not raising change event on Linux/Chrome? #2007

@dahu33

Description

@dahu33

Since testcafe v1.1.3 our tests are failing on Linux/Chrome while they are passing on Linux/Firefox or MacOS/Chrome. Manual testing also works fine on Linux/Chrome.

It seems that on Linux/Chrome the change event is fired only for the first call to setFilesToUpload. Any subsequent call to setFilesToUpload (even with a different filePath) don't seem to be firing the change event.

It feels this issue could be related or even was introduced with #1844.

Our frontend code looks like this (Vue.js):

<input
id="file-upload"
ref="file"
class="uploader"
type="file"
accept=".txt"
@change="handleFileUpload"
>

Our test code looks like this:

let files = [
  'file1.txt',
  'file2.txt',
  'file3.txt',
];

for (let i = 0; i < files.length; i += 1) {
    await t.setFilesToUpload(Selector('#file-upload'), files[i]);
}

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions