blob: a41b57d4f4dda070ad12cce37dc9ab8bb7cfddee [file] [log] [blame]
Jonas Helminga9ff5ee2017-11-24 12:36:39 +01001--- RCPTT testcase ---
2Format-Version: 1.0
3Contexts: _D4Pj4C3lEeSwhO5Nwx0hPg,_Iu0EsS36EeSYRYqCbC6LMQ
4Element-Name: TableControlMoveUpDownTooling
5Element-Type: testcase
6Element-Version: 3.0
7External-Reference:
8Id: _2IkQMNnHEee0McrTbR2zPw
Eugen Neufeld63674ba2020-07-23 12:02:29 +02009Runtime-Version: 2.5.2.202006292356
10Save-Time: 7/23/20 10:24 AM
Jonas Helminga9ff5ee2017-11-24 12:36:39 +010011Testcase-Type: ecl
12
13------=_.content-0a7243a0-75d3-3d5f-9791-539de0e5b7ac
14Content-Type: text/ecl
15Entry-Name: .content
16
Eugen Neufeld3418c112018-07-26 00:49:58 +020017get-view "Project Explorer" | get-tree
18 | select "org.eclipse.emf.ecp.makeithappen.model.viewmodel/viewmodels/UserGroup.view"
19 | select "org.eclipse.emf.ecp.makeithappen.model.viewmodel/viewmodels/UserGroup.view" | get-menu
20 -path "Open With/View Model Editor" | click
Jonas Helminga9ff5ee2017-11-24 12:36:39 +010021with [get-editor "UserGroup.view"] {
22 with [get-tree] {
23 select View | get-menu -path TableControl | click
24 select "View/TableControl"
25 }
26 get-button "Create and link new Domain Model Reference" | click
27}
28with [get-window "Configure TableDomainModelReference"] {
29 get-button "Create and link new Domain Model Reference" | click
30 with [get-window "New Reference Element"] {
31 get-tree | select "model/FeaturePathDomainModelReference" | double-click
32 get-button "Next >" | click
33 get-button "Link Domain Model EFeature" | click
34 with [get-window "Select a EStructuralFeature"] {
35 get-tree | select "users : User" | double-click
36 get-button OK | click
37 }
38 get-button Finish | click
39 }
40 get-button Finish | click
41}
42get-view "EMF Forms Preview" | get-button "Refresh Preview View" | click
43
44get-editor "UserGroup.view" | get-button -after [get-label "Move Up Down Disabled*"] | get-property selected
45 | equals true | verify-true
46with [get-view "EMF Forms Preview" | get-control Any -after [get-label "View Editor Preview"] -index 13] {
47 //only two buttons: add/remove
48 get-property "getChildren().Control[2].getChildren().length" | equals 2 | verify-true
49 get-property "getChildren().Control[2].getChildren().Control[0].getClassName()"
50 | equals "org.eclipse.swt.widgets.Button" | verify-true
51 get-property "getChildren().Control[2].getChildren().Control[0].isVisible()" | equals true | verify-true
Eugen Neufeld63674ba2020-07-23 12:02:29 +020052 get-property "getChildren().Control[2].getChildren().Control[0].getToolTipText()" | equals "Add an instance of User"
Jonas Helminga9ff5ee2017-11-24 12:36:39 +010053 | verify-true
54 get-property "getChildren().Control[2].getChildren().Control[0].isEnabled()" | equals true | verify-true
55 get-property "getChildren().Control[2].getChildren().Control[1].getClassName()"
56 | equals "org.eclipse.swt.widgets.Button" | verify-true
57 get-property "getChildren().Control[2].getChildren().Control[1].isVisible()" | equals true | verify-true
Eugen Neufeld63674ba2020-07-23 12:02:29 +020058 get-property "getChildren().Control[2].getChildren().Control[1].getToolTipText()" | equals "Remove the selected User"
Jonas Helminga9ff5ee2017-11-24 12:36:39 +010059 | verify-true
60 get-property "getChildren().Control[2].getChildren().Control[1].isEnabled()" | equals false | verify-true
61}
62get-editor "UserGroup.view" | get-button -after [get-label "Move Up Down Disabled*"] | uncheck
63get-view "EMF Forms Preview" | get-button "Refresh Preview View" | click
64with [get-view "EMF Forms Preview" | get-control Any -after [get-label "View Editor Preview"] -index 13] {
65 //4 buttons: up/down, add/remove
66 get-property "getChildren().Control[2].getChildren().length" | equals 4 | verify-true
67 get-property "getChildren().Control[2].getChildren().Control[0].getClassName()"
68 | equals "org.eclipse.swt.widgets.Button" | verify-true
69 get-property "getChildren().Control[2].getChildren().Control[0].isVisible()" | equals true | verify-true
Eugen Neufeld63674ba2020-07-23 12:02:29 +020070 get-property "getChildren().Control[2].getChildren().Control[0].getToolTipText()" | equals "Move up the selected User"
Jonas Helminga9ff5ee2017-11-24 12:36:39 +010071 | verify-true
72 get-property "getChildren().Control[2].getChildren().Control[0].isEnabled()" | equals false | verify-true
73 get-property "getChildren().Control[2].getChildren().Control[1].getClassName()"
74 | equals "org.eclipse.swt.widgets.Button" | verify-true
75 get-property "getChildren().Control[2].getChildren().Control[1].isVisible()" | equals true | verify-true
Eugen Neufeld63674ba2020-07-23 12:02:29 +020076 get-property "getChildren().Control[2].getChildren().Control[1].getToolTipText()" | equals "Move down the selected User"
Jonas Helminga9ff5ee2017-11-24 12:36:39 +010077 | verify-true
78 get-property "getChildren().Control[2].getChildren().Control[1].isEnabled()" | equals false | verify-true
79 get-property "getChildren().Control[2].getChildren().Control[2].getClassName()"
80 | equals "org.eclipse.swt.widgets.Button" | verify-true
81 get-property "getChildren().Control[2].getChildren().Control[2].isVisible()" | equals true | verify-true
Eugen Neufeld63674ba2020-07-23 12:02:29 +020082 get-property "getChildren().Control[2].getChildren().Control[2].getToolTipText()" | equals "Add an instance of User"
Jonas Helminga9ff5ee2017-11-24 12:36:39 +010083 | verify-true
84 get-property "getChildren().Control[2].getChildren().Control[2].isEnabled()" | equals true | verify-true
85 get-property "getChildren().Control[2].getChildren().Control[3].getClassName()"
86 | equals "org.eclipse.swt.widgets.Button" | verify-true
87 get-property "getChildren().Control[2].getChildren().Control[3].isVisible()" | equals true | verify-true
Eugen Neufeld63674ba2020-07-23 12:02:29 +020088 get-property "getChildren().Control[2].getChildren().Control[3].getToolTipText()" | equals "Remove the selected User"
Jonas Helminga9ff5ee2017-11-24 12:36:39 +010089 | verify-true
90 get-property "getChildren().Control[2].getChildren().Control[3].isEnabled()" | equals false | verify-true
91}
92
93//add items to table
94with [get-view "EMF Forms Preview"] {
Eugen Neufeld63674ba2020-07-23 12:02:29 +020095 with [get-button "Add an instance of User"] {
Jonas Helminga9ff5ee2017-11-24 12:36:39 +010096 click
97 click
98 click
99 }
100 with [get-table] {
101 select Male -column Gender | activate-cell-edit -column 1 -type MouseClickSelection
102 get-editbox | set-text qwe
103 select Male -column Gender | apply-cell-edit -deactivate
104 select qwe -column "First Name" | activate-cell-edit -column 2 -type MouseClickSelection
105 get-editbox | set-text rtz
106 select [get-item -path Male -column Gender -index 1] | apply-cell-edit -deactivate
107 select [get-item -path Male -column Gender -index 1] | activate-cell-edit -column 1 -type MouseClickSelection
108 get-editbox | set-text asd
109 select [get-item -path Male -column Gender -index 1] | apply-cell-edit -deactivate
110 select asd -column "First Name" | activate-cell-edit -column 2 -type MouseClickSelection
111 get-editbox | set-text fgh
112 select [get-item -path Male -column Gender -index 2] | apply-cell-edit -deactivate
113 select [get-item -path Male -column Gender -index 2] | activate-cell-edit -column 1 -type MouseClickSelection
114 get-editbox | set-text yxc
115 select [get-item -path Male -column Gender -index 2] | apply-cell-edit -deactivate
116 select yxc -column "First Name" | activate-cell-edit -column 2 -type MouseClickSelection
117 get-editbox | set-text vbn
118 apply-cell-edit -deactivate
119 }
120}
121with [get-view "EMF Forms Preview" | get-table] {
122 get-cell -row 0 -column 2 | get-property "values['Last Name']" | equals rtz | verify-true
123 get-cell -row 1 -column 2 | get-property "values['Last Name']" | equals fgh | verify-true
124 get-cell -row 2 -column 2 | get-property "values['Last Name']" | equals vbn | verify-true
125}
126
127//move UP
128with [get-view "EMF Forms Preview"] {
129 get-table | select asd -column "First Name"
Eugen Neufeld63674ba2020-07-23 12:02:29 +0200130 get-button "Move up the selected User" | click
Jonas Helminga9ff5ee2017-11-24 12:36:39 +0100131}
132with [get-view "EMF Forms Preview" | get-table] {
133 get-cell -row 0 -column 2 | get-property "values['Last Name']" | equals fgh | verify-true
134 get-cell -row 1 -column 2 | get-property "values['Last Name']" | equals rtz | verify-true
135 get-cell -row 2 -column 2 | get-property "values['Last Name']" | equals vbn | verify-true
136}
137
Eugen Neufeld3418c112018-07-26 00:49:58 +0200138//assert first item UP is disabled
Jonas Helminga9ff5ee2017-11-24 12:36:39 +0100139with [get-view "EMF Forms Preview"] {
140 get-table | select asd -column "First Name"
Eugen Neufeld63674ba2020-07-23 12:02:29 +0200141 get-button "Move up the selected User" | get-property enablement | equals false | verify-true
Jonas Helminga9ff5ee2017-11-24 12:36:39 +0100142}
143
Eugen Neufeld3418c112018-07-26 00:49:58 +0200144//assert last item DOWN is disabled
Jonas Helminga9ff5ee2017-11-24 12:36:39 +0100145with [get-view "EMF Forms Preview"] {
146 get-table | select yxc -column "First Name"
Eugen Neufeld63674ba2020-07-23 12:02:29 +0200147 get-button "Move down the selected User" | get-property enablement | equals false | verify-true
Jonas Helminga9ff5ee2017-11-24 12:36:39 +0100148}
149
150//move second item DOWN
151with [get-view "EMF Forms Preview"] {
152 get-table | select qwe -column "First Name"
Eugen Neufeld63674ba2020-07-23 12:02:29 +0200153 get-button "Move down the selected User" | click
Jonas Helminga9ff5ee2017-11-24 12:36:39 +0100154}
155with [get-view "EMF Forms Preview" | get-table] {
156 get-cell -row 0 -column 2 | get-property "values['Last Name']" | equals fgh | verify-true
157 get-cell -row 1 -column 2 | get-property "values['Last Name']" | equals vbn | verify-true
158 get-cell -row 2 -column 2 | get-property "values['Last Name']" | equals rtz | verify-true
159}
160
161//check that ordering is disabled for the table header
162get-view "EMF Forms Preview" | get-table | get-column-header "Last Name" | click
163with [get-view "EMF Forms Preview" | get-table] {
164 get-cell -row 0 -column 2 | get-property "values['Last Name']" | equals fgh | verify-true
165 get-cell -row 1 -column 2 | get-property "values['Last Name']" | equals vbn | verify-true
166 get-cell -row 2 -column 2 | get-property "values['Last Name']" | equals rtz | verify-true
167}
168
169//disable UP/DOWN buttons -> sorting from table header should be enabled
170get-editor "UserGroup.view" | get-button -after [get-label "Move Up Down Disabled*"] | check
171get-view "EMF Forms Preview" | get-button "Refresh Preview View" | click
172get-view "EMF Forms Preview" | get-table | get-column-header "First Name" | click
173with [get-view "EMF Forms Preview" | get-table] {
174 get-cell -row 0 -column 1 | get-property "values['First Name']" | equals asd | verify-true
175 get-cell -row 1 -column 1 | get-property "values['First Name']" | equals qwe | verify-true
176 get-cell -row 2 -column 1 | get-property "values['First Name']" | equals yxc | verify-true
177}
178------=_.content-0a7243a0-75d3-3d5f-9791-539de0e5b7ac--