scout_upload
Uploads a file to a page's file input or chooser control, using a generated fixture or real file, and reports accept mismatches, cleared fields, and missing state-changing requests.
Instructions
Attach a file to an upload control the way a user does. ref is either a visible (snapshots list these with role file) or the button/label/dropzone that opens the file chooser — the chooser is intercepted and answered, which is how the hidden input behind a styled 'Choose file' control is reached. Omit ref to target the page's only file input, hidden or not (snapshots disclose hidden ones on a FILE INPUTS line). Nothing needs to exist on disk: a small VALID fixture (real PDF/PNG structure) is generated in memory, its kind inferred from the input's accept attribute or chosen with fixture; filePath uploads a real file but must live inside the attached project (fenced like navigation is fenced to the origin); name overrides the filename for boundary tests (wrong extension vs accept, very long, unicode). The result names the input, how the file reached it, flags a file that violates accept (a mismatch the app then accepts is a validation finding), warns if the app cleared the input after selection, and says whether a state-changing request fired on selection — if none did, click the form's submit, or check the next snapshot for a client-side rejection.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ref | No | Element ref of the file input OR of the control that opens the file chooser; omit when the page has exactly one file input | |
| name | No | Filename override (default scenescout-fixture.<kind>, or the disk file's own name) | |
| fixture | No | Generated fixture kind; default: inferred from the input's accept attribute (pdf when there is none, or none we can generate) | |
| session | No | Target this session directly instead of the active one — pass it explicitly when dispatching to MULTIPLE sessions in one turn (e.g. two scout_click calls with different `session`), which then run CONCURRENTLY rather than queueing. Omit for single-session sequential use. | |
| filePath | No | A real file to upload — absolute or relative to the project; must be inside the attached project. Exclusive with fixture. |