Version
1.60.0
Steps to reproduce
- Run playwright codegen.
- Open page which includes element.
- Click and select file(s).
- Run generated code.
Expected behavior
Only the line that executes setInputFiles() on the element will be generated.
Alternatively,
executing setInputFiles() will close the file selection dialog.
Actual behavior
Codegen generates lines that execute click() and setInputFiles() for the <input type="file"> element.
However, since setInputFiles() selects a file without needing click(), click() is unnecessary.
Furthermore, the file selection dialog opened by executing click() remains open even after selecting a file by executing setInputFiles().
Additional context
No response
Environment
System:
OS: Windows 11 10.0.26100
CPU: (16) x64 Intel(R) Core(TM) i7-10700 CPU @ 2.90GHz
Memory: 17.80 GB / 31.78 GB
Binaries:
Node: 22.20.0 - C:\Program Files\nodejs\node.EXE
npm: 11.7.0 - C:\Program Files\nodejs\npm.CMD
IDEs:
VSCode: 1.120.0 - C:\Users\10383037\AppData\Local\Programs\Microsoft VS Code\bin\code.CMD
npmPackages:
@playwright/test: ^1.60.0 => 1.60.0
Version
1.60.0
Steps to reproduce
Expected behavior
Only the line that executes setInputFiles() on the element will be generated.
Alternatively,
executing setInputFiles() will close the file selection dialog.
Actual behavior
Codegen generates lines that execute
click()andsetInputFiles()for the<input type="file">element.However, since
setInputFiles()selects a file without needingclick(),click()is unnecessary.Furthermore, the file selection dialog opened by executing
click()remains open even after selecting a file by executingsetInputFiles().Additional context
No response
Environment
System: OS: Windows 11 10.0.26100 CPU: (16) x64 Intel(R) Core(TM) i7-10700 CPU @ 2.90GHz Memory: 17.80 GB / 31.78 GB Binaries: Node: 22.20.0 - C:\Program Files\nodejs\node.EXE npm: 11.7.0 - C:\Program Files\nodejs\npm.CMD IDEs: VSCode: 1.120.0 - C:\Users\10383037\AppData\Local\Programs\Microsoft VS Code\bin\code.CMD npmPackages: @playwright/test: ^1.60.0 => 1.60.0