Fixture & Grammar Explorer Edit on GitHub


Note! This feature was completely rewritten in Storyteller 4.0 with quite a bit more useful functionality

The Fixture & Grammar Explorer gives you a one stop shop for previewing, editing, and generating Fixtures and Grammars. You can navigate directly to this page with the "Fixtures and Grammars" link in the top bar of the UI:

Navigation to the Fixture & Grammar Explorer

Fixtures

The fixture & grammar explorer shows a table of all the known Fixture's in the system. This is in effect, a union of the Fixture's described by markdown and the coded Fixture classes.

The fixture explorer

From left to right, the columns in the grid shown above:

  1. The Errors column shows a count of how many grammars are malformed or misconfigured.
  2. The Missing column shows a count of how many grammars are specified in the markdown, but not implemented in the code
  3. The Fixture Title column is the heading for the Fixture. Click on this column to drill into the details of each Fixture.
  4. Implementation is the full name of the .Net class for the Fixture if one exists
  5. In the Commands column, the Edit link attempts to open up the existing markdown file for the Fixture in your default editor for markdown. The Export link will tell Storyteller to export a new markdown file for the Fixture that represents a merged union of the coded Fixture and any markdown overrides.

A fixture with missing grammars

Create a New Fixture

New in Storyteller 4.0 is a small utility to start designing a brand new Fixture in markdown. To trigger this, use the New Fixture button in the top of the UI:

New Fixture

That link will bring up this dialog:

New Fixture Dialog

Enter either the key you want to use for your new Fixture like "CreateInvoice," or the desired title of the Fixture like "Create an Invoice" and let Storyteller derive the fixture key it uses internally from the title. After clicking "Ok," Storyteller will create a new markdown file and attempt to open that with your default editor for markdown files. If you used "Create an Invoice" as the title, you'd get a new file called /Fixtures/CreateAnInvoice.md under the root of your Storyteller specification project with the title specified like so:

# Create an Invoice

Exporting and Reloading Fixtures

Storyteller tries hard to watch the relevant files in a Storyteller project to know when to reload the Fixture markdown files. If things are working perfectly, you can edit the Fixture markdown files and see the Storyteller UI update in near real time. That being said, there are plenty of times when you'll need to kickstart Storyteller into reloading Fixture files or to export all the existing Fixture classes into their markdown representation for easy editing:

Commands for reloading or exporting Fixture's

In order from top to bottom,

  1. Reload/Recycle Everything! recycles the entire system and reloads the Fixture markdown files
  2. Reload Fixtures forces Storyteller to reload all the Fixture markdown files to apply any outstanding changes
  3. Export Fixture Language exports all known Fixture's to markdown files in the /Fixtures folder

Fixture Explorer

If you click through to the Fixture page from the Fixture Explorer grid, you can review how all the grammars in the Fixture will be rendered in the specification preview:

Fixture usage in the specification preview

Preview how the grammars will be rendered in the specification editor pages:

Fixture usage in the editor page

If there are any grammars defined in the Fixture markdown file, you will see skeleton code to implement those grammars in the Missing Code tab:

Skeleton code to generate Fixture classes

Or if there are no missing grammars, you'll see this:

No missing grammars

Finally, you can see what the grammar usage would be within the specification markdown files with a sample specification:

Sample usage of this Fixture in markdown