MainworthyDocs Open Mainworthy

Write cases

Use Suite to write test cases, compare and restore earlier versions, and resolve overlapping edits. Find cases by folder, tag, or search.

Search applies the active or archived state, folder and tags before limiting matches. Archived matches cannot hide an active case. A search with at most 2,000 matching cases reports the full count for those filters, independent of the page size.

Suite opens with 200 case rows and reads the next page as you approach it by scrolling or pressing j or k. Suite keeps up to five pages at a time. If you return to a page that Suite no longer holds, it reads that page again. Suite shows placeholders where it still needs to read rows. If the read fails, Suite offers Retry. After the first rows appear, Suite reads the filtered list's positions in the background. The scrollbar then covers every matching case. Drag it or jump to a case to read that 200-row window directly. Collapsing or expanding a folder changes its rows immediately. Unread rows keep their places until their bodies arrive. Text search and lists above 250,000 cases keep a scrollbar over the current window and its neighbours. Changing a filter keeps the previous rows visible until the new results arrive. During that read, those rows cannot be selected or used for bulk actions, dragging is disabled, and the outline stays off. Suite shows live changes without a reload. In the active list with no search or tag filter, ordinary case edits and CI reports update only affected rows that Suite already holds. If a report changes neither the case's proof nor its question count, Suite skips the read. Suite reads all the pages it holds after a reconnect, automatic case creation, or any write it cannot apply row by row. If a tag change or move is still pending, it stays visible when live updates arrive. If the write fails, Suite removes only that pending change. Live updates pause after the page stays hidden for one minute, or after thirty minutes without keyboard or pointer input while visible. Returning to a hidden page resumes updates. On an idle page, the next key or pointer press resumes updates. Reconnecting reads the latest project data. A shorter tab switch keeps the connection.

A confirmed later move replaces an earlier pending move of the same case. A slow or failed folder-list read keeps the cases returned by the current folder filter visible.

While the selected case loads, its pane says "Reading case…". If you press e, the page tells you that it is still reading the case. The editor opens when the case arrives if you still have it selected. A case with open questions appears once its timeline is read too, so a notice of a proposed change does not push the steps down after you started reading them. If a read fails, Suite tells you what could not load and gives the reason if the server supplies one. Suite offers a Retry button. A missing case says "Case not found.", names the case, and links back to all cases. If the live updates stop, the status line says so and reconnects. While the page first reads who you are signed in as, it says so under the name. When the session itself cannot be read, the page says why, keeps the drafts on this device, and offers Retry.

On a phone, a case's title takes up to two lines in the list before it is cut.

Suite with cases, folders, tags, and the selected caseSuite with cases, folders, tags, and the selected case
Suite with cases, folders, tags, and the selected case

Capture a case #

Create a case in Suite with the outline editor.

  1. Open Suite with g s.
  2. Press c.
  3. Type the title.
  4. Press Enter to start the first step.
  5. Type an action and its expected result, separated by >.
  6. Press Enter for the next step.
  7. Press Escape to record the case and leave the editor.

Use Tab to move to the expected result field. Fields grow and shrink to fit their text, including when the case pane changes width. Press Shift Enter to record this case and start another. The keyboard guide lists the remaining editor keys.

Format an outline #

Put tags in the title with #tag. A space separates the tag from the title text. Mainworthy removes recognized tags from the title and keeps them as tags. In the web editor, you can also add tags and requirement links such as @REQ-123 in actions and expected results. Requirement links appear next to the tags as you type and when you view the recorded case. The hints below the steps name both shortcuts. When you save, Mainworthy processes only the fields you changed. An unchanged title or step keeps its original spacing. If that field already contains a literal #tag or @REQ-123, it stays as text until you edit the field. Tokens can follow whitespace such as tabs, nonbreaking spaces, figure spaces, and full-width spaces.

Checkout applies a percentage coupon #checkout #regression
  Open the cart with one $100.00 item
  Apply coupon SAVE10 > Total shows $90.00
  Reload the page > Coupon is still applied

When you paste a whole outline, indent the steps or start each with a list marker. An unmarked first line is a title only when every following line is indented or marked. A Markdown heading such as # Coupon checkout makes the title explicit.

