2b95530aebb4c6fb2766fe76718fc3488b2c4e8c
[integration/csit.git] / tests / clamp / UIs / 05__Submit_deploy_chain_TCA.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 *** Test Cases ***
17 Get Requests health check ok
18     ${resp}=    Get Request    ${clamp_session}   /restservices/clds/v1/healthcheck
19     Should Be Equal As Strings  ${resp.status_code}     200
20
21 Open Browser
22 # Next line is to be enabled for Headless tests only (jenkins?). To see the tests disable the line.
23     Start Virtual Display    1920    1080
24     Set Selenium Speed      ${SELENIUM_SPEED_SLOW}
25     Open Browser    ${BASE_URL}/designer/index.html    browser=firefox
26
27 Reply to authentication popup
28     Run Keyword And Ignore Error    Insert into prompt    ${login} ${passw}
29     Confirm action
30
31 Good Login to Clamp UI and Verify logged in
32     Set Window Size    1920    1080
33     ${title}=    Get Title
34     Should Be Equal    CLDS    ${title}
35     Wait Until Element Is Visible       xpath=//*[@class="navbar-brand logo_name ng-binding"]       timeout=60
36     Element Text Should Be      xpath=//*[@class="navbar-brand logo_name ng-binding"]       expected=Hello:admin
37
38 Open TCA CL
39     Wait Until Element Is Visible       xpath=//*[@id="navbar"]/ul/li[1]/a       timeout=60
40     Click Element    xpath=//*[@id="navbar"]/ul/li[1]/a
41     Wait Until Element Is Visible       locator=Open CL       timeout=60
42     Click Element    locator=Open CL
43     Select From List By Label       id=modelName      TCAModel1
44     Click Button    locator=OK
45     Element Should Contain      xpath=//*[@id="modeler_name"]     Closed Loop Modeler - TCAModel1
46     Element Should Contain      xpath=//*[@id="status_clds"]     DESIGN
47
48 Validate-Test TCA CL
49     Wait Until Element Is Visible       xpath=//*[@id="navbar"]/ul/li[2]/a       timeout=60
50     Click Element    xpath=//*[@id="navbar"]/ul/li[2]/a
51     Wait Until Element Is Visible       locator=Validation Test       timeout=60
52     Click Element    locator=Validation Test
53     Wait Until Element Is Visible       xpath=//*[@id="alert_message_"]      timeout=60
54     Element Text Should Be      xpath=//*[@id="alert_message_"]       expected=Action Successful:TEST
55     Element Should Contain      xpath=//*[@id="status_clds"]     DESIGN
56
57 Submit TCA CL
58     Wait Until Element Is Visible       xpath=//*[@id="navbar"]/ul/li[2]/a       timeout=60
59     Click Element    xpath=//*[@id="navbar"]/ul/li[2]/a
60     Wait Until Element Is Visible       locator=Submit       timeout=60
61     Click Element    locator=Submit
62     Click Button    locator=Yes
63     Wait Until Element Is Visible       xpath=//*[@id="alert_message_"]      timeout=60
64     Element Text Should Be      xpath=//*[@id="alert_message_"]       expected=Action Successful:SUBMIT
65     Element Should Contain      xpath=//*[@id="status_clds"]     DISTRIBUTED
66
67 Resubmit TCA CL
68     Wait Until Element Is Visible       xpath=//*[@id="navbar"]/ul/li[2]/a       timeout=60
69     Click Element    xpath=//*[@id="navbar"]/ul/li[2]/a
70     Wait Until Element Is Visible       locator=Resubmit       timeout=60
71     Click Element    locator=Resubmit
72     Click Button    locator=Yes
73     Wait Until Element Is Visible       xpath=//*[@id="alert_message_"]      timeout=60
74     Element Text Should Be      xpath=//*[@id="alert_message_"]       expected=Action Successful:RESUBMIT
75     Element Should Contain      xpath=//*[@id="status_clds"]     DISTRIBUTED
76
77 Deploy TCA CL
78     Wait Until Element Is Visible       xpath=//*[@id="navbar"]/ul/li[2]/a       timeout=60
79     Click Element    xpath=//*[@id="navbar"]/ul/li[2]/a
80     Wait Until Element Is Visible       locator=Deploy       timeout=60
81     Click Element    locator=Deploy
82 #    Wait Until Element Is Visible       xpath=//*[@id="deployProperties"]       timeout=60
83 #    Input Text      xpath=//*[@id="deployProperties"]      text={}
84     Click Button    locator=Deploy
85     Click Button    locator=Yes
86     Wait Until Element Is Visible       xpath=//*[@id="alert_message_"]      timeout=60
87     Element Text Should Be      xpath=//*[@id="alert_message_"]       expected=Action Successful:deploy
88     Element Should Contain      xpath=//*[@id="status_clds"]     ACTIVE
89
90 Update TCA CL
91     Wait Until Element Is Visible       xpath=//*[@id="navbar"]/ul/li[2]/a       timeout=60
92     Click Element    xpath=//*[@id="navbar"]/ul/li[2]/a
93     Wait Until Element Is Visible       locator=Update       timeout=60
94     Click Element    locator=Update
95     Click Button    locator=Yes
96     Wait Until Element Is Visible       xpath=//*[@id="alert_message_"]      timeout=60
97     Element Text Should Be      xpath=//*[@id="alert_message_"]       expected=Action Successful:UPDATE
98     Element Should Contain      xpath=//*[@id="status_clds"]     ACTIVE
99
100 Stop TCA CL
101     Wait Until Element Is Visible       xpath=//*[@id="navbar"]/ul/li[2]/a       timeout=60
102     Click Element    xpath=//*[@id="navbar"]/ul/li[2]/a
103     Wait Until Element Is Visible       locator=Stop       timeout=60
104     Click Element    locator=Stop
105     Click Button    locator=Yes
106     Wait Until Element Is Visible       xpath=//*[@id="alert_message_"]      timeout=60
107     Element Text Should Be      xpath=//*[@id="alert_message_"]       expected=Action Successful:STOP
108     Element Should Contain      xpath=//*[@id="status_clds"]     STOPPED
109
110 Restart TCA CL
111     Wait Until Element Is Visible       xpath=//*[@id="navbar"]/ul/li[2]/a       timeout=60
112     Click Element    xpath=//*[@id="navbar"]/ul/li[2]/a
113     Wait Until Element Is Visible       locator=Restart       timeout=60
114     Click Element    locator=Restart
115     Click Button    locator=Yes
116     Wait Until Element Is Visible       xpath=//*[@id="alert_message_"]      timeout=60
117     Element Text Should Be      xpath=//*[@id="alert_message_"]       expected=Action Successful:RESTART
118     Element Should Contain      xpath=//*[@id="status_clds"]     ACTIVE
119
120 UnDeploy TCA CL
121     Wait Until Element Is Visible       xpath=//*[@id="navbar"]/ul/li[2]/a       timeout=60
122     Click Element    xpath=//*[@id="navbar"]/ul/li[2]/a
123     Wait Until Element Is Visible       locator=UnDeploy       timeout=60
124     Click Element    locator=UnDeploy
125     Click Button    locator=Yes
126     Wait Until Element Is Visible       xpath=//*[@id="alert_message_"]      timeout=60
127     Element Text Should Be      xpath=//*[@id="alert_message_"]       expected=Action Successful:undeploy
128     Element Should Contain      xpath=//*[@id="status_clds"]     DISTRIBUTED
129
130 Close Browser
131     Close Browser