2 # ---------------------------------------------------------
6 # Purpose: test cases for ui test
10 # Maintainer: jd@suse.de
12 # Remarks: Always the user interaction is removed:
13 # any answer = UserInput();
14 # Furthermore the tested action is set into a loop
16 # ---------------------------------------------------------
21 // Syntax: VBox( [Id id, ] widget1, widget2, ... )
23 // A VBox is used to give the UI a hint about how to
24 // organize the dialog. All widgets listed inside the VBox
25 // are laid out from top to bottom.
27 // A VBox can have an Id. This Id will be added as a prefix
28 // to all widget Ids within the VBox.
30 // This example shows a VBox which organizes 4 checkboxes
37 define Check( boolean CheckBoxTwoState )
39 return( ( is( CurrentMap, map ) == true ) &&
40 ( size( CurrentMap ) == 4 ) &&
41 ( select( CurrentMap, 0 ) == [`Id("cb1"), false] ) &&
42 ( select( CurrentMap, 1 ) == [`Id("cb2"), CheckBoxTwoState] ) &&
43 ( select( CurrentMap, 2 ) == [`Id("cb3"), false] ) &&
44 ( select( CurrentMap, 3 ) == [`Id("cb4"), false] ) );
48 // the display function ShowDialog() is called without parameters
51 any ok = `HBox(`Stretch(), `Pushbutton(`Id("ok"), "OK"), `Stretch());
56 any dialog = OpenDialog( `VBox(
58 `Checkbox(`Id("cb1"), "Option1"),
59 `Checkbox(`Id("cb2"), "Option2"),
60 `Checkbox(`Id("cb3"), "Option3"),
61 `Checkbox(`Id("cb4"), "Option4")
67 any CurrentMap = QueryDialog( dialog );
70 if( Check( false ) == false ) return false;
76 // the display function ShowDialog() is called with the dialog parameter
79 any ok = `HBox(`Stretch(), `Pushbutton(`Id("ok"), "OK"), `Stretch());
84 any dialog = Dialog( `VBox(
86 `Checkbox(`Id("cb1"), "Option1"),
87 `Checkbox(`Id("cb2"), "Option2"),
88 `Checkbox(`Id("cb3"), "Option3"),
89 `Checkbox(`Id("cb4"), "Option4")
95 any CurrentMap = QueryDialog( dialog );
96 CloseDialog( dialog );
98 if( Check( false ) == false ) return false;
104 // the display function ShowDialog() is called with the dialog itself
107 any ok = `HBox(`Stretch(), `Pushbutton(`Id("ok"), "OK"), `Stretch());
115 `Checkbox(`Id("cb1"), "Option1"),
116 `Checkbox(`Id("cb2"), "Option2", true),
117 `Checkbox(`Id("cb3"), "Option3"),
118 `Checkbox(`Id("cb4"), "Option4", false)
122 any CurrentMap = QueryDialog( );
125 if( Check( true ) == false ) return false;