You can paste numbered lists, bullet lists, or checkbox lists. Mainworthy removes recognized list markers and splits each action from its expected result. A more deeply indented line continues the previous step's expected result. A separate line beginning with > or Expected: also continues the previous step's expected result.

You can paste two columns from a spreadsheet, with an action and an expected result. Markdown tables work too. Mainworthy omits a header followed by a separator row. A numeric first column can supply step numbers without becoming action text.

Save a case and keep your draft #

While you type, the editor keeps a private draft in this browser tab. A new draft shows "Private, no version yet". For an existing case, others still see the recorded version named beside your draft. The timeline names the version your draft is based on, which can be older if someone else records a version while you type. Your save is then refused, and the page shows what changed (see When someone saved first).

The editor submits a changed draft when you leave or pause for 30 seconds. To submit sooner, press Cmd Enter on macOS or Ctrl Enter elsewhere. The editor sends your changes as a proposal. The project policy sets who answers each kind of question and which answers count. It determines whether your changes take effect immediately or wait for review. If you open another screen while a save finishes, its reply leaves you on the screen you chose. Returning to Suite shows the recorded case without its old draft row. Changing the filter while a new case saves keeps the filter and gives the case its address when the save finishes. A delayed save reply keeps any newer version the page has already received. There is no save button. Moving the caret or selecting text while a save finishes does not submit the text again. Text waiting for review stays in its proposal. When a new case proposal is accepted, its draft follows the case and version that acceptance recorded. Continuing the draft edits that case. Text typed while the proposal waits stays in your draft. Submitting while the question is open sends nothing new. After acceptance, leave the editor again to submit that text. If reading the waiting question fails, the draft keeps its link to the proposal and tries that read again on the next submission. If the case updates before you edit, your next edit starts from the newer version. While you edit, the folder and tags follow changes made elsewhere. Tags you add in the editor appear alongside those live tags. Saving changes only the tags you added or removed, and keeps unrelated tag changes. A tag you type remains your addition while a shortcut write adds or removes that same tag, whether the shortcut succeeds or is refused. Your typed text stays on the version you started from. The editor submits a case's body, tag changes and requirement links together. The policy uses both the current and the proposed tags to decide who reviews the whole proposal. That includes requirement-link changes, even if the proposal adds several links to the same case. While review is pending, none of those changes is current. Rejecting it leaves the case unchanged. A refused or failed save keeps your text and metadata in this tab. If the save succeeds but reading its recorded version fails, saving again finishes that read without creating another case.

The editor records a step once the step has an action. A step with an expected result but no action stays in your draft in this tab, including after a reload. The recorded version excludes that step. To record the step, type its action and leave the editor again. To discard the step, remove it and leave the editor again. A new draft is discarded on leave only when all its text, tags, and requirement links are empty. An expected result or precondition keeps the draft even when its title and actions are blank. Leaving a new draft that holds only an expected result records an untitled case with no steps, subject to the policy. The expected result stays in your draft until you add an action.

Emptying the action of a recorded step removes the step from the next version. Its expected result, if it has one, stays in your draft in the same way.

If a reload, lost connection, internal server error, or sign-in interrupts the reply, the draft keeps the save. When you reopen or next submit the draft, the editor resends that save first. The server records it once, even if it receives it more than once. The status line says "Your last save is recorded as version N" or names the version the save made. The editor then sends any text you typed after that save.

Each draft belongs to the project where you wrote it. If someone deletes that project and gives another project the same key, the page drops the draft. It says "The project was replaced since this draft was written, so it was discarded."

When the browser stores your draft, the status says "Draft, saved in this tab". A reload keeps the draft. When you close the tab, the editor submits the text and the draft ends. You can see the draft only in its tab. If you duplicate the tab, the new tab starts with a copy of the draft. The editor submits each copy as a separate edit, so Mainworthy refuses the later save and shows what changed. Drafts do not sync between devices. If the browser cannot store the draft, the status says "Draft, not saved: keep this page open" until a version is recorded.

The life of a case. Zoom, search and follow a path in the frame, or open it full screen.

