Skip to Content

A whole rig, walked through

A whole rig for a shop’s Next.js app, with a fixture backend, a remote staging, two people, two states and two journeys.

pkg/rig/testdata/example/ is a whole rig, for a shop's Next.js app, orchard-web. It has a fixture backend, a remote staging, two people, two states, one run of steps, two journeys, two screens' claims and a crawl. It passes the check as it stands. Here it is in the order it is written.

The head and [match]. id = "orchard-web", core = "nextjs", and a match on the package's name in package.json, so the rig is offered for this project and no other.

[app]. It pins the app's locale and time zone and a clock, because the orders print their dates and a frame that shows today's date can't be compared with yesterday's. preload loads scripts/fixed-clock.cjs from the project into the app's process, and the install sheet lists it. params = { locale = "en" } fills the [locale] part of the app's routes. facets writes the locale and role into the trace. [app.env] sets API_URL = "{{api.url}}", which the core fills with the address of the api service, and blanks the Stripe key.

The services. api is a fixture, with handler = "handlers/api.mjs". The handler is the one file of code in the rig. It answers GET /orders with an empty list and returns null for anything else. The core gives it a request and takes a response, and no browser object comes into it. Its where says the real backend is a Rails app that isn't started. staging is remote, with the two hosts the capture may reach and the host the app is served under there, and an env that points API_URL at staging while this service stands behind the app. Those two hosts, with the app host, are what the install sheet says the rig reaches. Nothing else is reachable.

[sign_in] and the people. where says orchard-api mails a code and the app keeps the session in its session cookie. shopper gets in with a fixture cookie. staging-shopper belongs to data = "staging" and its cookie has an ask: at the capture PitaFix asks the person to paste their own session cookie, and keeps the answer nowhere.

The states. old-order says what blocks it (refunds open only for an order that old), how the rig gets there (the fixtures hold order 42, paid on the 3rd of July), and the means: sign in as the shopper and open /en/orders/42. no-orders has a way_in and nothing a step can do with it, so no journey goes into it.

[steps]. home opens the home page. signed-in uses home then signs in as the shopper. A journey says { use = "home" } in place of repeating the step.

The journey refund-an-order. It uses home, then state = "old-order" (which expands into a sign_in as the shopper and an open of /en/orders/42, and the expect that "Order 42" is shown goes to the open), taps the refund button, uploads uploads/bruised-apple.png into #photo, types into the labelled field (clearing it first), and taps the send button by its test id. Three of its steps carry an expect. Its seven steps after expansion are the seven step records a core leaves for it.

The journey browse-on-staging. data = "staging". It opens the login and types the mail address, asking the person for it, with secret = false because an address is no secret. Then it types the mailed code with private = true, so nothing of it is in any picture or file, and idles on the orders for three seconds.

The screens. The refund screen's route is claimed in two states by the steps that show them, and a third, refused, is said unreached with the reason. The admin reports screen is said unreached whole. A reader of the rig, human or agent, knows what the rig doesn't cover and why.

[crawl]. The core's own exploring starts at /en as the shopper, never taps Cymraeg, and on staging starts at /en/orders as the staging shopper.

On this page