--- RCPTT testcase ---
Format-Version: 1.0
Contexts: _DysjgCPgEeWMU9qdIQ2Zdw,_cunb8CVIEeW4j8UBl4j8TA
Element-Name: Integrate-Edit-Delete-Tool
Element-Type: testcase
Element-Version: 3.0
External-Reference: 
Id: _7Xj2EGaBEeWE-JfpwaFXMg
Runtime-Version: 2.0.0.201506120617
Save-Time: 11/5/15 3:29 PM
Testcase-Type: ecl

------=_.content-0a7243a0-75d3-3d5f-9791-539de0e5b7ac
Content-Type: text/ecl
Entry-Name: .content

get-button "Create workflow (M1+M2+N)" | click
with [get-window "New Workflow"] {
    get-editbox -after [get-label "Workflow name:"] | type-text x
    get-button Finish | click
}

echo "Workflow created" | log -severity info

get-button "Integrate Tool" | click
with [get-window "Integrate a Tool as a Workflow Component"] {
    get-button "Next >" | click
    get-group "Tool characteristics" | get-editbox -after [get-label "Name*:"] | type-text x
    with [get-button "Next >"] {
        click
        click
        click
    }
    get-button Add | click
    with [get-window "Add Launch Setting"] {
        get-editbox -after [get-label "Tool directory*:"] | type-text x
        get-editbox -after [get-label "Version*:"] | type-text x
        get-editbox -after [get-label "Working directory*:"] | type-text x
        get-button OK | click
    }
    get-group "Clean up choices for working directory(ies) in workflow configuration*" 
        | get-button "Delete working directory(ies) when workflow is finished" | check
    get-button "Next >" | click
    get-button "Command(s) for Windows" | check
    get-editbox | type-text xxx
}
set-dialog-result MessageBox 32
get-window "Integrate a Tool as a Workflow Component" | get-button "Save and activate" | click

echo "Tool integrated" | log -severity info

with [get-editor "x.wf"] {
    with [get-palette] {
        with [get-palette-entry "User Integrated Tools"] {
            mouse-move 51 59 button1 -height 60 -width 109
            mouse-press 51 59 button1 -height 60 -width 109
            mouse-release 51 59 button1 524288 -height 60 -width 109
            mouse-hover 51 59 -height 60 -width 109
        }
        with [get-palette-entry "x (x)"] {
            mouse-move 38 4 button1 -height 23 -width 109
            mouse-press 38 4 button1 -height 23 -width 109
            get-figure 0 | drag-start 38 4
        }
    }
    with [get-diagram -index 1 | get-edit-part -className WorkflowPart] {
        drag-enter 1086 445 -detail move
        drag-over 309 174 -detail copy
        drag-exit
        drag-accept 309 174 -detail copy
    }
    get-palette | drag-set-data
    get-diagram -index 1 | get-edit-part -className WorkflowPart | drop 309 174 -detail copy
    get-palette | drag-end -detail move
}

echo "Tool added to workflow" | log -severity info

get-editor "x.wf" | get-diagram -index 1 | get-edit-part -className WorkflowPart | get-edit-part -text x 
    | get-property text | equals x | verify-true
    
echo "Tool added to workflow verified" | log -severity info

with [get-editor "x.wf" | get-diagram -index 1] {
    with [get-edit-part -className WorkflowPart | get-edit-part -text x] {
        mouse-move 57 35 button1 -height 75 -width 75
        mouse-press 57 35 button1 -height 75 -width 75
        mouse-release 57 35 button1 524288 -height 75 -width 75
        mouse-hover 57 35 -height 75 -width 75
        activate-direct-edit
    }
    key-type Del
}
get-button "Edit an Integrated Tool" | click
with [get-window "Integrate a Tool as a Workflow Component"] {
    get-list | select "x (Type: common)"
    get-button "Next >" | click
    get-group "Tool characteristics" | get-editbox -after [get-label "Name*:"] | set-text y
}
set-dialog-result MessageBox 32
get-window "Integrate a Tool as a Workflow Component" | get-button "Save and update" | click

echo "Tool edited" | log -severity info

with [get-editor "x.wf"] {
    get-diagram -index 1 | mouse-hover 475 548 -height 596 -width 1202
    with [get-palette | get-palette-entry "y (x)"] {
        mouse-move 37 6 button1 -height 23 -width 109
        mouse-press 37 6 button1 -height 23 -width 109
        get-figure 0 | drag-start 37 6
    }
    with [get-diagram -index 1 | get-edit-part -className WorkflowPart] {
        drag-enter 1182 463 -detail move
        drag-over 280 226 -detail copy
        drag-exit
        drag-accept 280 226 -detail copy
    }
    get-palette | drag-set-data
    get-diagram -index 1 | get-edit-part -className WorkflowPart | drop 280 226 -detail copy
    get-palette | drag-end -detail move
    get-diagram -index 1 | get-edit-part -className WorkflowPart | get-edit-part -text y | get-handle MoveHandle 
        | mouse-hover 1 1 -height 77 -width 77
    get-palette | get-palette-entry "SQL Command" | mouse-move 76 1 -height 23 -width 109
}

echo "Edited Tool added to workflow" | log -severity info

get-editor "x.wf" | get-diagram -index 1 | get-edit-part -className WorkflowPart | get-edit-part -text y 
    | get-property text | equals y | verify-true
    
echo "Edited Tool added to workflow verified" | log -severity info 
    
with [get-editor "x.wf"] {
    get-palette | get-palette-entry "Draw Connection (ALT+D)" | mouse-move 37 35 -height 46 -width 109
    with [get-diagram -index 1] {
        with [get-edit-part -className WorkflowPart | get-edit-part -text y] {
            mouse-move 40 29 button1 -height 75 -width 75
            mouse-press 40 29 button1 -height 75 -width 75
            mouse-release 40 29 button1 524288 -height 75 -width 75
            activate-direct-edit
            mouse-hover 50 16 -height 75 -width 75
        }
        key-type Del
    }
}
get-button "Deactivate an Integrated Tool" | click
with [get-window "Deactivate Tool"] {
    get-list | select "y \\(Type: common\\)"
    get-button "Keep tool configuration on disk" | uncheck
    get-button OK | click
}

echo "Tool deactivated" | log -severity info

get-button "Deactivate an Integrated Tool" | click
get-window "Deactivate Tool" | get-list | get-property "getItems().length" | equals 0 | verify-true
    
echo "Tool deactivated/Not available anymore verified" | log -severity info
    
------=_.content-0a7243a0-75d3-3d5f-9791-539de0e5b7ac--
