Testing Canvas Workflows

Most Steps in a Canvas workflow can be tested in two ways. 

  1. Inline Testing
  2. Live Testing

This article will review the details of both methods as they relate to each Step type.

Testing Actions

Inline Testing an Action
Inline Testing Actions is the same for any Action. In this example, we'll test a Log Message.

  1. On a Canvas workflow, click the + icon.
  2. Click on Action
  3. Search for Log.
  4. Click Arigato, then click Log A Message. Click Add Action.
  5. In the button tray, click Select a Test Item.
  6. Choose an item to test with.
  7. In the Value field, click on the Token icon {t} to insert a token. 
  8. Click on Shop, then click on Name, then click Insert Token.

At this point, the name of the Shop will be displayed below the Value field. This example would work on any type of workflow. If your workflow is a product workflow, you could select a field from a product, like the title of the product instead of the name of the Shop and the product title would be displayed instead. Clicking on Reset in the Action Testing area will allow you to choose a different item to test with and see the result from that test.

Live Testing an Action
Please note, Live Testing will actually run the Action and perform whatever the Action is intended to do. Use caution when Live Testing.

Live Testing Actions is the same for any Action. In this example, we'll test a Log Message.

  1. On a Canvas workflow, click the + icon.
  2. Click on Action
  3. Search for Log.
  4. Click Arigato, then click Log A Message. Click Add Action.
  5. In the button tray, click Select a Test Item.
  6. Choose an item to test with.
  7. In the Value field, click on the Token icon {t} to insert a token. 
  8. Click on Shop, then click on Name, then click Insert Token.
  9. Click Log Message Now.

At this point, the results of the Live Test will be displayed in a log message below the Action Testing area.

Testing Conditions

Inline Testing a Condition
Inline Testing Conditions is the same for any Condition. In this example, we'll check the name of the Shop.

  1. On a Canvas workflow, click the + icon.
  2. Click on Condition.
  3. Click on Shop, then scroll to Name.
  4. Click Name then click Add Condition.
  5. In the Condition Testing area, click Select a Test Item.
  6. Choose an item to test with.
  7. The Inline Test will show that the test is failing because the Condition is not configured.
  8. In the text field below If shop->name... enter some text from your Shop's name. 

At this point, the test will be passing, as indicated by the green checkmark. This example would work on any type of workflow. If your workflow is a product workflow, you could select a Condition from a product, like the title of the product instead of the name of the Shop, then configure your test accordingly. Clicking on Reset in the Condition Testing area will allow you to choose a different item to test with and see the result from that test.

Inline Condition Results on the Canvas
If a test item has been selected in any Step in a Canvas workflow, then the result of Condition tests will be displayed inline on the Condition Steps on the Canvas. Condition Steps will have a green check or a red X next to each Condition to help visually guide you through how the workflow would flow with the chosen test item. 

Testing Loops

Testing a Complete LoopTesting an entire loop sends each item for processing and runs the entire Loop workflow, just like it would run if that workflow was triggered another way. 

  1. From the parent workflow, click to open the Loop step.
  2. At the bottom of the Edit Loop screen, click Select a Test Item.
  3. Select an item to test with.
  4. In the button tray, click Test Now. The Loop Step will show a basic log message with a link to View Workflow Logs for the entire Loop workflow.
  5. Click View Workflow Logs.

Inline Testing a Loop Workflow
Inline testing allows the workflow author the ability to target a particular item for testing and see the expected results while authoring the Loop workflow.

  1. From the parent workflow, click to open the Loop step.
  2. At the bottom of the Edit Loop screen, click Select a Test Item.
  3. Select an item to test with.
  4. Click Configure Loop Workflow.
  5. Click the + or open an existing Step.
  6. At the bottom of the Step, click Select a Test Item
  7. Click on the item you wish to test with.

At this point, you may enter any tokens or code into the Step configuration and the result will be displayed as a live preview, using the selected item. You may also run an Action by clicking the green [Action Name] Now button in the button tray. Additionally, any Conditions will show a live preview to indicate the results of the Condition when testing against the selected item.