Skip to content

Conditional logic in UI steps (IF/ELSE/BRANCH) #2

@Explorer-64

Description

@Explorer-64

Problem

Real UIs have state. The current step vocabulary is a flat linear sequence
with no branching. Examples of flows the spec cannot currently express:

  • A "Complete" button that shows "Undo" if already logged today
  • Optional fields that change the flow depending on user input
  • A form that shows different fields based on a previous selection

An agent following linear steps mechanically will fail on any flow
that branches.

Proposed addition

A conditional syntax for v2.1.0:

IF selector_exists [data-agent-id="undo-button"]
  CLICK [data-agent-id="undo-button"]
ELSE
  CLICK [data-agent-id="complete-button"]
END

Source

Raised during implementation against an app with stateful UI elements
that change based on prior user actions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions