Testing Canvas Workflows
Most Steps in a Canvas workflow can be tested in two ways.
- Inline Testing
- 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.
- On a Canvas workflow, click the + icon.
- Click on Action
- Search for Log.
- Click Arigato, then click Log A Message. Click Add Action.
- In the button tray, click Select a Test Item.
- Choose an item to test with.
- In the Value field, click on the Token icon {t} to insert a token.
- 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.
- On a Canvas workflow, click the + icon.
- Click on Action
- Search for Log.
- Click Arigato, then click Log A Message. Click Add Action.
- In the button tray, click Select a Test Item.
- Choose an item to test with.
- In the Value field, click on the Token icon {t} to insert a token.
- Click on Shop, then click on Name, then click Insert Token.
- 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.
- On a Canvas workflow, click the + icon.
- Click on Condition.
- Click on Shop, then scroll to Name.
- Click Name then click Add Condition.
- In the Condition Testing area, click Select a Test Item.
- Choose an item to test with.
- The Inline Test will show that the test is failing because the Condition is not configured.
- 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.
- From the parent workflow, click to open the Loop step.
- At the bottom of the Edit Loop screen, click Select a Test Item.
- Select an item to test with.
- 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.
- 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.
- From the parent workflow, click to open the Loop step.
- At the bottom of the Edit Loop screen, click Select a Test Item.
- Select an item to test with.
- Click Configure Loop Workflow.
- Click the + or open an existing Step.
- At the bottom of the Step, click Select a Test Item
- 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.