The tour

What you write, and what comes back

Every feature, one at a time, each with a scenario in and a captured result out. Nothing here is mocked: each box is a file under assets/homepage, stamped with the commit and the command that produced it. Every example is a small project that scripts/homepage/capture.sh runs at each regeneration, and the boxes are its output — so the tour proves each claim as of the last capture. The front page is the short version.

The refusal: compile errors, before a browser opens

A scenario is four lines of Gherkin. :user/alice is a declared subject and an instance — a keyword naming the subject’s type and the instance, declared in the glossary. Login.submit is an intent reference: an intent is a named thing on a page, with the elements it owns, declared as a small data file. Here the actor is misspelled on the first step and the element on the third:

in — sl/features/login.feature
Feature: Login

  @because=CHK-4412
  Scenario: Alice logs in
    When :user/alicce opens the browser to 'http://127.0.0.1:9095/login'
    And :user/alice fills Login.username with 'alice'
    And :user/alice clicks Login.sumbit
    Then :user/alice should see 'Welcome, alice!'
out — sl run
run seed: <seed>

SVO validation issues:
  ERROR: Unknown subject :user/alicce in step ":user/alicce opens the browser to 'http://127.0.0.1:9095/login'"
         at sl/features/login.feature:5
         Known subjects: :user/alice, :user/bob
         Did you mean: :user/alice?
         Declared in: sl/glossary/subjects.edn:10

  ERROR: Unknown object 'Login.sumbit' in step ":user/alice clicks Login.sumbit"
         at sl/features/login.feature:7
         Interface: :web
         Unknown intent/element: Login.sumbit. Did you mean: Login.submit?
         Declared in: sl/glossary/intents/login.edn:7


2 binding issue(s) found. Cannot execute.
# exit 2

Every step resolves to who, does what, to which thing, through which interface, before the run. A word that does not resolve stops the run with a suggestion and the file and line where the right name is declared. Exit 2: nothing ran, no browser opened. This is the fifteen seconds that follow:

the same refusal, recorded
Terminal recording: a feature file with a misspelled actor and a misspelled element is printed, sl run refuses it with two did-you-mean suggestions, and echo $? prints 2
the same session as text
$ cat sl/features/login.feature
Feature: Login

  @because=CHK-4412
  Scenario: Alice logs in
    When :user/alicce opens the browser to 'http://127.0.0.1:9095/login'
    And :user/alice fills Login.username with 'alice'
    And :user/alice clicks Login.sumbit
    Then :user/alice should see 'Welcome, alice!'

$ sl run sl/features/
run seed: <seed>

SVO validation issues:
  ERROR: Unknown subject :user/alicce in step ":user/alicce opens the browser to 'http://127.0.0.1:9095/login'"
         at sl/features/login.feature:5
         Known subjects: :user/alice, :user/bob
         Did you mean: :user/alice?
         Declared in: sl/glossary/subjects.edn:10

  ERROR: Unknown object 'Login.sumbit' in step ":user/alice clicks Login.sumbit"
         at sl/features/login.feature:7
         Interface: :web
         Unknown intent/element: Login.sumbit. Did you mean: Login.submit?
         Declared in: sl/glossary/intents/login.edn:7


2 binding issue(s) found. Cannot execute.
$ echo $?
2

A typo is the fastest case to see, not the important one. The important ones are a glossary entry renamed and left dangling across forty scenarios; a merge that leaves references pointing at nothing; a step library refactored underneath a suite nobody re-ran. Each is the same failure to resolve, caught the same way, at the same moment: before a browser opens.

one step of the plan — sl run --dry-run -v: the text, what it resolved to, and the step definition it bound to, by file and line
[:user] alice fills Login.username with 'alice'  →  :user/alice :fill [:with] "Login.username" via :web  (shiftlefter/stepdefs/browser.clj:751)

How strict, exactly: unknown subjects and unknown interfaces block; unknown verbs warn; unknown intent references are errors; raw locators in step text are off by default; untyped step definitions warn. Each is configurable. Strictness follows ownership: whoever owns the word decides how hard the check is.

The failure row

Four steps against a shopping cart. Three pass. The fourth is what a failure looks like here:

