File: test_Workspace.js

package info (click to toggle)
itksnap 3.4.0-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 10,196 kB
  • ctags: 9,196
  • sloc: cpp: 62,895; sh: 175; makefile: 13
file content (40 lines) | stat: -rw-r--r-- 1,330 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// Read the function library
include("Library");

// Open the test workspace
openWorkspace("tensor.itksnap");

//=== Show the layer inspector
engine.findChild(mainwin,"actionLayerInspector").trigger();

//=== Select a specific overlay
var layerdialog = engine.findChild(mainwin,"dlgLayerInspector");
var rowdelegate = engine.findChild(layerdialog, "wgtRowDelegate_0003");
rowdelegate.setSelected(true);

//=== Toggle the layout
engine.findChild(layerdialog, "actionLayoutToggle").trigger();

//=== Go to the color map widget
var cmpcolormap = engine.findChild(layerdialog, "cmpColorMap");
engine.findChild(layerdialog, "tabWidget").setCurrentWidget(cmpcolormap);

//=== Select the color map preset we want
var inpreset = engine.findChild(cmpcolormap, "inPreset");
inpreset.setCurrentIndex(8);

//=== Close the inspector dialog
layerdialog.close();

//=== Trigger the unload all action
engine.findChild(mainwin,"actionUnload_All").trigger();

//=== Check that the unsaved changes dialog is open
var savedialog = engine.findWidget("dlgSaveModified");
if(!savedialog.visible)
    engine.testFailed("Saved dialog was not shown")

//=== Count the number of entries in the dialog
var layertable = engine.findChild(savedialog, "tableLayers");
var entry = engine.tableItemText(layertable, 0, 0);
engine.validateValue(entry, "Workspace");