# Script Canvas Workflow Tests
Testing in this area should focus on the functionality of Script Canvas editor.
## Common Issues to Watch For
Test guidance will sometimes note specific issues to watch for. The common issues below should be watched for through all testing, even if unrelated to the current workflow being tested.
* Asset processor errors when loading/saving graph files
* Warnings or assets that appear in the graph validation log
* Unresponsive UI elements
### Platforms
* Windows
* Linux
### Documents and Common Terms
* [O3DE Documentation: Script Canvas](https://www.o3de.org/docs/user-guide/scripting/script-canvas/)
* [O3DE Documentation: Script Canvas Editor Interface Guide](https://www.o3de.org/docs/user-guide/scripting/script-canvas/get-started/editor-interface/)
* [O3DE Documentation: User Functions](https://www.o3de.org/docs/user-guide/scripting/script-canvas/editor-reference/functions/)
**Script Canvas Editor**: Editing tool separate from O3DE's Editor used to create and modify script canvas graph files.
**Script Canvas Graph**: A collection of node objects that can be modified and saved to a file.
**Script Canvas Editor Basic Tools**: The 5 default tools opened and anchored to the main Script Canvas editor window; Node Palette, Variable Manager, Node Inspector, Minimap, Graph Validation.
**Script Canvas Component**: A component that can be searched and attached to an entity in O3DE editor.
**User Function**: A type of Script Canvas graph that has 2 special nodes: Entrance & Exit nodelings. User Functions are intended to give users a way to generate re-usable graph logic similar to a function in a standard programming language. When a valid User Function graph is created and saved it will appear in the Node Inspector under the 'User Functions' category.
### Area: Opening and configuring the Script Canvas Editor
**Project Requirements**
Any project can be used, the Script Canvas gem and its gem dependencies are required.
**Product:** Visible and responsive Script Canvas editor.
**Suggested Time Box:** 30 minutes
| Workflow | Requests | Things to Watch For |
|--------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Script Canvas editor can be launched and configured |
- Open Script Canvas editor by multiple ways including:
- Tools menu
- Script Canvas button in components
- Keyboard shortcut ( a shortcut can be assigned via Edit > Editor Settings > Keyboard Customization > Customize Keyboard)
- Perform resize, maximize, minimize undock, dock actions with Script Canvas editor and its panes and drag them around the Editor.
- Close and reopen the Script Canvas editor.
| - Script Canvas editor not launching quickly or not launching at all.
- Script Canvas Editor not retaining configuration settings on close/relaunch.
- Script Canvas panes not rendering, having rendering issues after being altered.
- Not being able to resize, dock or drag panes borders.
|
| Script Canvas window pane renders a script canvas graph | - Create a new script in Script Canvas editor by multiple ways including:
- Tools menu File > New Script
- Using Ctrl+N shortcut
- By dragging a node from the Node Pallete into an empty graph window
- Close the created script and save it when prompted.
- Open the created script.
- Create multiple new scripts in Script Canvas editor.
| - Modifying an existing file places am asterisk in the graph's tab.
- An asterisk appears on the tab only if a change is made to the file.
- User is always prompted to save a modified file when closing the tab.
- Creating or opening multiple files generates multiple tabs in the main window.
- Creating and having several graphs opened should not impact Script Canvas editor's performance.
- A drop down menu for file selection appears when enough script canvas files are opened.
|
| Script Canvas editor tools can be opened and configured | - Open each of the Script Canvas editor tools.
- Click and try to drag every UI item of the opened tool.
| - Script Canvas tools render properly.
- Tools do not become unresponsive after configuring them.
- UI elements in each of the tools respond when clicked or dragged.
|
| Using basic Script Canvas graph controls | - Create a new script canvas graph file, add a few nodes and perform every action from:
- View menu
- Edit Menu
- File menu
- Perform every control action located in Script Canvas graph window top left corner.
| - Every control action and action from Script Canvas menu bar perform corresponding actions.
- Every control action and action from Script Canvas menu can be performed with associated keyboard shortcut.
- Controls not responding or responding too slowly when used.
- Controls gray out under appropriate circumstances.
- Grayed out controls can not be interacted with.
- A helpful tooltip is generated and rendered properly for each control.
- Tooltips do not go away prematurely.
- Script Canvas graph renders properly after Pan/Zoom actions.
| Opening a Script Canvas graph from older version of the engine | - Obtain a script canvas graph file from an earlier version of O3DE , put it into used project directory and open it with Script Canvas editor.
- Following graph file [OldGraphTest.scriptcanvas](https://github.com/o3de/sig-content/raw/main/testing-guidance/workflow-tests/scripting/scripts/OldGraphTest.scriptcanvas) derived from older o3de development build can be used for this test.
| - Graph from the older version of the engine is processed by Asset Processor without errors and can be opened with Script Canvas editor.
- If [OldGraphTest.scriptcanvas](https://github.com/o3de/sig-content/raw/main/testing-guidance/workflow-tests/scripting/scripts/OldGraphTest.scriptcanvas) was used and assigned to entity upon entering the game mode/simulation mode a message reading _Old Graph test successful_ should appear in the console.
|
| Opening a Script Canvas graph with deprecated nodes | - Obtain a script canvas graph file with deprecated nodes, put it into used project directory and open it with Script Canvas editor.
- Following graph file [ontick.scriptcanvas](https://github.com/o3de/sig-content/raw/main/testing-guidance/workflow-tests/scripting/scripts/ontick.scriptcanvas) derived from older o3de development build can be used for this test.
| - Graph with deprecated nodes is processed by the Asset Processor with errors reminding the user of the deprecated classes but the graph can still be opened with Script Canvas editor.
- When the graph with deprecated nodes is opened in Script Canvas editor it runs validation check on itself and informs the user that listed nodes were updated in order for the graph to work.
- When the graph is saved with proposed updates it is no longer displayed as processed with errors in the Asset Processor.
- If [ontick.scriptcanvas](https://github.com/o3de/sig-content/raw/main/testing-guidance/workflow-tests/scripting/scripts/ontick.scriptcanvas) was used, updated and assigned to entity upon entering the game mode/simulation mode a message reading _OnTick Event:The Sphere position did not change from previous position_ should appear in the console.
|
---
### Area: Default Script Canvas Editor tools
**Project Requirements**
Script Canvas editor opened with the complete list of tools which are:
* Node Palette
* Node Inspector
* Variable Manager
* Minimap
* Graph Validation
* Debugging
* Bookmarks
* Command Line
* Interpreter
**Product:**
Responsive Script Canvas editor with all its tools enabled. No Asset Processor warnings about invalid data or files, no warnings or errors in the Console Log.
**Suggested Time Box:**
60 minutes
| Workflow | Requests | Things to Watch For |
|--------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Use and observe minimap behavior |
- Open or create a graph with multiple nodes
- Drag the minimap view around.
- Switch between multiple graphs.
| - If the minimap does not render or update properly.
- If dragging the minimap view does not cause the effect in main editor window and vice-versa.
|
| Create a variable node with Variable Manager | - Use Variable Manager to create a variable of any type.
- Modify the properties of the variable.
- Drop the variable off the Variable Manager list onto a graph.
- Drag the variable off the Variable Manager list onto a node's input/ouput field (same type).
- Convert a node's input/ouput field to a reference and drag/select variables from the Variable Manager onto it.
| - If variable properties do not update when modified.
- Variable Manager list refreshes and updates properly when variables are created, deleted or modified.
- Node Inspector updates when variables are selected in the Variable Manager.
|
| View and Modify a node with Node Inspector | - Click a node on the graph.
- Modify node values through Node Inspector.
- Add and select different nodes and variables.
- Select multiple nodes at once.
| - Fields and values of nodes are displayed and properly labeled in Node Inspector.
- Changes made through Node Inspector are reflected on the node and vice-versa.
- Selecting multiple nodes at once is reflected in Node Inspector.
|
| Create a graph validation error and warning | - Drag several nodes onto a fresh SC graph and do not connect them.
- Run validation check on the graph.
- Connect nodes and run validation.
- Run the graph validation using dedicated button in Graph Validation pane (checkmark in circle).
| - If Highlighting & Dimming of failing nodes is not updated.
- If warnings and errors are not removed when issue is resolved.
- If conditions that produce an invalid graph do not trigger a warning or error.
| Use the Node Palette to find node types | - Search the Node Palette for a specific node type.
- Use the scrolling view controls to browse nodes.
- Drag a node off the palette onto a new SC graph.
- Use right click context menu on a SC graph to search & browse for nodes.
- Mouse over a node in the palette to display a tooltip.
| - Node palette renders properly when entering/deleting text in search field.
- Node categories can be expanded and collapsed.
|
| Modify Global Preferences | - Open Global Preferences and adjust the time required for certain actions to take place. (for instance Node Coupling, Drag Node Splicing).
- Modify Styling Settings of connections.
- Modify Edge Panning Settings.
| - If nodes are not visually distorted.
- If modification of time requirement for certain actions to take place is not applied.
|
| Using File Menu | - Create a new script.
- Open an existing script.
- Use Save script / save script as... functions to save the script.
- Close script.
- Use available keyboard shortcuts to perform above mentioned actions.
| - If creating a script does not return error in Console.
- Recently saved/created scripts are displayed in "Open Recent" menu.
- Scripts can be saved.
- No errors are printed in the console after saving a script.
- Closing unsaved script displays a message reminding of unsaved changes.
|
| Using Edit Menu | - Undo and redo various actions.
- Manage nodes, groups, notes via Edit Menu by performing following actions:
- Cut
- Copy
- Paste
- Duplicate
- Delete
- Take a screenshot of the graph.
- Select all, inputs, outputs, connected, and clear selections.
- Disable and enable selected nodes.
- Align nodes in various directions.
- Remove unused variables and nodes.
- Use available keyboard shortcuts to perform above mentioned actions.
| - If nodes are not visually distorted.
- Undoing or redoing actions does not cause an assert or errors to be printed in the console.
- Copy-Pasted nodes do retain their modified properties.
|
| Using View Menu | - Zoom graph in and out.
- Show selection:
- individual node
- multiple connected nodes
- group
- notes
- entire graph
- Use "Go to" option to navigate to start and end of the chain (graph must have multiple nodes connected with each other).
- Restore default layout of Script Canvas tool.
- Use available keyboard shortcuts to actions mentioned above.
| - Show selection or show entire graph options are displaying graph accurately.
- Default layout can be restored.
|
| Using Tools Menu | - Open and close tools available in Tools Menu.
- Use available keyboard shortcuts to open and close all tools.
- Perform resize, maximize, minimize, undock and dock actions with all of Script Canvas editor tools and drag them around the Script Canvas editor.
| - Tools are opened after selecting them in Tools Menu.
- Shortcuts can be used to open/close tools.
- The user is able to resize, minimize, maximize, undock, dock or drag Script Canvas editor tools around the Script Canvas editor.
|
| Using Script Events [Preview] Menu |