Read versions and restore earlier content #

Select a case to read its version, author, proof, and timeline. A result names the case version it exercised. Editing the case does not rewrite that result. Linked automation lists the automated tests currently linked to the case, with links to their test pages. "No linked automated tests" means no automated counterpart is linked. A linked test with no result for this case says so, even if it ran before it was linked. Each available result shows its outcome and the version it ran against. A pass on an older or unknown version does not prove the current version. The link shows what the test covers. You need a result for evidence. Unlinking removes the test from this list and keeps its historical Proof and timeline entries. There is no age cutoff for these results.

The get reply's tests list carries each linked test's t, name, file, and nullable last result. A last result carries id, outcome, version, at, and current. It is the test's newest result that counted for this case. If no result counts for this case, last is null. A later result for a different case or for no case does not replace it. current compares the result's version with the current case version, regardless of the outcome.

The Proof section shows the latest result for each method. Each result shows the original version, author, basis, and any model or test name. It keeps those details even when the result is older than the timeline's displayed entries. An older pass does not prove the current version. If a result has no recorded version, Proof says "unknown version". Data replies from get and find --in cases, including CLI and MCP output, carry each proof's result id, version, by, method, model, name, outcome, at, current, and basis. A method with no result is null.

Case with proof and a proposed edit in its timelineCase with proof and a proposed edit in its timeline
Case with proof and a proposed edit in its timeline

A version diff shows what changed from one version to the next.

  1. Press v to compare the current version with the one before it.
  2. To compare another version with its preceding version, select that version in the timeline.
  3. Choose "Close" to dismiss the diff.

The first version of a case has nothing before it. Asking for its diff opens nothing. The status line at the bottom of the window says that there is no earlier version. Diff rows wrap long words and tokens so their full text can be read.

In Suite, u first undoes the latest placement action when one is available. Otherwise, on a recorded case with more than one version, it restores the preceding version as a new version. With a timeline version focused, it restores that version's predecessor. The API can request a specific version to restore. When the policy asks a person first, the status line says the restore is proposed and names its question. The case stays at its current version until that question is answered. If a restore reply is lost, press u again. The page checks that request's recorded outcome before retrying it. An already-recorded restore leaves later edits alone. Leaving the case checks the old request once and reports its outcome with the case reference. The page then drops that request. Pressing u on another case starts a new restore there. The retry instruction clears as soon as you leave. The check reports that case's outcome even if you keep navigating. While the check runs, the status line says the restore is being checked, and the outcome replaces that sentence. If anything has written the status line since, such as a tag or another restore (even of the same case), that status stays and the outcome appears on a line of its own below it, until the next such outcome or until you press Dismiss. If nothing was recorded when checked, the old request may still arrive, but the page does not retry it. A final refusal shows the server's message without promising a retry of the old request. If the project was replaced under the same key, the page discards the restore and asks you to reload. See the API guide for that operation.

Restoring creates history. It never deletes or rewrites the earlier versions. The web diff compares adjacent versions, rather than offering two arbitrary version selectors.

Organize the suite #

To create a folder, follow these steps.

  1. Press n f to create a folder.
  2. Type its name.
  3. Press Enter.

Creating a folder while inside another folder places it below that folder. If the reply is lost, press Enter again to check the same request before retrying it. The name stays read-only while that request is kept. Pressing Escape or leaving the parent folder checks the old request once and reports its outcome with the full folder path, then drops it and closes the field. The next folder creation is a fresh request. The retry instruction clears while the page checks the outcome. Navigating again does not hide that folder's outcome. The outcome replaces the status line's sentence that the folder is being checked. If anything has written the status line since, that status stays and the outcome appears on the line below it, as for a restore. If nothing was recorded when checked, the old request may still arrive, but the page does not retry it. A final refusal leaves the name editable and shows the server's message without promising recovery of that request. If the project was replaced under the same key, the server refuses the old creation and the page asks you to reload. Select a folder in the sidebar to see its cases, or type a word of its path in the palette (⌘ K, or Actions on a phone) and choose Folder: and its path. The sidebar scrolls to show the folder that is open.

