When I create the automation "Webship test lights" with this YAML:

Make an automation from YAML, as its editor's "Edit in YAML" takes it: a new automation, its YAML (its alias, the name, is written first when the YAML gives none), Save; wait for the editor to open it under its own address.

Examples

When I create the automation "Webship test lights" with this YAML:
And we create the automation "Webship test lights" with this YAML:
When I create the automation "Webship test morning" with this YAML:
Given I create the automation "Webship test lights" with this YAML:
And I create the automation "Webship test away" with this YAML:

Pattern

When(/^(?:I |we )?create the automation "([^"]*)" with this YAML:$/, …)

Part of @webship-js/home-assistant-steps (github.com/webship/home-assistant-steps), a step pack for Webship-js 2.0.x.