Add Project and Owning Entity to VID
[testsuite.git] / robot / resources / vid / create_service_instance.robot
1 *** Settings ***
2 Documentation     Creates VID Service Instance
3 ...
4 ...                   Creates VID Service Instance
5
6 Library             ExtendedSelenium2Library
7 Library         UUID
8 Library         String
9 Library        DateTime
10
11 Resource          ../mso_interface.robot
12 Resource          vid_interface.robot
13
14 *** Keywords ***
15 Create VID Service Instance
16     [Documentation]    Creates a service instance using VID
17     [Arguments]    ${customer_name}  ${service_model_type}    ${service_type}     ${service_name}  ${project_name}  ${owning_entity}
18     Go To VID Browse Service Models
19     Wait Until Keyword Succeeds    300s    1s    Wait For Model    ${service_model_type}
20     Press Key    xpath=//tr[td/span/text() = '${service_model_type}']/td/button[text() = 'Deploy' and not(@disabled)]    \\13
21     ${uuid}=    Generate UUID
22     Wait Until Page Contains Element    xpath=//input[@parameter-name='Instance Name']    ${GLOBAL_VID_UI_TIMEOUT_LONG}
23     Wait Until Element Is Visible    xpath=//input[@parameter-name='Instance Name']    ${GLOBAL_VID_UI_TIMEOUT_LONG}
24     Xpath Should Match X Times    //input[@parameter-name='Instance Name']    1
25     Wait Until Keyword Succeeds   120s  5s    Input Text When Enabled    //input[@parameter-name='Instance Name']    ${service_name}   timeout=${GLOBAL_VID_UI_TIMEOUT_LONG}
26     Select From List When Enabled    //select[@prompt='Select Subscriber Name']    ${customer_name}   timeout=${GLOBAL_VID_UI_TIMEOUT_LONG}
27     Select From List When Enabled    //select[@prompt='Select Service Type']     ${service_type}   timeout=${GLOBAL_VID_UI_TIMEOUT_LONG}
28     Select From List When Enabled    //select[@prompt='Select Project Name']     ${project_name}   timeout=${GLOBAL_VID_UI_TIMEOUT_LONG}
29     Select From List When Enabled    //select[@prompt='Select Owning Entity']     ${owning_entity}   timeout=${GLOBAL_VID_UI_TIMEOUT_LONG}
30     Click On Button When Enabled    //div[@class = 'buttonRow']/button[text() = 'Confirm']
31         Wait Until Element Contains    xpath=//pre[@class= 'log ng-binding']    requestState    timeout=${GLOBAL_VID_UI_TIMEOUT_LONG}
32         Page Should Contain    "requestState": "COMPLETE"
33     ${response text}=    Get Text    xpath=//pre[@class = 'log ng-binding']
34     Click On Button When Enabled    //div[@class = 'buttonRow']/button[text() = 'Close']
35     ${request_id}=    Parse Request Id    ${response text}
36     ${service_instance_id}=    Parse Instance Id     ${response text}
37     Poll MSO Get Request    ${GLOBAL_MSO_STATUS_PATH}${request_id}   COMPLETE
38     [return]    ${service_instance_id}
39
40 Wait For Model
41     [Documentation]   Distributed model may not yet be available. Kepp trying until it shows up.
42     [Arguments]   ${service_model_type}
43     Page Should Contain Element    xpath=//div/h1[text() = 'Browse SDC Service Models']
44     Wait Until Page Contains Element    xpath=//button[text() = 'Deploy']    ${GLOBAL_VID_UI_TIMEOUT_LONG}
45     Input Text When Enabled    //input[@ng-model='searchString']    ${service_model_type}
46     Wait Until Element Is Visible    xpath=//tr[td/span/text() = '${service_model_type}']/td/button[contains(text(),'Deploy')]    ${GLOBAL_VID_UI_TIMEOUT_SHORT}
47
48 Delete Service Instance By GUI
49     [Arguments]    ${service_instance_id}    ${customer_name}
50     Click On Element When Visible    xpath=//a/span[@class='glyphicon glyphicon-remove']
51     Click On Button When Enabled    xpath=//div[@class='buttonRow']/button[@ngx-enabled='true']
52     Wait Until Element Contains    xpath=//div[@ng-controller='deletionDialogController']//div[@ng-controller= 'msoCommitController']/pre[@class = 'log ng-binding']   requestId    timeout=${GLOBAL_VID_UI_TIMEOUT_LONG}
53     ${response text}=    Get Text    xpath=//div[@ng-controller='deletionDialogController']//div[@ng-controller= 'msoCommitController']/pre[@class = 'log ng-binding']
54     ${request_id}=    Parse Request Id     ${response text}
55     Poll MSO Get Request    ${GLOBAL_MSO_STATUS_PATH}${request_id}   COMPLETE
56
57
58 Search Service Instance
59     [Arguments]    ${service_instance_id}    ${customer_name}
60     Click Link       xpath=//div[@heading = 'Search for Existing Service Instances']/a
61     Input Text When Enabled    //input[@name='selectedServiceInstance']    ${service_instance_id}
62     Click On Button When Enabled    //button[text() = 'Submit']