Creating, renaming, or moving a folder cannot introduce a duplicate path. Existing duplicate paths do not block unrelated edits or a rename to a free path. Path comparisons ignore letter case and use Unicode normalization. Creating or moving a case to an existing path uses that folder. The server checks the final paths of a whole proposal again when accepting it. Folder edits apply in order. A path that temporarily names two folders cannot be used as a destination during that batch. Reorder the edits so that the path is unique first. When a proposal waits for review, Mainworthy checks its edits again against the current folders. If the same path now names two destination folders, the question stays visible in Queue and names the path. You can reject it without changing the folders. Accepting it is refused without applying any edits. Restore a unique destination before accepting it. Even if Mainworthy cannot reapply an edit, it checks the policy against later edits and every possible destination folder. The check includes the folder paths and case tags. A clause is a line of the policy that says who answers and what an agent's answer is worth. Mainworthy combines the requirements from every clause that could apply if the path became unique. An earlier, looser folder clause cannot weaken review. If the role or author requirements conflict, a project admin must answer. A project admin holds the admin capability on that project, which lets them accept its policy changes. If Mainworthy cannot reapply the edits, a person must answer even if the policy normally answers automatically. If the proposal has many edits or deeply nested folders, the review can include any folder condition in the policy and tags from any current folder. Rejecting it may therefore need a reviewer or reason for an unrelated folder. The policy's role and reason requirements also apply when rejecting the proposal. You can combine folder creations, renames, moves, and case placement in one proposal.

Press x on each case you want to select for a bulk action, or press * to pick several from the current window of up to 200 cases. Select all N shown selects that window and skips cases in collapsed folders. Pages read ahead do not enlarge the selection. On a phone, choose Select cases… from Actions, tap each case, then Done. With no selection, the action uses the current case. A move or a tag keeps the selection for the next action. An archive or a restore clears it. Press Esc, or choose Clear selection, to clear it yourself. Filtering keeps your selection. Adding or removing tags includes selected cases hidden by the filter. Undoing a tag action includes those cases too. Press m to choose a destination folder. After the move, select that folder in the sidebar to see the case without reloading. The move palette takes in folders that finish loading while it is open and keeps your search text. To add a tag, press t. Enter the tag name, then press ↵. On a phone, tap the keyboard's Done, or choose Add tag from Actions. To remove a tag, press Alt (Option on a Mac) and t, or choose Remove tag from selected cases in the command palette. Choose the tag to remove from the selected cases. While editing one case, you can also use the remove control beside a tag chip, then record the edit with Escape. On a phone, open the case and choose Remove tag from selected cases from Actions. A removal protected by the project policy waits for review before changing the case. Press # to archive the selected cases. Press u to record the inverse of the latest placement action. The changed-case count includes only cases the server changed. If another person already made the requested change, the action says No cases changed. Nothing to undo. Pressing u then leaves earlier actions alone. For a partly stale selection, Undo affects only the cases this action changed. Moves return to the folder and position that were current at the write. If that folder was archived meanwhile, it stays archived. Find the returned active cases in All cases. Tag undo reverses only the tags this action added or removed. If a placement or Undo reply is lost, press u. The page checks the same request's recorded outcome before sending it again, so retrying an already-recorded Undo leaves another person's later move alone. For a lost placement reply, u undoes the placement if it reached the server. If it never reached the server, u sends it once and then undoes it. That leaves two entries in history and no net change. If the project was replaced under the same key, the server refuses the old action. The page discards its Undo and asks you to reload before changing cases.

Moves, tag changes, and archiving appear in history without creating a new body version. Archived cases leave the active suite. Their recorded history remains available. Select Archived in the Suite sidebar to find them, then open the case. The case page labels it Archived, including when you open its old URL. Press # to restore it, or choose Restore selected from the command palette. On a phone, open the case and choose Restore selected under Actions. Select only active cases to archive, or only archived cases to restore. Mainworthy refuses a mixed selection and leaves every case as it is. A picked case must be open or in the loaded list before you archive or restore it. If a selected state is unread, open the case or return to its list and wait for it to load. Restore keeps its folder, tags, body version, and history. Select All cases to return to the active suite. Folder, tag, and text filters also work in the archived view.

