Ruby Raider

Scaffolding

Scaffolding creates new files in your project from Ruby Raider's templates, so you start from a working file instead of a blank one. It is useful when you write tests by hand, or want to grow a project beyond what you record.

What it can generate

Type What you get
Page Object A page: a Ruby file that describes one page of the site and the parts of it your tests use.
Spec An RSpec test file.
Helper A helper: shared code that several tests can use.
Component A component: a part that appears on several pages, such as a header or a menu.

Pages, specs and helpers are created in the folder set for their type under Paths, below. Components go to page_objects/components.

Generate a file

  1. Open a project and go to the Scaffolding tab.
  2. Choose a Type.
  3. Enter a Name in lowercase, for example login.
  4. Click Generate.

Ruby Raider's answer shows under the button: what it created, or what went wrong. The new files appear in the tree on the Files tab, ready to edit.

Paths

The Paths section of the Scaffolding tab sets where new files go:

A change is saved when you leave the field.

The commands behind it

The Scaffolding tab runs Ruby Raider's own generate commands for you. If you prefer the command line, you can run them in the app with Open terminal on the Files tab, or in any terminal inside the project folder:

raider g page [NAME]            # Create a page object
raider g spec [NAME]            # Create an RSpec test
raider g helper [NAME]          # Create a helper class
raider g component [NAME]       # Create a component class
raider g scaffold [NAME(S)]     # Create page + spec

Add --path [PATH] to page, spec, helper or component to create the file somewhere else. The Scaffolding tab does not offer raider g scaffold. raider u path [PATH] sets the default page path; add -s for specs or -h for helpers, like the Paths section does.

The full list of commands is in the Ruby Raider README.