Add support for ODL credentials that have changed
[integration.git] / test / csit / tests / clamp / UIs / 02__Create_TCA_model.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 Create Model from Menu
39     Wait Until Element Is Visible       xpath=//*[@id="navbar"]/ul/li[2]/a       timeout=60
40     Click Element    xpath=//*[@id="navbar"]/ul/li[1]/a
41     Wait Until Element Is Visible       locator=Create CL       timeout=60
42     Click Element    locator=Create CL
43     Input Text      locator=modelName       text=TCAModel1
44     Select From List By Label       id=templateName      templateTCA1
45     Click Button    locator=Create
46
47 Set Properties for TCAModel1
48     Wait Until Element Is Visible       xpath=//*[@id="navbar"]/ul/li[1]/a       timeout=60
49     Click Element    xpath=//*[@id="navbar"]/ul/li[1]/a
50     Wait Until Element Is Visible       locator=Properties CL       timeout=60
51     Click Element    locator=Properties CL
52     Select From List By Label       id=service       vLoadBalancer
53     Select From List By Label       id=vf       vLoadBalancer 0
54     Select From List By Label       id=actionSet      VNF
55     Select From List By Label       id=location      Data Center 1      Data Center 3
56     Click Button    locator=Save
57
58 Set Policy Box properties for TCAModel1
59     Wait Until Element Is Visible       xpath=//*[@data-element-id="Policy_12lup3h"]      timeout=60
60     Click Element    xpath=//*[@data-element-id="Policy_12lup3h"]
61     Click Button    locator=New Policy
62     Input Text      locator=//*[@id="pname"]      text=Policy2
63     Select From List By Label       id=recipe      Restart
64     Input Text      locator=maxRetries      text=6
65     Input Text      locator=retryTimeLimit      text=280
66     Input Text      locator=timeout      text=400
67     Click Button    locator=Close
68
69 Set TCA Box properties for TCAModel1
70     Wait Until Element Is Visible       xpath=//*[@data-element-id="Policy_12lup3h"]      timeout=60
71     Click Element    xpath=//*[@data-element-id="TCA_1d13unw"]
72     Input Text      xpath=(//input[@id='tname'])[2]      text=TCA1
73     Select From List By Label       xpath=//*[@id="tcaPol"]      Policy2
74     Select From List By Label       xpath=//*[@id="eventName"]      vLoadBalancer
75 ### Cannot set all TCA box attributes due to element not interractable with Selenium
76 #    Select From List By Label       xpath=//*[@id="controlLoopSchemaType"]       VNF
77 #    Select From List By Index       xpath=//*[@id="controlLoopSchemaType"]       1
78     Click Element    xpath=(//button[@id='createNewThresh'])[2]
79     Input Text      xpath=(//input[@id='threshold'])[2]          6
80 #    Select From List By Label       xpath=//*[@id="closedLoopEventStatus"]        ONSET
81     Click Button    id=savePropsBtn
82
83 Save Model from Menu
84     Wait Until Element Is Visible       xpath=//*[@id="navbar"]/ul/li[1]/a      timeout=60
85     Click Element    xpath=//*[@id="navbar"]/ul/li[1]/a
86     Wait Until Element Is Visible       locator=Save CL      timeout=60
87     Set Selenium Speed      ${SELENIUM_SPEED_FAST}
88     Click Element    locator=Save CL
89     Wait Until Element Is Visible       xpath=//*[@id="alert_message_"]      timeout=60
90     Element Text Should Be      xpath=//*[@id="alert_message_"]       expected=Action Successful:SAVE
91     Set Selenium Speed      ${SELENIUM_SPEED_SLOW}
92
93 Close Browser
94     Close Browser