in — sl/features/cart.feature
  Scenario: Removing the last item marks that item removed
    When :user/shopper opens the browser to Cart
    Then :user/shopper should see 3 Cart.items[*] elements
    When :user/shopper clicks Cart.items[-1].remove
    Then :user/shopper should see Cart.items[-1].status with text 'removed'
out — the row from the HTML report, as a browser renders it
The failing scenario's row in the ShiftLefter HTML report: three passed steps, one errored step with the timeout message, the screenshot of the cart page, and the browser console excerpt

The same failure reaches your CI two more ways — the JUnit case the pipeline widget reads, and the machine-readable record a script reads. One failure, one set of attachments:

--junit-xml
<?xml version="1.0" encoding="UTF-8"?>
<testsuites name="hero" tests="1" failures="0" errors="1" skipped="0" time="<s>"><testsuite name="Feature: Shopping cart" tests="1" failures="0" errors="1" skipped="0" time="<s>" timestamp="<t>" hostname="<host>.local"><properties><property name="shiftlefter.version" value="0.5.7"/></properties><testcase name="Removing the last item marks that item removed" classname="Shopping cart" file="sl/features/cart.feature" line="3" time="<s>"><error type="clojure.lang.ExceptionInfo" message=":user/shopper should see Cart.items[-1].status with text 'removed' -- Timed out after <ms> (deadline 3000ms via default, interval 100ms) — :user/shopper should see Cart.items[-1].status with text 'removed'. Last error: Expected element text to contain 'removed' but was 'in cart'"/><system-out><![CDATA[When :user/shopper opens the browser to Cart [passed] (0.328s)
Then :user/shopper should see 3 Cart.items[*] elements [passed] (0.088s)
When :user/shopper clicks Cart.items[-1].remove [passed] (0.035s)
Then :user/shopper should see Cart.items[-1].status with text 'removed' [failed] (3.012s)
[[ATTACHMENT|sl/results/<run>/cart/attachments/removing-the-last-item-marks-that-item-removed/failure-screenshot-web-shopper.png]]
[[ATTACHMENT|sl/results/<run>/cart/attachments/removing-the-last-item-marks-that-item-removed/console-web-shopper.log]]]]></system-out></testcase></testsuite></testsuites>
--edn, the failure and its attachments
{:run/status :failed,
 :run/exit-code 1,
 :failures
 [{:step/text ":user/shopper should see Cart.items[-1].status with text 'removed'",
   :step/id #uuid "00000000-0000-0000-0000-000000000000",
   :scenario/name "Removing the last item marks that item removed",
   :scenario/id #uuid "00000000-0000-0000-0000-000000000000",
   :location
   {:ns shiftlefter.stepdefs.browser, :file "shiftlefter/stepdefs/browser.clj", :line 950},
   :error
   {:type :step/exception,
    :message
    "Timed out after <ms> (deadline 3000ms via default, interval 100ms) — :user/shopper should see Cart.items[-1].status with text 'removed'. Last error: Expected element text to contain 'removed' but was 'in cart'",
    :exception-class "clojure.lang.ExceptionInfo",
    :data
    {:type :step/poll-timeout,
     :elapsed-ms <ms>,
     :deadline-ms 3000,
     :deadline-source :default,
     :interval-ms 100,
     :poll-counts {:attempts 27, :answered 0, :threw 27, :observation-throws 0},
     :last-error
     {:message "Expected element text to contain 'removed' but was 'in cart'",
      :type :browser/assertion-failed,
      :data
      {:type :browser/assertion-failed,
       :expected "removed",
       :actual "in cart",
       :locator "Cart.items[-1].status"}}}},
   :attachments
   [#:attachment{:kind :screenshot,
                 :source :capture-policy,
                 :interface :web,
                 :duration-ms <ms>,
                 :subject :shopper,
                 :path
                 "attachments/removing-the-last-item-marks-that-item-removed/failure-screenshot-web-shopper.png",
                 :media-type "image/png",
                 :bytes <bytes>}],
   :poll-counts {:attempts 27, :answered 0, :threw 27, :observation-throws 0}}],
 :attachments
 [{:scenario/name "Removing the last item marks that item removed",
   :scenario/id #uuid "00000000-0000-0000-0000-000000000000",
   :attachments
   [#:attachment{:path
                 "attachments/removing-the-last-item-marks-that-item-removed/console-web-shopper.log",
                 :bytes <bytes>,
                 :interface :web,
                 :source :capture-policy,
                 :excerpt
                 "INFO console-api http://localhost:9097/cart.html 0:1071 \"cart: rendered 3 items\"\nWARNING console-api http://localhost:9097/cart.html 0:199 \"cart: remove clicked on item 3 - marked \\\"Apples\\\" removed\"",
                 :duration-ms <ms>,
                 :kind :console,
                 :subject :shopper,
                 :media-type "text/plain"}],
   :steps
   [{:step/id #uuid "00000000-0000-0000-0000-000000000000",
     :step/text ":user/shopper should see Cart.items[-1].status with text 'removed'",
     :attachments
     [#:attachment{:kind :screenshot,
                   :source :capture-policy,
                   :interface :web,
                   :duration-ms <ms>,
                   :subject :shopper,
                   :path
                   "attachments/removing-the-last-item-marks-that-item-removed/failure-screenshot-web-shopper.png",
                   :media-type "image/png",
                   :bytes <bytes>}]}]}]}

