h1. YAKINDU Statechart Tools – Testcase 02 - Editor

|_. Nr |_. Testname |_. Test Instructions |_. Postconditions |_. Status|
| 2.1 | Create a Java project | <ol><li><p>In the main menu, select _File → New → Project…_.</p></li><li><p>In the _New_ wizard, select _Java → Java Project_.</p></li><li><p>Click on _Next_.</p></li><li><p>Enter @TestProject@ as new project name.</p></li><li><p>Click on _Finish_ to create the project.</p></li></ol> | An new project TestProject is created in the workspace | %{color:red}open% |
| 2.2 | Create a statechart | <ol><li><p>Press <code>[Ctrl-N]</code> to open the _New_ wizard.</p></li><li><p>Expand the _YAKINDU SCT_ tree entry.</p></li><li><p>Select _Statechart Model_.</p></li><li><p>Click on _Next_.</p></li><li><p>Enter @Staircase.sct@ as file name.</p></li><li><p>Click on _Finish_ to create the statechart.</p></li></ol> | The _Confirm Perspective Switch_ dialog opens, suggesting to switch to the _YAKINDU Modeling_ perspective. | %{color:red}open% |
| 2.3 | Complete statechart creating | In the _Confirm Perspective Switch_ dialog, click _Yes_. | <ul><li><p>A file named _Staircase.sct_ is created in the _TestProject_ project and it is shown in _project explorer_ view.</p></li><li><p>The statechart editor displays the definition section (left), the statechart model (center), and the palette (right).</p></li><li><p>The statechart contains a region named _main region_.</p></li><li><p>That region contains an entry point and a transition leading to state *StateA*.</p></li><li><p>There are no warning or error markers.</p></li><li><p>The _problems_ view contains no entries.</p></li><li><p>The palette contains various tools, like _Transition_, _State_, etc.</p></li></ul> | %{color:red}open% |
| 2.4 | Open properties view | <ol><li><p>Right-click on the state to open the context menu.</p></li><li><p>Select _Show Properties View_.</p></li></ol> | The _properties_ view is opened, displaying the selected state's properties. | %{color:red}open% |
| 2.5 | Change state name | <ol><li><p>In the _properties_ view, enter *LightOff* as the new _State Name_, overriding *StateA*.</p></li><li><p>Press @[Tab]@ to change focus.</p></li></ol> | The state's name changes to *LightOff*. | %{color:red}open% |
| 2.6 | Create a new state | <ol><li><p>In the tools palette, click on the _State_ entry.</p></li><li><p>Click inside the region at the position where you want to insert a new state.</p></li><li><p>Change the new state's name to *LightOn*.</p></li></ol> | <ul><li><p>A state named *LightOn* is created in the region.</p></li><li><p>The new state has one error marker, and there's one error entry in the _problems_ view.</p></li><li><p>The error message reads: "Node is not reachable". | %{color:red}open% |
| 2.7 | Create a variable and an event | <ol><li><p>Enter the following code into the statechart's definition section, overriding any existing contents:</p><p>@internal:@<br/>@var light : boolean@</p><p>@interface:@<br/>@in event keypress@</p></li><li><p>Click anywhere outside the definition section so that it now longer has the focus.</p></li></ol> | There are no errors in the definition section. | %{color:red}open% |
| 2.8 | Add actions to states | <ol><li><p>Enter the following code into the state specification of the *LightOff* state, overriding any existing contents:</p><p>@entry / light = false@</p></li><li><p>Enter the following code into the state specification of the *LightOn* state, overriding any existing contents:</p><p>@entry / light = true@</p></li></ol> | There are no additional specification errors aside from the one from above. | %{color:red}open% |
| 2.9 | Create transitions | <ol><li><p>Click on the _Transition_ symbol in the _palette_ view.</p></li><li><p>Click and hold on the *LightOff* state, drag the mouse to the *LightOn* state, and release the mouse button.</p></li><li><p>Enter @keypress@ as trigger, and click outside of the transition specification text to release focus.</p></li><li><p>Create a second transition from the *LightOn* to the *LightOff* state.</p></li><li><p>Enter @after 30s@ as trigger.</p></li></ol> | A new transition with trigger _keypress_ is created. A new transition with trigger _after 30s_ is created. | %{color:red}open% |
| 2.10 | Add additional elements | <ol><li><p>Add elements of the following types to the main region:</p><p>&emsp;- Composite State<br>&emsp;- Orthogonal State<br>&emsp;- Shallow History<br>&emsp;- Deep History<br>&emsp;- Final State<br>&emsp;- Exit Point<br>&emsp;- Choice<br>&emsp;- Synchronization</p></li><li><p>Press <code>[Ctrl+S]</code> to save the statechart to the statechart file.</p></li></ol> | <p>Each element should be drawn correctly (size, color, appearance, etc.).</p><p>Error markers are set correctly, e.g., incoming transitions or names are missing, "Duplicate NamedElement 'xyz' in Region 'main_region'".</p> | %{color:red}open% |
| 2.10.1 | Naming | <ol><li><p>Change the name of: initial entry, shallow history, deep history and exit nodes.</p></li><li><p>Press <code>[Ctrl+S]</code> to save the statechart to the statechart file.</p></li></ol> | The names appear alongside the respective elements. | %{color:red}open% |
| 2.11 | Copy & paste state | <ol><li><p>Select a state.</p></li><li><p>Select _Edit → Copy_ (<code>[Ctrl+C]</code>) to copy the state to the clipboard.</p></li><li><p>Select the main region.</p></li><li><p>Select _Edit → Paste_ (<code>[Ctrl+P]</code>) to paste a copy of the state to the main region.</p></li></ol> | A copy of the state with a synthetic name is added to the main region. Aside from its name and position, the copy is identical to the original state, e.g., local actions, regions etc. | %{color:red}open% |
| 2.12 | Copy & paste region | Select the main region<p>Select _Edit → Copy_ (Ctrl+C) to copy the region</p><p>Select the diagram canvas</p><p>Select _Edit → Paste_ (Ctrl+V) to paste a copy of the region to the canvas</p> | A copy of the region with a synthetic name is added to the diagram canvas. The copy includes copies of everything included in the copied region. | %{color:red}open% |
| 2.13 | Delete & paste state | Select a state<p>Select _Edit → Cut_ (Ctrl+X) to delete the state</p><p>Select the main region</p><p>Select _Edit → Paste_ (Ctrl+V) to paste a copy of the state to the main region</p> | The selected state is deleted.<p>A copy of the deleted state is added to the main region. The copy is identical to the deleted state, including all its contents.</p> | %{color:red}open% |
| 2.14 | Delete & paste region | Select the main region<p>Select _Edit → Cut_ (Ctrl+X) to delete the region</p><p>Select the diagram canvas</p><p>Select _Edit → Paste_ (Ctrl+V) to paste a copy of the region to the canvas</p> | The selected region is deleted.<p>A copy of the deleted region is added to the diagram canvas. The copy is identical to the deleted region, including all its contents.</p> | %{color:red}open% |
| 2.15 | Delete | <ol><li><p>Remove the following elements from the diagram:</p><p>&emsp;- Copied region<br>&emsp;- Elements added in T.2.10</p></li><li><p>Press <code>[Ctrl+S]</code> to save the statechart to the statechart file.</p></li></ol> | All specified elements are removed. | %{color:red}open% |
| 2.16 | Navigator View | <ol><li><p>Switch to the _SC Modeling_ perspective.</p></li><li><p>In the project explorer, expand the _Staircase.sct_ file.</p></li></ol> | The project explorer shows the _Staircase.sct_ file with a single child element _Statechart Staircase_, which has an icon on the left-hand side. | %{color:red}open% |
| 2.16.1 | Navigator View | Expand the _Statechart Staircase_ entry in the tree view. | <p>The following child entries are displayed:</p><ul><li><p>_Interface Scope_</p></li><li><p>_Internal Scope_</p></li><li><p>_Region main region_</p></li></ul> | %{color:red}open% |
| 2.16.2 | Navigator View | Expand the _Interface Scope_ entry in the tree view. | The _keypress_ event is shown as a child with an icon. | %{color:red}open% |
| 2.16.3 | Navigator View | Expand the _Internal Scope_ entry in the tree view. | The _light_ variable is shown as a child with an icon. | %{color:red}open% |
| 2.16.4 | Navigator View | Expand the _Region main region_ entry in the tree view. | The initial state and the *LightOff* and *LightOn* states are displayed as children with icons. | %{color:red}open% |
| 2.16.5 | Navigator View | Expand both states entries in the tree view. | The outgoing transitions of the states are displayed with their respective source state, target state, and specification. | %{color:red}open% |
| 2.17 | View | Press <code>[Ctrl++]</code> to zoom in and <code>[Ctrl+-]</code> to zoom out. | The view should zoom in and out. | %{color:red}open% |
| 2.18 | Undo & Redo | <ol><li><p>Select a region which includes at least one state with an outgoing transition.</p></li><li><p>Press @[Del]@ to delete the region.</p></li><li><p>Press <code>[Ctrl+Z]</code> to undo the deletion.</p></li><li><p>Press <code>[Ctrl+Y]</code> (Windows), <code>[Shift+Ctrl+Z]</code> (Linux), or <code>[Shift+Cmd+Z]</code> (Mac) to redo the deletion.</p></li><li><p>Try to move the affected element by dragging.</p></li></ol> | The deletion should properly be undone and redone<p> The elements involved during undo and redo have to be still changeable (move, delete change e.g., name) afterwards | %{color:red}open% |
| 2.19 | Tasks | <ol><li><p>Import the project from the _test-plugins/org.yakindu.sct.model.resource.test_ directory in your YAKINDU Statechart Tools source code repository.</p></li><li><p>Open the file _testdata/Tasks.sct_ in that project.</p></li></ol> | Text lines containing @FIXME@ or @TODO@ in the model are shown in the tasks view. | %{color:red}open% |
| 2.20 | Breadcrumb | <ol><li><p>Import and open the model _test-plugins/org.yakindu.sct.test.manual/testmodels/SimpleWithSubDiagrams.sct_</p></li><li><p>Open all sub-diagrams in own tabs and arrange them in a way you can see all breadcrumbs </p></li><li><p>After that change the statecharts name, and names of states with sub-diagrams included </p></li></ol> | The breadcrumb labels have to change simultaneously after the change is applied. | %{color:red}open% |