Back to Reflog

/Product updates

Test file uploads with Scenario fixtures

Attach real files to a Verify Scenario, and the testing agent uploads them wherever the app asks for one.

With Composal you can define scenarios – effectively test specs – in a simple YAML file. Here’s an example:

# yaml-language-server: $schema=https://composal.ai/schema/verify/v1/scenario.json
$schema: https://composal.ai/schema/verify/v1/scenario.json
name: An accountant can add an invoice
labels: [invoices]
persona: Accountant
allowed_actions: writes
starting_conditions: Signed in with no invoices.
steps:
  - Open Invoices and choose New invoice.
  - Enter invoice number 1042 and amount 250.00.
  - Choose Save.
outcomes:
  - Invoice 1042 shows in the Invoices list.

Using the Composal CLI, you can get your coding agent to generate scenarios and upload them with com verify scenarios upload. When you want to edit them, get the latest with com verify scenarios download.

However, sometimes you need your testing agents to work with files. You want to make sure that legal document gets parsed and shows the right parties, or even that the profile picture upload works. So we’ve added support for fixtures on scenarios. Right after building it, we used it to catch a bug in this specific area.

# yaml-language-server: $schema=https://composal.ai/schema/verify/v1/scenario.json
$schema: https://composal.ai/schema/verify/v1/scenario.json
name: An accountant can import an invoice
labels: [invoices]
persona: Accountant
allowed_actions: writes
starting_conditions: Signed in with no invoices.
fixtures:
  - path: fixtures/invoice-1042.pdf
steps:
  - Open Invoices and choose Import.
  - Upload invoice-1042.pdf.
outcomes:
  - Invoice 1042 shows in the Invoices list.

The file sits next to the scenario:

scenarios/
  import-invoice.yaml
  fixtures/
    invoice-1042.pdf

Name the file in the step, and the agent picks it when the page asks for one. When you run com verify scenarios upload, the CLI sends any new files along with the scenario. Files Composal already has aren’t sent again, so uploading an unchanged suite again sends nothing.

Fixtures work in desktop and Android apps too, and scenarios you edit on the web can take files with com verify fixtures add.