A value crosses interfaces by name

A password reset: the browser asks for a code, the code arrives by SMS, the browser gets the code. The SMS step is a second interface, same grammar: receives an SMS is a built-in verb of the :sms interface. The message’s shape lives on the intent that owns it, as data, and what the shape captures becomes a word the next step can use:

in — five steps of the reset, one scenario
    Then :user/alice should see 'Enter Verification Code'
    When :user/alice receives an SMS to '+15550001111' matching Reset.smsCode
    And :user/alice fills Login.code with {smsCode}
    And :user/alice clicks Login.submit
    Then :user/alice should see 'Code verified for alice'
the declared Reset intent — the message is an element with a shape and no locator
;; Reset — the password-reset flow's SMS surface. The verification code
;; arrives as a text message: a readable with no locator, whose :shape is
;; all it has. The shape's one group binds to the element's own name, so
;; `matching Reset.smsCode` produces {smsCode} with nothing else to read.
{:intent "Reset"
 :elements {:smsCode {:bindings {:sms {}}
                      :shape "verification code is: (\\d{6})"}}}
out — that scenario
run seed: <seed>
PASSED Alice resets her password using a code sent to her phone

1 scenario(s): 1 passed
# exit 0

The code arrives by SMS. Reset.smsCode names the message’s declared shape; its one group binds to the element’s own name, {smsCode}, and the next step types that into a browser field. No glue code, no fixture, no shared variable: a value captured in one step is a word in the next, across interfaces. When the wording of the message changes, one intent file changes and no scenario does.

Page objects are data, addressed by path

in — the first of the feature’s six scenarios: six steps against a cart and a thread
    When :user/reader opens the browser to Cart
    And  :user/reader clicks Cart.items[-1].remove
    Then :user/reader should see Cart.items[-1].status with text 'removed'
    And  :user/reader should see 3 Cart.items[*].price elements
    When :user/reader opens the browser to Feed
    Then :user/reader should see Thread.post[1].comment[-1].author with text 'Carol'
the declared Cart
;; Cart — the card's own example shape (Cart.items[-1].remove, Cart.items[*].price).
{:intent "Cart"
 :location {:web {:path "/cart.html"}}
 :root {:web {:css "[data-testid='cart']"}}
 :elements {}
 :collections {:items {:intent "Item" :cardinality :many}}}
the declared Item
;; Item — a self-rooted cart row: name, price, status, remove button.
{:intent "Item"
 :root {:web {:css "[data-testid='item']"}}
 :elements {:name   {:bindings {:web {:css "[data-testid='name']"}}}
            :price  {:bindings {:web {:css "[data-testid='price']"}}}
            :status {:bindings {:web {:css "[data-testid='status']"}}}
            :remove {:bindings {:web {:css "[data-testid='remove']"}}}}}
