Components

Components, which can also be referred to as methods, are reusable chunks of actions designed to reduce having to repeat yourself. Some common use cases for components are:

  1. Logging in.
  2. Logging out.
  3. Filling in a contact form.
  4. Filling in a credit card information form.

There are many other use cases for components, and as you create tests, ask yourself, "What parts of this test will be used again?". Under the hood, components are essentially just special snaptests, so they can do everything a normal test can do, such as using variables, being played back, and being debugged, etc. The only difference is that they can be called as a test action from within another test:

Creating a component

It's quite easy to make a new component:

  1. Select the action rows you'd like to convert into a component
  2. Click the "rollup" button.
  3. Enter the new component and change it's name.
  4. Add any variables needed.

HINT: To select multiple consecutive actions quickly, select one, hold shift, and select another to quickly select a range.

If you made a mistake when creating a component, either hit the "undo" button, or use the "spread component" button to undo changes.

Default and instance variables in a component

When you create a component (and a test for that matter), the variables you define are considered the "default variables" that may be overidden by instance variable.

In the case of components, you can override these variables using "instance variables". They do not change the default variables, but just replace them in the current instance:

Group 6Record it…Play it…Generate it…GeneratorsSelector AlgorithmsPrivate modeTest organizationTeamsWorkspacesDedicated supportTest data storageDebugger toolsAdaptable TestsCLI tools and APIWhite-labeled codeVariablesMulti-test playbackManual testsComponents