Skip to content

[Bug]: Flaky input.files.count on firefox after setInputFiles #29683

@MillerSvt

Description

@MillerSvt

Version

1.41.1

Steps to reproduce

Repo

  1. Run npm start

Expected behavior

the test always runs correctly

Actual behavior

the test always runs correctly only on local machine
In docker image test fails (with a probability of 20%) with error:

Error: expect(received).resolves.toBe(expected) // Object.is equality

Expected: 2
Received: 0

  22 |     ]);
  23 |
> 24 |     await expect(fileChangePromise).resolves.toBe(2);
     |                                              ^
  25 | });
  26 |

Additional context

Hi guys! In Firefox, an automated test scenario that involves setting files for an element intermittently fails to correctly reflect the number of files selected. Specifically, when listening for the change event on the file input and then checking the files.length property of the input, the test sometimes observes a value of 0 instead of the expected number of files that were programmatically set. This issue does not consistently reproduce but occurs often enough to significantly impact test reliability.

Environment

System:
    OS: macOS 14.3
    CPU: (10) arm64 Apple M1 Pro
    Memory: 1.25 GB / 32.00 GB
  Binaries:
    Node: 16.20.2 - ~/.nvm/versions/node/v16.20.2/bin/node
    npm: 8.19.4 - ~/.nvm/versions/node/v16.20.2/bin/npm
  Languages:
    Bash: 3.2.57 - /bin/bash
  npmPackages:
    @playwright/test: ^1.40.1 => 1.41.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions