blob: e1daff6b3270349c60851f1225a4e809d633a1de [file] [log] [blame]
DR695Hccff30b2017-02-17 18:44:24 -05001*** Settings ***
2Documentation Creates VID Service Instance
3...
4... Creates VID Service Instance
5
6Library ExtendedSelenium2Library
7Library UUID
8Library String
9Library DateTime
10
11Resource ../mso_interface.robot
12Resource vid_interface.robot
13
jf9860ca5693c2017-03-08 16:17:56 -050014*** Keywords ***
DR695Hccff30b2017-02-17 18:44:24 -050015Create VID Service Instance
jf9860ca5693c2017-03-08 16:17:56 -050016 [Documentation] Creates a service instance using VID
bdfreeman14217f58ef12018-05-06 12:12:27 -040017 [Arguments] ${customer_name} ${service_model_type} ${service_type} ${service_name} ${project_name} ${owning_entity}
Jerry Floodedbeafb2017-06-01 17:05:42 -040018 Go To VID Browse Service Models
Brian Freemanf940ee92018-05-25 21:09:05 -050019 Wait Until Keyword Succeeds 180s 5s Wait For Model ${service_model_type}
DR695Hccff30b2017-02-17 18:44:24 -050020 Press Key xpath=//tr[td/span/text() = '${service_model_type}']/td/button[text() = 'Deploy' and not(@disabled)] \\13
jf9860ca5693c2017-03-08 16:17:56 -050021 ${uuid}= Generate UUID
Jerry Floodf67ce0e2017-03-20 16:59:23 -040022 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}
Jerry Flood81d33fb2017-11-21 16:21:21 -050024 Select From List When Enabled //select[@prompt='Select Subscriber Name'] ${customer_name} timeout=${GLOBAL_VID_UI_TIMEOUT_LONG}
bdfreeman14217f58ef12018-05-06 12:12:27 -040025 Select From List When Enabled //select[@prompt='Select Service Type'] ${service_type} timeout=${GLOBAL_VID_UI_TIMEOUT_LONG}
26 Select From List When Enabled //select[@prompt='Select Project Name'] ${project_name} timeout=${GLOBAL_VID_UI_TIMEOUT_LONG}
27 Select From List When Enabled //select[@prompt='Select Owning Entity'] ${owning_entity} timeout=${GLOBAL_VID_UI_TIMEOUT_LONG}
Brian Freemanf940ee92018-05-25 21:09:05 -050028 Capture Page Screenshot
29 Xpath Should Match X Times //input[@parameter-name='Instance Name'] 1
Brian Freemanc374fb22018-05-31 15:57:54 -050030 Focus //input[@parameter-name='Instance Name']
Brian Freemanf940ee92018-05-25 21:09:05 -050031 Wait Until Keyword Succeeds 120s 5s Input Text When Enabled //input[@parameter-name='Instance Name'] ${service_name} timeout=${GLOBAL_VID_UI_TIMEOUT_LONG}
32 Capture Page Screenshot
DR695Hccff30b2017-02-17 18:44:24 -050033 Click On Button When Enabled //div[@class = 'buttonRow']/button[text() = 'Confirm']
Brian Freemanf940ee92018-05-25 21:09:05 -050034 Wait Until Element Contains xpath=//pre[@class= 'log ng-binding'] requestState timeout=${GLOBAL_VID_UI_TIMEOUT_MEDIUM}
35 Wait Until Page Contains "requestState": "COMPLETE" timeout= ${GLOBAL_VID_UI_TIMEOUT_LONG}
bdfreeman14217f58ef12018-05-06 12:12:27 -040036 ${response text}= Get Text xpath=//pre[@class = 'log ng-binding']
DR695Hccff30b2017-02-17 18:44:24 -050037 Click On Button When Enabled //div[@class = 'buttonRow']/button[text() = 'Close']
jf9860ca5693c2017-03-08 16:17:56 -050038 ${request_id}= Parse Request Id ${response text}
DR695Hccff30b2017-02-17 18:44:24 -050039 ${service_instance_id}= Parse Instance Id ${response text}
40 Poll MSO Get Request ${GLOBAL_MSO_STATUS_PATH}${request_id} COMPLETE
41 [return] ${service_instance_id}
42
jf9860ca5693c2017-03-08 16:17:56 -050043Wait For Model
44 [Documentation] Distributed model may not yet be available. Kepp trying until it shows up.
45 [Arguments] ${service_model_type}
jf9860ca5693c2017-03-08 16:17:56 -050046 Page Should Contain Element xpath=//div/h1[text() = 'Browse SDC Service Models']
Brian Freemanf940ee92018-05-25 21:09:05 -050047 Wait Until Page Contains Element xpath=//button[text() = 'Deploy'] ${GLOBAL_VID_UI_TIMEOUT_MEDIUM}
jf9860ca5693c2017-03-08 16:17:56 -050048 Input Text When Enabled //input[@ng-model='searchString'] ${service_model_type}
Jerry Floodf67ce0e2017-03-20 16:59:23 -040049 Wait Until Element Is Visible xpath=//tr[td/span/text() = '${service_model_type}']/td/button[contains(text(),'Deploy')] ${GLOBAL_VID_UI_TIMEOUT_SHORT}
jf9860ca5693c2017-03-08 16:17:56 -050050
51Delete Service Instance By GUI
52 [Arguments] ${service_instance_id} ${customer_name}
53 Click On Element When Visible xpath=//a/span[@class='glyphicon glyphicon-remove']
Jerry Floodf67ce0e2017-03-20 16:59:23 -040054 Click On Button When Enabled xpath=//div[@class='buttonRow']/button[@ngx-enabled='true']
55 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}
DR695Hccff30b2017-02-17 18:44:24 -050056 ${response text}= Get Text xpath=//div[@ng-controller='deletionDialogController']//div[@ng-controller= 'msoCommitController']/pre[@class = 'log ng-binding']
57 ${request_id}= Parse Request Id ${response text}
58 Poll MSO Get Request ${GLOBAL_MSO_STATUS_PATH}${request_id} COMPLETE
jf9860ca5693c2017-03-08 16:17:56 -050059
60
61Search Service Instance
62 [Arguments] ${service_instance_id} ${customer_name}
63 Click Link xpath=//div[@heading = 'Search for Existing Service Instances']/a
64 Input Text When Enabled //input[@name='selectedServiceInstance'] ${service_instance_id}
65 Click On Button When Enabled //button[text() = 'Submit']