While the server saves or accepts a large bulk change, you can keep reading the suite. Each read sees the complete state before or after the change. The proposal's changes become current together. A save queued behind that change still waits for it to finish. The same behavior applies to confirmed CSV imports. It also applies when a person answers a question to create cases for tests with no case or to apply accepted findings. When the policy uses unlinked: create, Mainworthy creates cases for tests with no case as it processes the report. You can keep reading.

To filter the current list, press / to focus "Filter cases". Type the words to match. Use the sidebar's tags to narrow the suite by tag.

The header counts every case that matches the words, the folder and the tags, and pages show them best match first. Words that match more than 2,000 cases are too broad to rank. The list then shows one page of the newest matches, those with the words in their title first, and the header says N+ cases. Add a word, a folder or a tag to reach the rest. Planning a run from such a search says "Too many matching cases to count".

When someone saved first #

Every save names the version you started from. If someone else saved a newer version of the case after you started, in another window or on another device, your save is refused, and nothing you typed is lost or written over theirs. The status line says "Not saved: version N was saved after you started", and the case shows a card headed "Not saved":

  • What changed since version M: the difference between the version you started from and the current one.
  • Your edit: the difference between the version you started from and your text, and your text in full, to copy.

The editor holds your text read-only and sends nothing more for it. A reload, or walking away to another case and back, keeps the card. To continue, choose Redo on version N. The editor opens on the current version, with the tags and requirement links you changed still changed, and your earlier text stays beside it to copy from, a step with an expected result and no action yet included. Make your edit again and leave the editor: it is saved on version N like any other edit. Choose Put away to close your earlier text. What you changed since, and the tags and requirement links you changed, stay in your draft. If none of them changed, the editor drops the draft without saving.

If your save matches the current version exactly, Mainworthy accepts it without a change. If the case changes while your proposal waits for review, Mainworthy refuses to apply the proposal. Reject it and propose the edit again on the current version.

The command line and the agent tools are refused in the same way: the reply is a conflict whose message names the case, the version you edited and the current one (over HTTP, its details hold them as case, base and head). Read the current version, then send the edit again on it.

Review under a stricter policy #

Under loose, ordinary case proposals take effect at once. Under standard, an agent's edit waits for a person. A person's ordinary edit still takes effect at once. Under strict, ordinary edits wait for a person with a reason, including edits by people.

While a case has open proposals, a notice under its version strip names who proposed the change and says it is not in effect yet. See the change opens the timeline card. The question reference opens the question in Queue. For several proposals, the notice says how many wait. If one proposal includes several operations, it warns that accepting applies all of them. New case title and metadata lines use + in the proposal diff.

The case timeline shows the proposal with every edit in it, the edits of other cases included, since accepting it accepts all of them. An authorized person can use a to accept it or r to reject it. A key, or the Accept or Reject button, brings the proposal into view and shows its first unread part in the same press. Later presses page through unread edits even when the card is taller than its pane. If the pane hides the next unread part, the same press moves the pane to show it. It answers only once the last edit is showing. The buttons and action keys offer only answers that apply to the proposal. If the case changed after you submitted the proposal, Mainworthy refuses to apply it. Reject it with r and propose the edit again on the current version. When the policy requires a reason, the case pane opens a field labeled with Accept or Reject. The answer buttons and keys stay disabled while this field is open. If someone settles the question meanwhile, the field closes when the page receives that decision. If your answer fails, the pane keeps newer timeline updates and reads the case again. Type the reason and press Enter to record the answer, or Escape to cancel. Policy changes have separate rules. See policy.

Write cases from the command line #

$ mainworthy new coupon.txt
$ mainworthy get C-1 --md > coupon.md
$ mainworthy fmt coupon.md

new reads an outline or canonical case Markdown. It also accepts standard input. get --md prints the stored case as canonical Markdown. fmt parses canonical Markdown and prints its standard form without changing the server. It needs no running instance. Parse errors name the source line. See the CLI guide for command forms and flags.

Custom field values #

