Line-by-line chains for optional UI (banners, cookies, dialogs). Contiguous if → zero or more else if → optional else. After then / else, run one existing command via the normal execute path — branching does not redefine click / fill / etc.
When I if see "<text>" then <action>And I else if see "<text>" then <action>And I else <action>When I if not see "<text>" then <action>And I else <action>
<action> is any existing step command remainder (for example click on "Dismiss", fill "email" with "a@b.com").
Given I navigate to "https://example.com"When I if see "Banner" then click on "Dismiss"And I else if see "Cookie" then click on "Accept"And I else click on "Continue"Then I should see "Welcome"
When I if not see "Error" then click on "OK"And I else click on "Retry"
# if alone is valid — false condition → step SKIPPED; scenario continuesWhen I if see "Welcome back" then click on "Continue"When I fill "email" with "a@b.com"