out — the whole feature, all six scenarios
run seed: <seed>
PASSED The last cart row, the fan-out count, and a two-level address
PASSED A negative index resolves to the LAST element, and a click acts on it
PASSED An element and an attribute after an index
PASSED A [*] fan-out is a count assertion
PASSED An index on a non-terminal segment followed by more path
PASSED Two levels of indexing

6 scenario(s): 6 passed
# exit 0

Cart.items[-1].remove is the remove button on the last cart row: a collection, a negative index, an element. Cart.items[*].price fans out to every row, so should see 3 … elements is a count of all members. Thread.post[1].comment[-1].author walks two levels of nesting with an index at each. The objects are two small data files; the locators live there and nowhere else, so when the page moves you edit one binding and zero scenarios.

Two actors, two browsers, and costumes

in — alice and bob in one scenario
    When :user/alice opens the browser to 'http://127.0.0.1:9095/login'
    And :user/alice fills Login.username with 'alice'
    And :user/bob opens the browser to 'http://127.0.0.1:9095/login'
    And :user/bob fills Login.username with 'bob'
    And :user/bob should see 'Welcome, bob!'
    And :user/alice should see 'Welcome, alice!'
out — the run opens two real Chrome windows beside the terminal; the recording shows the terminal, cold JVM start on the clock
Terminal recording: a two-actor feature file is printed, then sl run passes it
the same session as text
$ cat sl/features/two-users.feature
Feature: Multi-actor browser test

  Scenario: Two users login simultaneously
    When :user/alice opens the browser to 'http://127.0.0.1:9095/login'
    And :user/alice fills Login.username with 'alice'
    And :user/alice fills Login.password with 'secret1'
    And :user/alice clicks Login.submit
    Then :user/alice should see 'Welcome, alice!'
    And :user/bob opens the browser to 'http://127.0.0.1:9095/login'
    And :user/bob fills Login.username with 'bob'
    And :user/bob fills Login.password with 'secret2'
    And :user/bob clicks Login.submit
    And :user/bob should see 'Welcome, bob!'
    And :user/alice should see 'Welcome, alice!'
    And :user/alice should be on '/dashboard'
    And :user/bob should be on '/dashboard'
    And :user/alice waits 3 seconds

$ sl run sl/features/
run seed: <seed>
PASSED Two users login simultaneously

1 scenario(s): 1 passed
sl glossary — the resolved vocabulary of that project
# Glossary (resolved)

Config: sl/shiftlefter.edn (discovered)
Substrate: git: not a repository
Strictness (:enforcement effective): raw-locator :warn · unknown-interface :error · unknown-object :warn · unknown-subject :error · unknown-verb :warn · untyped-stepdef :warn
Corpus: 1 feature file(s), 1 scenario(s)

## Subjects (1)

- :user [user-file] [used ×14] — Standard application user — instances: alice, bob
# exit 0

alice and bob are two instances of one declared subject. Each gets its own browser; nothing is shared unless you say so. The glossary shows the declaration and that the project uses it fourteen times.

Subjects are types, with instances, for three reasons. Every line says who is acting and in what context — not I, not the user, not a convention kept in a wiki — so “why is the admin in this scenario?” is answered by the line itself. A browser per instance costs nothing: name a second instance and its session exists, with no context to create and thread through the test body; an environment, or a costume, is assigned to the instance once. And because they are types, the same scenario can later run as someone else and the answers compared — derived denials, under Not yet.

sl costume list in that project
No costumes. Create one with: sl costume init <name>
# exit 0

A costume is a named browser identity an actor wears — a profile, a locale, sometimes an already-signed-in session — declared once, reused, with custody rules. This project has none; the command says how to make one. Costumes are a WebDriver-backend feature today.

The plan, or the refusal; and the exit code is a contract