Canonical Markdown can carry a fields map in its header. Values are strings and survive Markdown round trips. Terminal controls and workflow-command prefixes print as reversible escapes in header values and body text. When editing an existing case, omitting the fields header keeps the values from the edit's base version. An edit made on an older version than the current one is refused, as any edit is. A proposal that supplies the map replaces all its values, so include keys you want to keep. Unless a required field prevents it, an explicit empty header clears the values. The empty header can be either fields: with no entries or fields: {}. In the web editor, every field defined in Settings appears after the steps when you capture or edit a case, so the steps stay where you were reading them. A new case's Kind and an empty precondition also appear after the steps. An existing precondition stays above the steps. Text fields accept text. Choice fields list the allowed values. Fields marked required need a nonblank value for a new case. Escape, Record version and automatic saving validate fields before sending a proposal. A refusal names the field in the status line and keeps your draft in this tab. Fill the field and save again. Clearing an optional field removes its value. The editor preserves stored keys without a definition. A save sends the field map only when you change it, so a draft that never loaded some values keeps them if you leave the fields alone. If you change a field in that draft, the editor sends only the fields it knows. Mainworthy removes any stored values the draft never loaded.

A project can define text or choice fields and require values. See Custom fields for the procedure. New cases, restores, and changed field values must meet the definitions in force when proposed and adopted. An edit can keep unchanged values from the current case, including missing required values or choices no longer allowed. The web editor can therefore edit older cases without filling new required fields. Older versions remain readable as recorded.

Reuse pinned fragments #

A fragment is a case whose steps you can reuse. When you insert a fragment, you pin the steps to one version. To create a fragment in Suite, follow these steps.

  1. Start a new case.
  2. Choose Fragment in Kind, after the steps.
  3. Write the shared steps.

A recorded document's kind stays fixed. Fragments cannot include other fragments. A reference inserts only the fragment's steps. Its preconditions and custom fields stay in the fragment.

While editing a case, insert shared steps with these controls.

  1. Open Insert fragment.
  2. Enter the fragment ref, such as C-12.
  3. Leave Version empty to pin the current version, or enter an older version.
  4. Choose Insert pinned fragment.

The editor shows the shared steps and their source. To remove the reference from the case, choose Remove fragment. To change shared instructions, edit the fragment itself.

An archived fragment keeps its versions and existing pins. The insertion picker excludes archived fragments, including their historical versions. You can edit other content in cases that reference the fragment. Restore the fragment before inserting another reference or moving a pin to a different version.

Reading a case or running it shows the fragment steps inline, marked with the fragment ref and pinned version. Publishing another fragment version leaves existing cases unchanged. Old case versions and runs keep their original pins. Fragments themselves are omitted from run selections.

Search and run selections by text include the actions and expected results of pinned steps at their pinned version. A newer fragment version changes those matches only after you update the case's pin.

Open a fragment to see Fragment users and the versions each case uses. To update cases pinned to an older fragment version, follow these steps.

  1. Choose the older fragment version.
  2. Select the cases to update.
  3. Choose Update selected to vN.

One proposal records the selected updates and who requested them. The project's policy may require acceptance. Unselected cases stay pinned. If any selected case changes before the update is accepted, refresh and propose the batch again. No selected case moves from that refused batch. You can keep reading the cases while Mainworthy checks and applies a large batch. Until the batch commits, readers see every case at its previous version. After you move a pin, earlier results no longer prove the current case version. This applies even if both fragment versions have the same instructions.

Markdown preserves a reference with its own step id:

- !use C-12@v3 ^ab

A fragment's header uses kind: fragment. A literal action beginning with ! is escaped as \! in canonical Markdown. Instance and project archives preserve fragment history and pins. Use the web editor to edit a fragment or a case with pinned fragments. Fragment authoring and batch updates use the web, HTTP propose, or CLI JSON. MCP discovery omits these inputs. When a creation supplies both kind and Markdown, their kinds must agree. A missing Markdown kind: line means case, so kind: "fragment" also requires kind: fragment in the Markdown header.

Mainworthy 0.1.0 · Licence · this page is docs/guide/write-cases.md in the repository