scout_upload
Simulate a user attaching a file to an upload control, verify accept-attribute validation, and check whether selection triggers a state-changing request or client-side rejection.
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) | |
| task | No | What you are DOING right now, in a few words: the action, not the acceptance criteria. "Filtering the documents register by status", "Filling the deviation form with invalid dates", "Signing in as QA_Team" — NOT "§2.4 filtering narrows the set and the filter is reflected in the URL", which is what you are CHECKING, not what you are doing. Naming the item you are on is fine ("§2.4: filtering the documents register"); keep the rest to what a colleague would see over your shoulder. It stays set until you pass a different one, so a batch costs a few words, not one per call. Required on the tools that act unless a journey or an earlier call already set one. | |
| 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. | |
| objective | No | Old name for `task` (2.0). Prefer `task`. |