Merge "Updated Setup files for PM Mapper"
[integration/csit.git] / tests / clamp / UIs / 04__Submit_deploy_chain_Holmes.robot
1 *** Settings ***
2 Library     Collections
3 Library     RequestsLibrary
4 Library     OperatingSystem
5 Library     json
6 Library     ../../../scripts/clamp/python-lib/CustomSeleniumLibrary.py
7 Library     XvfbRobot
8
9 *** Variables ***
10 ${login}                     admin
11 ${passw}                     password
12 ${SELENIUM_SPEED_FAST}       .2 seconds
13 ${SELENIUM_SPEED_SLOW}       .5 seconds
14 ${BASE_URL}                  https://localhost:8443
15
16 *** Keywords ***
17 Create the sessions
18     ${auth}=    Create List     ${login}    ${passw}
19     Create Session   clamp  ${BASE_URL}    auth=${auth}   disable_warnings=1
20     Set Global Variable     ${clamp_session}      clamp
21
22 *** Test Cases ***
23 Get Requests health check ok
24     Create the sessions
25     ${resp}=    Get Request    ${clamp_session}   /restservices/clds/v1/healthcheck
26     Should Be Equal As Strings  ${resp.status_code}     200
27
28 Open Browser
29 # Next line is to be enabled for Headless tests only (jenkins?). To see the tests disable the line.
30     Start Virtual Display    1920    1080
31     Set Selenium Speed      ${SELENIUM_SPEED_SLOW}
32     Open Browser    ${BASE_URL}/designer/index.html    browser=firefox
33
34 Reply to authentication popup
35     Run Keyword And Ignore Error    Insert into prompt    ${login} ${passw}
36     Confirm action
37
38 Good Login to Clamp UI and Verify logged in
39     Set Window Size    1920    1080
40     ${title}=    Get Title
41     Should Be Equal    CLDS    ${title}
42     Wait Until Element Is Visible       xpath=//*[@class="navbar-brand logo_name ng-binding"]       timeout=60
43     Element Text Should Be      xpath=//*[@class="navbar-brand logo_name ng-binding"]       expected=Hello:admin
44
45 #Open Holmes CL
46 #    Wait Until Element Is Visible       xpath=//*[@id="navbar"]/ul/li[1]/a       timeout=60
47 #    Click Element    xpath=//*[@id="navbar"]/ul/li[1]/a
48 #    Wait Until Element Is Visible       locator=Open CL       timeout=60
49 #    Click Element    locator=Open CL
50 #    Select From List By Label       id=modelName      HolmesModel1
51 #    Click Button    locator=OK
52 #    Element Should Contain      xpath=//*[@id="modeler_name"]     Closed Loop Modeler - HolmesModel1
53 #    Element Should Contain      xpath=//*[@id="status_clds"]     DESIGN
54 #
55 #Validate-Test Holmes CL
56 #    Wait Until Element Is Visible       xpath=//*[@id="navbar"]/ul/li[2]/a       timeout=60
57 #    Click Element    xpath=//*[@id="navbar"]/ul/li[2]/a
58 #    Wait Until Element Is Visible       locator=Validation Test       timeout=60
59 #    Click Element    locator=Validation Test
60 #    Wait Until Element Is Visible       xpath=//*[@id="alert_message_"]      timeout=60
61 #    Element Text Should Be      xpath=//*[@id="alert_message_"]       expected=Action Successful: test
62 #    Element Should Contain      xpath=//*[@id="status_clds"]     DESIGN
63 #
64 #Submit Holmes CL
65 #    Wait Until Element Is Visible       xpath=//*[@id="navbar"]/ul/li[2]/a       timeout=60
66 #    Click Element    xpath=//*[@id="navbar"]/ul/li[2]/a
67 #    Wait Until Element Is Visible       locator=Submit       timeout=60
68 #    Click Element    locator=Submit
69 #    Click Button    locator=Yes
70 #    Wait Until Element Is Visible       xpath=//*[@id="alert_message_"]      timeout=60
71 #    Element Text Should Be      xpath=//*[@id="alert_message_"]       expected=Action Successful: submit
72 #    Element Should Contain      xpath=//*[@id="status_clds"]     DISTRIBUTED
73 #
74 #Resubmit Holmes CL
75 #    Wait Until Element Is Visible       xpath=//*[@id="navbar"]/ul/li[2]/a       timeout=60
76 #    Click Element    xpath=//*[@id="navbar"]/ul/li[2]/a
77 #    Wait Until Element Is Visible       locator=Resubmit       timeout=60
78 #    Click Element    locator=Resubmit
79 #    Click Button    locator=Yes
80 #    Wait Until Element Is Visible       xpath=//*[@id="alert_message_"]      timeout=60
81 #    Element Text Should Be      xpath=//*[@id="alert_message_"]       expected=Action Successful: resubmit
82 #    Element Should Contain      xpath=//*[@id="status_clds"]     DISTRIBUTED
83 #
84 #Deploy Holmes CL
85 #    Wait Until Element Is Visible       xpath=//*[@id="navbar"]/ul/li[2]/a       timeout=60
86 #    Click Element    xpath=//*[@id="navbar"]/ul/li[2]/a
87 #    Wait Until Element Is Visible       locator=Deploy       timeout=60
88 #    Click Element    locator=Deploy
89 ##    Wait Until Element Is Visible       xpath=//*[@id="deployProperties"]       timeout=60
90 ##    Input Text      xpath=//*[@id="deployProperties"]      text={}
91 #    Click Button    locator=Deploy
92 #    Click Button    locator=Yes
93 #    Wait Until Element Is Visible       xpath=//*[@id="alert_message_"]      timeout=60
94 #    Element Text Should Be      xpath=//*[@id="alert_message_"]       expected=Action Successful: deploy
95 #    Element Should Contain      xpath=//*[@id="status_clds"]     ACTIVE
96 #
97 #Update Holmes CL
98 #    Wait Until Element Is Visible       xpath=//*[@id="navbar"]/ul/li[2]/a       timeout=60
99 #    Click Element    xpath=//*[@id="navbar"]/ul/li[2]/a
100 #    Wait Until Element Is Visible       locator=Update       timeout=60
101 #    Click Element    locator=Update
102 #    Click Button    locator=Yes
103 #    Wait Until Element Is Visible       xpath=//*[@id="alert_message_"]      timeout=60
104 #    Element Text Should Be      xpath=//*[@id="alert_message_"]       expected=Action Successful: update
105 #    Element Should Contain      xpath=//*[@id="status_clds"]     ACTIVE
106 #
107 #Stop Holmes CL
108 #    Wait Until Element Is Visible       xpath=//*[@id="navbar"]/ul/li[2]/a       timeout=60
109 #    Click Element    xpath=//*[@id="navbar"]/ul/li[2]/a
110 #    Wait Until Element Is Visible       locator=Stop       timeout=60
111 #    Click Element    locator=Stop
112 #    Click Button    locator=Yes
113 #    Wait Until Element Is Visible       xpath=//*[@id="alert_message_"]      timeout=60
114 #    Element Text Should Be      xpath=//*[@id="alert_message_"]       expected=Action Successful: stop
115 #    Element Should Contain      xpath=//*[@id="status_clds"]     STOPPED
116 #
117 #Restart Holmes CL
118 #    Wait Until Element Is Visible       xpath=//*[@id="navbar"]/ul/li[2]/a       timeout=60
119 #    Click Element    xpath=//*[@id="navbar"]/ul/li[2]/a
120 #    Wait Until Element Is Visible       locator=Restart       timeout=60
121 #    Click Element    locator=Restart
122 #    Click Button    locator=Yes
123 #    Wait Until Element Is Visible       xpath=//*[@id="alert_message_"]      timeout=60
124 #    Element Text Should Be      xpath=//*[@id="alert_message_"]       expected=Action Successful: restart
125 #    Element Should Contain      xpath=//*[@id="status_clds"]     ACTIVE
126 #
127 #UnDeploy Holmes CL
128 #    Wait Until Element Is Visible       xpath=//*[@id="navbar"]/ul/li[2]/a       timeout=60
129 #    Click Element    xpath=//*[@id="navbar"]/ul/li[2]/a
130 #    Wait Until Element Is Visible       locator=UnDeploy       timeout=60
131 #    Click Element    locator=UnDeploy
132 #    Click Button    locator=Yes
133 #    Wait Until Element Is Visible       xpath=//*[@id="alert_message_"]      timeout=60
134 #    Element Text Should Be      xpath=//*[@id="alert_message_"]       expected=Action Successful: undeploy
135 #    Element Should Contain      xpath=//*[@id="status_clds"]     DISTRIBUTED
136
137 Close Browser
138     Close Browser