|
| 1 | +--- RCPTT testcase --- |
| 2 | +Format-Version: 1.0 |
| 3 | +Contexts: _mo5J8IfaEe2N1bfX2b9TRQ |
| 4 | +Element-Name: DependencyEditorTest |
| 5 | +Element-Type: testcase |
| 6 | +Element-Version: 3.0 |
| 7 | +External-Reference: |
| 8 | +Id: _WA75MIfaEe2N1bfX2b9TRQ |
| 9 | +Runtime-Version: 2.5.4.202210020716 |
| 10 | +Save-Time: 2/3/23, 7:35 PM |
| 11 | +Tags: org.eclipse.m2e.pde.ui |
| 12 | +Testcase-Type: ecl |
| 13 | +Verifications: _7el9kIfGEe2DibE_7T1Sqw |
| 14 | + |
| 15 | +------=_.content-0a7243a0-75d3-3d5f-9791-539de0e5b7ac |
| 16 | +Content-Type: text/ecl |
| 17 | +Entry-Name: .content |
| 18 | + |
| 19 | +with [get-view "Project Explorer" | get-tree] { |
| 20 | + select "target-platform" | double-click |
| 21 | + select "target-platform/target-platform.target" | double-click |
| 22 | +} |
| 23 | + |
| 24 | +with [get-editor "target-platform.target" | get-section Locations | get-tree] { |
| 25 | + get-item -path "Maven Central.*" | click |
| 26 | + select "Maven Central.*" | double-click |
| 27 | +} |
| 28 | + |
| 29 | +with [get-window "Maven Artifact Target Entry - Maven Central"] { |
| 30 | + // Check the initial button enablement. All buttons except Undo/Redo should be enabled. |
| 31 | + get-button Add | get-property enablement | equals true | verify-true |
| 32 | + get-button Remove | get-property enablement | equals true | verify-true |
| 33 | + get-button Update | get-property enablement | equals true | verify-true |
| 34 | + get-button Undo | get-property enablement | equals false | verify-true |
| 35 | + get-button Redo | get-property enablement | equals false | verify-true |
| 36 | + |
| 37 | + // #################################################################### // |
| 38 | + // // |
| 39 | + // [I] Check behavior of the Add button with and without the clipboard // |
| 40 | + // // |
| 41 | + // #################################################################### // |
| 42 | + |
| 43 | + to-clipboard -input "" |
| 44 | + |
| 45 | + // Click add -> Create blank dependency |
| 46 | + get-button Add | click -metaKeys "" |
| 47 | + |
| 48 | + // Invalid GAV -> Update & Finish button should be disabled |
| 49 | + get-button Update | get-property enablement | equals false | verify-true |
| 50 | + get-button Finish | get-property enablement | equals false | verify-true |
| 51 | + |
| 52 | + // Check error messages |
| 53 | + get-editbox -after [get-label "Edit Maven Dependency"] | get-property text |
| 54 | + | equals "The target location contains one or more incomplete Maven dependencies.\n" |
| 55 | + + " Each dependency requires a group id, artifact id, version and type." | verify-true |
| 56 | + |
| 57 | + get-label "" -after [get-label "Edit Maven Dependency"] |
| 58 | + | get-property "image.path" | equals "org.eclipse.jface/icons/full/message_error.png" | verify-true |
| 59 | + |
| 60 | + with [get-table | get-item -path "<required>"] { |
| 61 | + get-property "columns[0]" | equals "<required>" | verify-true |
| 62 | + get-property "columns[1]" | equals "<required>" | verify-true |
| 63 | + get-property "columns[2]" | equals "<required>" | verify-true |
| 64 | + } |
| 65 | + |
| 66 | + // Fill the row with meaningful data... |
| 67 | + with [get-window "Maven Artifact Target Entry - Maven Central" | get-table] { |
| 68 | + get-property "getItems().TableItem[19].getData().getClassifier()" | equals "" | verify-true |
| 69 | + get-property "getItems().TableItem[19].getData().getType()" | equals jar | verify-true |
| 70 | + get-property "getItems().TableItem[19].getData().getVersion()" | equals "" | verify-true |
| 71 | + get-property "getItems().TableItem[19].getData().getGroupId()" | equals "" | verify-true |
| 72 | + get-property "getItems().TableItem[19].getData().getArtifactId()" | equals "" | verify-true |
| 73 | + // Check selection |
| 74 | + get-property "getSelectionCount()" | equals 1 | verify-true |
| 75 | + get-property "getSelection().TableItem[0].getData().getKey()" | equals "::jar:" | verify-true |
| 76 | + // Set GAV to org.apache.commons:commons-lang3:3.12.0 |
| 77 | + select "<required>" | activate-cell-edit -type MouseClickSelection |
| 78 | + get-editbox | set-text "org.apache.commons" |
| 79 | + select "<required>" | apply-cell-edit -deactivate |
| 80 | + select "org.apache.commons" | activate-cell-edit -column 1 -type MouseClickSelection |
| 81 | + get-editbox | set-text "commons-lang3" |
| 82 | + select "org.apache.commons" | apply-cell-edit -deactivate |
| 83 | + select "org.apache.commons" | activate-cell-edit -column 2 -type MouseClickSelection |
| 84 | + get-editbox | set-text "3.12.0" |
| 85 | + apply-cell-edit -deactivate |
| 86 | + select "org.apache.commons" | activate-cell-edit -column 3 -type MouseClickSelection |
| 87 | + } |
| 88 | + |
| 89 | + //Valid GAV -> Update & Finish button should now be enabled again |
| 90 | + get-button Update | get-property enablement | equals true | verify-true |
| 91 | + get-button Finish | get-property enablement | equals true | verify-true |
| 92 | + |
| 93 | + to-clipboard -input "<dependency>\ |
| 94 | + <groupId>org.eclipse.platform</groupId>\ |
| 95 | + <artifactId>org.eclipse.core.runtime</artifactId>\ |
| 96 | + <version>3.26.100</version>\ |
| 97 | + </dependency>" |
| 98 | + |
| 99 | + // Click add -> Copy dependency from clipboard |
| 100 | + get-button Add | click -metaKeys "" |
| 101 | + |
| 102 | + with [get-window "Maven Artifact Target Entry - Maven Central" | get-table] { |
| 103 | + get-property "getItems().TableItem[20].getData().getClassifier()" | equals "" | verify-true |
| 104 | + get-property "getItems().TableItem[20].getData().getType()" | equals jar | verify-true |
| 105 | + get-property "getItems().TableItem[20].getData().getVersion()" | equals "3.26.100" | verify-true |
| 106 | + get-property "getItems().TableItem[20].getData().getGroupId()" | equals "org.eclipse.platform" | verify-true |
| 107 | + get-property "getItems().TableItem[20].getData().getArtifactId()" | equals "org.eclipse.core.runtime" |
| 108 | + | verify-true |
| 109 | + // Check selection |
| 110 | + get-property "getSelectionCount()" | equals 1 | verify-true |
| 111 | + get-property "getSelection().TableItem[0].getData().getKey()" |
| 112 | + | equals "org.eclipse.platform:org.eclipse.core.runtime:jar:3.26.100" | verify-true |
| 113 | + } |
| 114 | + |
| 115 | + // Check whether you can edit the remaining columns directly. I.e. whether SWT.FULL_SELECTION is enabled. |
| 116 | + with [get-table] { |
| 117 | + select "org.eclipse.jdt" | activate-cell-edit -type MouseClickSelection |
| 118 | + get-editbox | set-text newGroupId |
| 119 | + select "org.apache.commons" | apply-cell-edit -deactivate |
| 120 | + select newGroupId | activate-cell-edit -column 1 -type MouseClickSelection |
| 121 | + get-editbox | set-text newArtifactId |
| 122 | + select "jakarta.xml.bind" | apply-cell-edit -deactivate |
| 123 | + select "jakarta.xml.bind" | activate-cell-edit -column 2 -type MouseClickSelection |
| 124 | + get-editbox | set-text newVersion |
| 125 | + apply-cell-edit -deactivate |
| 126 | + } |
| 127 | + |
| 128 | + // ############################################################################# // |
| 129 | + // // |
| 130 | + // [II] Check behavior of the Update button with one more more selected elements // |
| 131 | + // // |
| 132 | + // ############################################################################# // |
| 133 | + |
| 134 | + // Select org.jetbrains.kotlin:kotlin-stdlib-common -> Click Update |
| 135 | + with [get-table] { |
| 136 | + select "org.jetbrains.kotlin" | activate-cell-edit -type MouseClickSelection |
| 137 | + get-editbox | click-text 1 21 |
| 138 | + cancel-cell-edit |
| 139 | + deactivate-cell-edit |
| 140 | + } |
| 141 | + |
| 142 | + get-button Update | click -metaKeys "" |
| 143 | + |
| 144 | + with [get-table] { |
| 145 | + get-property "getItems().TableItem[12].getData().getVersion()" | equals "1.7.22" | verify-false |
| 146 | + } |
| 147 | + |
| 148 | + // Select org.jetbrains.kotlin:kotlin-stdlib-jdk7 to org.jetbrains.kotlin:kotlin-stdlib -> Click Update |
| 149 | + with [get-table] { |
| 150 | + select [get-item -path "org.jetbrains.kotlin" -index 1] | activate-cell-edit -type MouseClickSelection |
| 151 | + get-editbox | click-text 1 21 |
| 152 | + cancel-cell-edit |
| 153 | + deactivate-cell-edit |
| 154 | + select [get-item -path "org.jetbrains.kotlin" -index 3] [get-item -path "org.jetbrains.kotlin" |
| 155 | + -index 2] [get-item -path "org.jetbrains.kotlin" -index 1] |
| 156 | + } |
| 157 | + |
| 158 | + get-button Update | click -metaKeys "" |
| 159 | + |
| 160 | + with [get-table] { |
| 161 | + get-property "getItems().TableItem[13].getData().getVersion()" | equals "1.7.22" | verify-false |
| 162 | + get-property "getItems().TableItem[14].getData().getVersion()" | equals "1.7.22" | verify-false |
| 163 | + get-property "getItems().TableItem[15].getData().getVersion()" | equals "1.7.22" | verify-false |
| 164 | + } |
| 165 | + |
| 166 | + // ########################################################################## // |
| 167 | + // // |
| 168 | + // [III] Check behavior of the Remove button on one or more selected elements // |
| 169 | + // // |
| 170 | + // ########################################################################## // |
| 171 | + |
| 172 | + // Selected and remove com.fasterxml.jackson.core:jackson-annotations to com.fasterxml.jackson.core:jackson-databind |
| 173 | + with [get-table] { |
| 174 | + select "com.fasterxml.jackson.core" | activate-cell-edit -type MouseClickSelection |
| 175 | + get-editbox | click-text 1 27 |
| 176 | + cancel-cell-edit |
| 177 | + deactivate-cell-edit |
| 178 | + select [get-item -path "com.fasterxml.jackson.core" -index 2] [get-item -path "com.fasterxml.jackson.core" |
| 179 | + -index 1] "com.fasterxml.jackson.core" |
| 180 | + } |
| 181 | + |
| 182 | + get-button Remove | click -metaKeys "" |
| 183 | + |
| 184 | + // The selected elements should no longer be in the table, with com.github.ben-manes.caffeine:caffeine being the first element |
| 185 | + with [get-table] { |
| 186 | + get-property "getSelection().length" | equals 0 |
| 187 | + get-property "getItemCount()" | equals 18 | verify-true |
| 188 | + get-property "getItems().TableItem[0].getText()" | equals "com.github.ben-manes.caffeine" | verify-true |
| 189 | + } |
| 190 | + |
| 191 | + get-button Undo | click -metaKeys "" |
| 192 | + |
| 193 | + // The artifacts com.fasterxml.jackson.core:jackson-annotations to com.fasterxml.jackson.core:jackson-databind are back and selected |
| 194 | + with [get-table] { |
| 195 | + get-property "getItemCount()" | equals 21 | verify-true |
| 196 | + get-property "getSelection().length" | equals 3 | verify-true |
| 197 | + get-property "getSelection().TableItem[0].getData().getKey()" |
| 198 | + | equals "com.fasterxml.jackson.core:jackson-annotations:jar:2.14.1" | verify-true |
| 199 | + get-property "getSelection().TableItem[1].getData().getKey()" |
| 200 | + | equals "com.fasterxml.jackson.core:jackson-core:jar:2.14.1" | verify-true |
| 201 | + get-property "getSelection().TableItem[2].getData().getKey()" |
| 202 | + | equals "com.fasterxml.jackson.core:jackson-databind:jar:2.14.1" | verify-true |
| 203 | + } |
| 204 | + |
| 205 | + // Select and remove com.squareup.okio:okio-jvm |
| 206 | + with [get-table] { |
| 207 | + select "com.squareup.okio" | activate-cell-edit -type MouseClickSelection |
| 208 | + get-editbox | click-text 1 18 |
| 209 | + cancel-cell-edit |
| 210 | + deactivate-cell-edit |
| 211 | + } |
| 212 | + |
| 213 | + get-button Remove | click -metaKeys "" |
| 214 | + |
| 215 | + // The artifact jakarta.activation:jakarta.activation-api should now be selected, because it now at the same position as the removed element |
| 216 | + with [get-table] { |
| 217 | + get-property "getSelection().length" | equals 1 | verify-true |
| 218 | + get-property "getSelection().TableItem[0].getData().getKey()" |
| 219 | + | equals "jakarta.activation:jakarta.activation-api:jar:1.2.2" | verify-true |
| 220 | + } |
| 221 | + |
| 222 | + // ############################################ // |
| 223 | + // // |
| 224 | + // [IV] Check behavior when sorting by columns // |
| 225 | + // // |
| 226 | + // ############################################ // |
| 227 | + |
| 228 | + with [get-table] { |
| 229 | + // Sort by Version -> jakarta.inject:jakarta.inject-api should be first element |
| 230 | + get-column-header Version | click |
| 231 | + get-property "getItems().TableItem[0].getData().getKey()" | equals "jakarta.inject:jakarta.inject-api:jar:1.0.5" |
| 232 | + | verify-true |
| 233 | + // Sort by Artifact Id -> com.github.ben-manes.caffeine:caffeine should be the first element |
| 234 | + get-column-header "Artifact Id" | click |
| 235 | + get-property "getItems().TableItem[0].getData().getKey()" |
| 236 | + | equals "com.github.ben-manes.caffeine:caffeine:jar:3.1.2" | verify-true |
| 237 | + // Sort by Group Id -> com.fasterxml.jackson.core:jackson-annotations should be the first element |
| 238 | + get-column-header "Group Id" | click |
| 239 | + get-property "getItems().TableItem[0].getData().getKey()" |
| 240 | + | equals "com.fasterxml.jackson.core:jackson-annotations:jar:2.14.1" | verify-true |
| 241 | + } |
| 242 | + |
| 243 | + // Check whether dependencies are inserted into the correct position when the table is sorted |
| 244 | + to-clipboard -input "<dependency>\ |
| 245 | + <groupId>com.fasterxml.jackson.core</groupId>\ |
| 246 | + <artifactId>jackson-databind</artifactId>\ |
| 247 | + <version>2.14.0</version>\ |
| 248 | + </dependency>" |
| 249 | + |
| 250 | + get-button Add | click -metaKeys "" |
| 251 | + |
| 252 | + with [get-table] { |
| 253 | + get-property enablement | equals true | verify-true |
| 254 | + get-property "getItems().TableItem[2].getData().getKey()" |
| 255 | + | equals "com.fasterxml.jackson.core:jackson-databind:jar:2.14.0" | verify-true |
| 256 | + } |
| 257 | + |
| 258 | + // ################################## // |
| 259 | + // // |
| 260 | + // [V] Check multi-selection behavior // |
| 261 | + // // |
| 262 | + // ################################## // |
| 263 | + |
| 264 | + // Make sure items don't get lost when selecting more than one element |
| 265 | + with [get-table] { |
| 266 | + // Forward selection |
| 267 | + select "com.fasterxml.jackson.core" | activate-cell-edit -type MouseClickSelection |
| 268 | + get-editbox | click-text 1 27 |
| 269 | + cancel-cell-edit |
| 270 | + deactivate-cell-edit |
| 271 | + select "com.github.ben-manes.caffeine" [get-item -path "com.fasterxml.jackson.core" -index 3] [get-item |
| 272 | + -path "com.fasterxml.jackson.core" -index 2] [get-item -path "com.fasterxml.jackson.core" |
| 273 | + -index 1] "com.fasterxml.jackson.core" |
| 274 | + |
| 275 | + get-property "selection[0].path[0]" | equals "com.fasterxml.jackson.core" | verify-true |
| 276 | + get-property "selection[1].path[0]" | equals "com.fasterxml.jackson.core%1%" | verify-true |
| 277 | + get-property "selection[2].path[0]" | equals "com.fasterxml.jackson.core%2%" | verify-true |
| 278 | + get-property "selection[3].path[0]" | equals "com.fasterxml.jackson.core%3%" | verify-true |
| 279 | + get-property "selection[4].path[0]" | equals "com.github.ben-manes.caffeine" | verify-true |
| 280 | + |
| 281 | + // Backward selection |
| 282 | + select [get-item -path "org.slf4j" -index 2] | activate-cell-edit -type MouseClickSelection |
| 283 | + get-editbox | click-text 1 10 |
| 284 | + cancel-cell-edit |
| 285 | + deactivate-cell-edit |
| 286 | + select [get-item -path "org.slf4j" -index 2] [get-item -path "org.slf4j" -index 1] "org.slf4j" [get-item |
| 287 | + -path "org.jetbrains.kotlin" -index 3] [get-item -path "org.jetbrains.kotlin" -index 2] |
| 288 | + |
| 289 | + get-property "selection[0].path[0]" | equals "org.jetbrains.kotlin%2%" | verify-true |
| 290 | + get-property "selection[1].path[0]" | equals "org.jetbrains.kotlin%3%" | verify-true |
| 291 | + get-property "selection[2].path[0]" | equals "org.slf4j" | verify-true |
| 292 | + get-property "selection[3].path[0]" | equals "org.slf4j%1%" | verify-true |
| 293 | + get-property "selection[4].path[0]" | equals "org.slf4j%2%" | verify-true |
| 294 | + } |
| 295 | +} |
| 296 | +------=_.content-0a7243a0-75d3-3d5f-9791-539de0e5b7ac-- |
0 commit comments