| --- RCPTT testcase --- |
| Format-Version: 1.0 |
| Contexts: _D4Pj4C3lEeSwhO5Nwx0hPg,_Iu0EsS36EeSYRYqCbC6LMQ |
| Element-Name: TableControlReadOnlyBehavior |
| Element-Type: testcase |
| Element-Version: 3.0 |
| External-Reference: |
| Id: _O-MQUNwVEeeMsObmKZ9qhw |
| Runtime-Version: 2.2.0.201706152316 |
| Save-Time: 12/8/17 4:45 PM |
| Testcase-Type: ecl |
| |
| ------=_.description-216f885c-d591-38ce-8ea2-e4f8cb4d6ffa |
| Content-Type: text/plain |
| Entry-Name: .description |
| |
| tests that the table is not editable when its effectively readonly. |
| ------=_.description-216f885c-d591-38ce-8ea2-e4f8cb4d6ffa-- |
| ------=_.content-0a7243a0-75d3-3d5f-9791-539de0e5b7ac |
| Content-Type: text/ecl |
| Entry-Name: .content |
| |
| get-view "Project Explorer" | get-tree |
| | select "org.eclipse.emf.ecp.makeithappen.model.viewmodel/viewmodels/UserGroup.view" | double-click |
| with [get-editor "UserGroup.view"] { |
| with [get-tree] { |
| select View | get-menu -path TableControl | click |
| select "View/TableControl" |
| } |
| get-button "Create and link new Domain Model Reference" | click |
| } |
| |
| // Create table control in UserGroup.view |
| with [get-window "Configure TableDomainModelReference"] { |
| get-button "Create and link new Domain Model Reference" | click |
| with [get-window "New Reference Element"] { |
| get-tree | select "model/FeaturePathDomainModelReference" |
| get-button "Next >" | click |
| get-button "Link Domain Model EFeature" | click |
| with [get-window "Select a EStructuralFeature"] { |
| get-tree | select "users : User" |
| get-button OK | click |
| } |
| get-button Finish | click |
| } |
| get-button Finish | click |
| } |
| |
| // refresh preview |
| with [get-view "EMF Forms Preview"] { |
| get-button "Refresh Preview View" | click |
| get-button "Add an instance of" | click |
| } |
| |
| // edit in edit mode |
| with [get-view "EMF Forms Preview" | get-table] { |
| select Male -column Gender | activate-cell-edit -column 1 -type MouseClickSelection |
| with [get-editbox] { |
| set-text abc |
| key-type Enter |
| } |
| apply-cell-edit -deactivate |
| } |
| |
| // set view to read only and refresh preview |
| with [get-editor "UserGroup.view"] { |
| get-tree | select View |
| get-button -after [get-label Readonly] | check |
| key-type "M1+s" |
| } |
| with [get-view "EMF Forms Preview"] { |
| get-button "Refresh Preview View" | click |
| } |
| |
| // try to edit readonly table -> should fail |
| with [get-view "EMF Forms Preview" | get-table] { |
| try { |
| // the following should fail, therefore the assert fails if the above works |
| select Male -column Gender | activate-cell-edit -column 1 -type MouseClickSelection |
| with [get-editbox] { |
| set-text testString123 |
| key-type Enter |
| } |
| apply-cell-edit -deactivate |
| } -catch { |
| // The above should fail |
| } |
| } |
| |
| // verify that the cell edit failed by checking that its content was not set to testString123 earlier |
| get-view "EMF Forms Preview" | get-table | get-item Male -column Gender |
| | get-property "columns[1]" | equals testString123 | verify-false |
| |
| |
| ------=_.content-0a7243a0-75d3-3d5f-9791-539de0e5b7ac-- |