sl run --dry-run -v in the two-actor project — every scenario, every step, what it resolved to, and the step definition it bound to, by file and line
run seed: <seed>
[two-users] 1 scenario(s) bound successfully (dry run)
plan:
  Two users login simultaneously
    [:user] alice opens the browser to 'http://127.0.0.1:9095/login'  →  :user/alice :navigate [:to] "'http://127.0.0.1:9095/login'" via :web  (shiftlefter/stepdefs/browser.clj:680)
    [:user] alice fills Login.username with 'alice'  →  :user/alice :fill [:with] "Login.username" via :web  (shiftlefter/stepdefs/browser.clj:751)
    [:user] alice fills Login.password with 'secret1'  →  :user/alice :fill [:with] "Login.password" via :web  (shiftlefter/stepdefs/browser.clj:751)
    [:user] alice clicks Login.submit  →  :user/alice :click [:default] "Login.submit" via :web  (shiftlefter/stepdefs/browser.clj:696)
    [:user] alice should see 'Welcome, alice!'  →  :user/alice :see [:on-page] "'Welcome, alice!'" via :web  (shiftlefter/stepdefs/browser.clj:909)
    [:user] bob opens the browser to 'http://127.0.0.1:9095/login'  →  :user/bob :navigate [:to] "'http://127.0.0.1:9095/login'" via :web  (shiftlefter/stepdefs/browser.clj:680)
    [:user] bob fills Login.username with 'bob'  →  :user/bob :fill [:with] "Login.username" via :web  (shiftlefter/stepdefs/browser.clj:751)
    [:user] bob fills Login.password with 'secret2'  →  :user/bob :fill [:with] "Login.password" via :web  (shiftlefter/stepdefs/browser.clj:751)
    [:user] bob clicks Login.submit  →  :user/bob :click [:default] "Login.submit" via :web  (shiftlefter/stepdefs/browser.clj:696)
    [:user] bob should see 'Welcome, bob!'  →  :user/bob :see [:on-page] "'Welcome, bob!'" via :web  (shiftlefter/stepdefs/browser.clj:909)
    [:user] alice should see 'Welcome, alice!'  →  :user/alice :see [:on-page] "'Welcome, alice!'" via :web  (shiftlefter/stepdefs/browser.clj:909)
    [:user] alice should be on '/dashboard'  →  :user/alice :be [:at] "'/dashboard'" via :web  (shiftlefter/stepdefs/browser.clj:1190)
    [:user] bob should be on '/dashboard'  →  :user/bob :be [:at] "'/dashboard'" via :web  (shiftlefter/stepdefs/browser.clj:1190)
    [:user] alice waits 3 seconds  →  :user/alice :wait [:duration] via :web  (shiftlefter/stepdefs/browser.clj:1312)
# exit 0

Before anything runs, the whole plan. If anything cannot bind you get the refusal instead, and exit 2. Either way the exit code means one thing:

four captured runs from this page — the command, the summary line, the exit
sl run sl/features/           1 scenario(s): 1 passed                               exit 0
sl run sl/features/ --html report.html --junit-xml junit.xml  1 scenario(s): 1 failed                               exit 1
sl run sl/features/           2 binding issue(s) found. Cannot execute.             exit 2
sl run sl/features/           1 scenario(s): 1 unobserved                           exit 4

Exit 0 and 1 are verdicts about your app. Exits 2, 3 and 4 are three different ways the run failed to be a measurement — and 4 is never blamed on the app. Here the port was closed, so the step proves nothing:

a run against a port with nothing listening
run seed: <seed>
UNOBSERVED The app is not listening

Failures:

Scenario: The app is not listening
  1) :user/reader opens the browser to 'http://127.0.0.1:9999/'
     at shiftlefter/stepdefs/browser.clj:680
     Error: SUT unreachable: ERR_CONNECTION_REFUSED for http://127.0.0.1:9999/
     class: observation — no answer existed; this step proves nothing about the app
     Data: {:response {:value {:error "unknown error", :message "unknown error: net::ERR_CONNECTION_REFUSED\n  (Session info: chrome=154.0.8037.100)"}}, :path "session/<id>/url", :method :post, :type :etaoin/http-error, :port <port>, :host "127.0.0.1", :status 500, :url "http://127.0.0.1:9999/", :error/class :observation, :net-error "ERR_CONNECTION_REFUSED"}


1 scenario(s): 1 unobserved
# exit 4
what to do on each exit — from sl agent-doc exit-codes, the topic the jar carries
  • 0 — the app met every expectation checked. Done.
  • 1 — the app answered and at least one answer was wrong. Debug from the report’s failure evidence.
  • 2 — nothing ran for that group. Fix the invocation, the config, or the spec’s symbols. Absence of exit 2 is not evidence the spec is valid — a fresh element-not-found at runtime (exit 1) may be glossary rot or app regression; triage, don’t assume.
  • 3 — ShiftLefter itself crashed. Trust nothing in the run; file a framework bug.
  • 4 — ≥1 scenario got no answer. Do not touch product code; check the environment, then rerun. Exit 4 withholds the indictment of the product because the evidence never reached it.

Byte-identical under parallelism

--max-parallel 4, and the report is the same as the sequential run — in content and in order.

sequential — the six-scenario feature from page objects
run seed: <seed>
PASSED The last cart row, the fan-out count, and a two-level address
PASSED A negative index resolves to the LAST element, and a click acts on it
PASSED An element and an attribute after an index
PASSED A [*] fan-out is a count assertion
PASSED An index on a non-terminal segment followed by more path
PASSED Two levels of indexing

6 scenario(s): 6 passed
# exit 0
the same feature, --max-parallel 4
run seed: <seed>
PASSED The last cart row, the fan-out count, and a two-level address
PASSED A negative index resolves to the LAST element, and a click acts on it
PASSED An element and an attribute after an index
PASSED A [*] fan-out is a count assertion
PASSED An index on a non-terminal segment followed by more path
PASSED Two levels of indexing

6 scenario(s): 6 passed
# exit 0
diff of the two
# exit 0

The parser never needs step definitions

Compatibility is a decision, stated exactly. The parser accepts every legal Gherkin file: 50 of 50 official Cucumber files parse and 12 of 12 invalid ones are rejected. sl fmt formats a suite losslessly with no step definitions and no config:

sl fmt --check
Checking features/checkout.feature... OK
# exit 0
sl fmt
Feature: Checkout

  Scenario: Buy a widget
    Given I am logged in as a shopper
    When I add a widget to my cart
    And I check out
    Then I should see my order number
# exit 0

The compiler, by choice, runs only typed steps: strictness over compatibility. An existing step library does not run here; feature files and page objects migrate. A plain Cucumber suite parses, every keyword, and nothing runs, because nothing in it is typed yet — and it says so, counts what it saw, and names the next command. Unshifted in that output means untyped; shifted means typed.

in — a Cucumber feature, untouched
Feature: Checkout

  Scenario: Buy a widget
    Given I am logged in as a shopper
    When I add a widget to my cart
    And I check out
    Then I should see my order number
out
run seed: <seed>

Undefined steps:
  - I am logged in as a shopper (features/checkout.feature:4:5)
  - I add a widget to my cart (features/checkout.feature:5:5)
  - I check out (features/checkout.feature:6:5)
  - I should see my order number (features/checkout.feature:7:5)

4 binding issue(s) found. Cannot execute.

This reads as an unshifted suite: every selected step is undefined.
ShiftLefter parsed 1 feature file(s), 1 scenario(s), 4 distinct step text(s) — and executes only typed steps.
To shift this suite, run: sl agent-doc adoption
# exit 2

An agent-led migration skill is next. Until then the on-ramp is what you see above: parse everything, run nothing, say what typing means.

The browser backend is one line of config

ShiftLefter sits between your scenarios and the browser driver and does not care which driver it is. WebDriver is the default and bundled. Switching to Playwright is one line of config and one dependency:

sl/shiftlefter.edn — the one line
{:interfaces
 {:web {:type :web
        :adapter :playwright}}}
the one dependency — a deps.edn coordinate, or three jars dropped in sl/lib/
{:deps {com.microsoft.playwright/playwright {:mvn/version "1.50.0"}}}

The step contract is the same on both: a feature file that runs on one runs on the other, with the same vocabulary, the same planning errors, and the same nested addressing. The two backends do differ — console capture and costumes are WebDriver-only today — and the differences are kept in one table rather than smoothed over.

Documented, not demonstrated here

Macros — a named step sequence, expanded before binding, provenance kept in the report. Lifecycle hooks named in the feature file: befores fail fast before a browser opens, afters run while it is still alive, every hook that ran is in the report. @blocked=REF holds — a held scenario that starts passing is a failure. And the whole of it from the inside: the documentation in the jar.