From ccff30b6e325f359879595998e83bbfe6624c851 Mon Sep 17 00:00:00 2001 From: DR695H Date: Fri, 17 Feb 2017 18:44:24 -0500 Subject: Initial checkin of EopenECOMP testsuite Change-Id: I64a2b6d8cf66169829866b73b3d26a4ff59b0a42 Signed-off-by: DR695H --- robot/resources/vid/create_service_instance.robot | 57 ++++++++++ robot/resources/vid/create_vid_vnf.robot | 122 ++++++++++++++++++++++ robot/resources/vid/teardown_vid.robot | 63 +++++++++++ robot/resources/vid/vid_interface.robot | 101 ++++++++++++++++++ 4 files changed, 343 insertions(+) create mode 100644 robot/resources/vid/create_service_instance.robot create mode 100644 robot/resources/vid/create_vid_vnf.robot create mode 100644 robot/resources/vid/teardown_vid.robot create mode 100644 robot/resources/vid/vid_interface.robot (limited to 'robot/resources/vid') diff --git a/robot/resources/vid/create_service_instance.robot b/robot/resources/vid/create_service_instance.robot new file mode 100644 index 00000000..2ea01ce2 --- /dev/null +++ b/robot/resources/vid/create_service_instance.robot @@ -0,0 +1,57 @@ +*** Settings *** +Documentation Creates VID Service Instance +... +... Creates VID Service Instance + +Library ExtendedSelenium2Library +Library UUID +Library String +Library DateTime + +Resource ../mso_interface.robot +Resource vid_interface.robot + +*** Keywords *** +Create VID Service Instance + [Documentation] Creates a service instance using VID + [Arguments] ${customer_name} ${service_model_type} ${service_type} ${service_name} + Go To VID HOME + Click Element partial link=Browse SDC Service + Page Should Contain Element xpath=//div/h1[text() = 'Browse SDC Service Models'] + Wait Until Page Contains Element xpath=//button[text() = 'Deploy'] 240s + Input Text When Enabled //input[@ng-model='searchString'] ${service_model_type} + Wait Until Element Is Visible xpath=//tr[td/span/text() = '${service_model_type}']/td/button[contains(text(),'Deploy')] 300000 + Press Key xpath=//tr[td/span/text() = '${service_model_type}']/td/button[text() = 'Deploy' and not(@disabled)] \\13 + ${uuid}= Generate UUID + Wait Until Page Contains Element xpath=//input[@parameter-name='Instance Name'] 120s + Wait Until Element Is Visible xpath=//input[@parameter-name='Instance Name'] 120s + Xpath Should Match X Times //input[@parameter-name='Instance Name'] 1 + Input Text When Enabled //input[@parameter-name='Instance Name'] ${service_name} + Select From List When Enabled //select[@prompt='Select Subscriber Name'] ${customer_name} + Select From List WHen Enabled //select[@prompt='Select Service Type'] ${service_type} + Click On Button When Enabled //div[@class = 'buttonRow']/button[text() = 'Confirm'] + Wait Until Element Contains xpath=//div[@ng-controller= 'msoCommitController']/pre[@class = 'log ng-binding'] requestId timeout=120s + ${response text}= Get Text xpath=//div[@ng-controller= 'msoCommitController']/pre[@class = 'log ng-binding'] + Click On Button When Enabled //div[@class = 'buttonRow']/button[text() = 'Close'] + ${request_id}= Parse Request Id ${response text} + ${service_instance_id}= Parse Instance Id ${response text} + Poll MSO Get Request ${GLOBAL_MSO_STATUS_PATH}${request_id} COMPLETE + [return] ${service_instance_id} + + +Delete Service Instance By GUI + [Arguments] ${service_instance_id} ${customer_name} + Click On Element When Visible xpath=//a/span[@class='glyphicon glyphicon-remove'] + Click On Button When Visible xpath=//div[@class='buttonRow']/button[@ngx-enabled='true'] + Wait Until Element Contains xpath=//div[@ng-controller='deletionDialogController']//div[@ng-controller= 'msoCommitController']/pre[@class = 'log ng-binding'] requestId timeout=120s + ${response text}= Get Text xpath=//div[@ng-controller='deletionDialogController']//div[@ng-controller= 'msoCommitController']/pre[@class = 'log ng-binding'] + ${request_id}= Parse Request Id ${response text} + Poll MSO Get Request ${GLOBAL_MSO_STATUS_PATH}${request_id} COMPLETE + + +Search Service Instance + [Arguments] ${service_instance_id} ${customer_name} + Click Link xpath=//div[@heading = 'Search for Existing Service Instances']/a + Input Text When Enabled //input[@name='selectedServiceInstance'] ${service_instance_id} + Click On Button When Enabled //button[text() = 'Submit'] + \ No newline at end of file diff --git a/robot/resources/vid/create_vid_vnf.robot b/robot/resources/vid/create_vid_vnf.robot new file mode 100644 index 00000000..a306637e --- /dev/null +++ b/robot/resources/vid/create_vid_vnf.robot @@ -0,0 +1,122 @@ +*** Settings *** +Documentation Creates VID VNF Instance + +Library ExtendedSelenium2Library 60 +Library UUID +Library String +Library DateTime +Library RequestsLibrary + +Resource ../mso_interface.robot +Resource vid_interface.robot + +*** Keywords *** + +Create VID VNF + [Documentation] Creates a VNF instance using VID for passed instance id with the passed service instance name + [Arguments] ${service_instance_id} ${service_instance_name} ${product_family} ${lcp_region} ${tenant} ${vnf_type} + Go To VID HOME + Click Link xpath=//div[@heading = 'Search for Existing Service Instances']/a + Wait Until Page Contains Please search by timeout=60s + #Wait Until Page Contains Element xpath=//div[@class='statusLine aaiHidden'] timeout=60s + #Wait Until Element Is Not Visible xpath=//div[@class='statusLine aaiHidden'] timeout=60s + + # If we don't wait for this control to be enabled, the submit results in a 'not found' pop-up (UnexpectedAlertPresentException) + Input Text When Enabled //input[@name='selectedServiceInstance'] ${service_instance_id} + Click Button button=Submit + Wait Until Page Contains Element link=View/Edit timeout=60s + Click Element xpath=//a[contains(text(), 'View/Edit')] + Wait Until Page Contains View/Edit Service Instance timeout=60s + #Wait Until Page Contains Element xpath=//div[@class='statusLine aaiVisible'] timeout=120s + #Wait Until Element Is Not Visible xpath=//div[@class='statusLine aaiVisible'] timeout=60s + Click Element button=Add VNF + + # This is where firefox breaks. Th elink never becomes visible when run with the script. + Click Element link=${vnf_type} + Wait Until Page Contains Element xpath=//input[@parameter-id='instanceName'] 20s + Wait Until Element Is Enabled xpath=//input[@parameter-id='instanceName'] 20s + + ## Without this sleep, the input text below gets immediately wiped out. + ## Wait Until Angular Ready just sleeps for its timeout value + Sleep 10s + Input Text xpath=//input[@parameter-id='instanceName'] ${service_instance_name} + Select From List By Label xpath=//select[@parameter-id='productFamily'] ${product_family} + Select From List By Label xpath=//select[@parameter-id='lcpRegion'] ${lcp_region} + Select From List By Label xpath=//select[@parameter-id='tenant'] ${tenant} + Click Element button=Confirm + Wait Until Element Contains xpath=//div[@ng-controller= 'msoCommitController']/pre[@class = 'log ng-binding'] Status: OK (200) timeout=120 + ${response text}= Get Text xpath=//div[@ng-controller= 'msoCommitController']/pre[@class = 'log ng-binding'] + Should Not Contain ${response text} FAILED + Click Element button=Close + ${instance_id}= Parse Instance Id ${response text} + Wait Until Page Contains ${service_instance_name} 60s + [Return] ${instance_id} + +Delete VID VNF + [Arguments] ${service_instance_id} ${lcp_region} ${tenant} ${vnf_instance_id} + Go To VID HOME + Click Link xpath=//div[@heading = 'Search for Existing Service Instances']/a + Wait Until Page Contains Please search by timeout=60s + Wait Until Page Contains Element xpath=//div[@class='statusLine aaiHidden'] timeout=60s + Wait Until Element Is Not Visible xpath=//div[@class='statusLine aaiHidden'] timeout=60s + + # If we don't wait for this control to be enabled, the submit results in a 'not found' pop-up (UnexpectedAlertPresentException) + Input Text When Enabled //input[@name='selectedServiceInstance'] ${service_instance_id} + Click Button button=Submit + Wait Until Page Contains Element link=View/Edit timeout=60s + Click Element link=View/Edit + Wait Until Page Contains View/Edit Service Instance timeout=60s + Wait Until Page Contains Element xpath=//div[@class='statusLine'] timeout=120s + Wait Until Element Is Not Visible xpath=//div[@class='statusLine aaiHidden'] timeout=60s + + + + Click On Element When Visible xpath=//li/div[contains(.,'${vnf_instance_id}')]/a/span[@class='glyphicon glyphicon-remove'] timeout=120s + Select From List By Label xpath=//select[@parameter-id='lcpRegion'] ${lcp_region} + Select From List By Label xpath=//select[@parameter-id='tenant'] ${tenant} + Click Element xpath=//div[@class='buttonRow']/button[@ngx-enabled='true'] + #//*[@id="mContent"]/div/div/div/div/table/tbody/tr/td/div/div[2]/div/div[1]/div[5]/button[1] + + ${response text}= Get Text xpath=//div[@ng-controller='deletionDialogController']//div[@ng-controller= 'msoCommitController']/pre[@class = 'log ng-binding'] + ${request_id}= Parse Request Id ${response text} + Poll MSO Get Request ${GLOBAL_MSO_STATUS_PATH}${request_id} COMPLETE + +Create VID VNF module + [Arguments] ${service_instance_id} ${vf_module_name} ${LCP_REGION} ${TENANT} ${VNF_TYPE} + Go To VID HOME + Click Link xpath=//div[@heading = 'Search for Existing Service Instances']/a + Wait Until Page Contains Please search by timeout=60s + Wait Until Page Contains Element xpath=//div[@class='statusLine aaiHidden'] timeout=60s + + # If we don't wait for this control to be enabled, the submit results in a 'not found' pop-up (UnexpectedAlertPresentException) + Input Text When Enabled //input[@name='selectedServiceInstance'] ${service_instance_id} + Click Button button=Submit + Wait Until Page Contains Element link=View/Edit timeout=60s + Click Element link=View/Edit + Wait Until Page Contains View/Edit Service Instance timeout=60s + Wait Until Page Contains Element xpath=//div[@class='statusLine'] timeout=120s + Wait Until Element Is Not Visible xpath=//div[@class='statusLine aaiHidden'] timeout=120s + Wait Until Element Is Visible button=Add VF-Module timeout=120s + Click Element button=Add VF-Module + + # This is where firefox breaks. Th elink never becomes visible when run with the script. + Click Element link=${vnf_type} + Wait Until Page Contains Element xpath=//input[@parameter-id='instanceName'] 20s + Wait Until Element Is Enabled xpath=//input[@parameter-id='instanceName'] 20s + + ## Without this sleep, the input text below gets immediately wiped out. + ## Wait Until Angular Ready just sleeps for its timeout value + Sleep 10s + Input Text xpath=//input[@parameter-id='instanceName'] ${vf_module_name} + Select From List By Label xpath=//select[@parameter-id='lcpRegion'] ${lcp_region} + Select From List By Label xpath=//select[@parameter-id='tenant'] ${tenant} + Click Element button=Confirm + Wait Until Element Contains xpath=//div[@ng-controller= 'msoCommitController']/pre[@class = 'log ng-binding'] requestId timeout=120 + ${response text}= Get Text xpath=//div[@ng-controller= 'msoCommitController']/pre[@class = 'log ng-binding'] + Click Element button=Close + ${instance_id}= Parse Instance Id ${response text} + + ${request_id}= Parse Request Id ${response text} + Poll MSO Get Request ${GLOBAL_MSO_STATUS_PATH}${request_id} COMPLETE + + [Return] ${instance_id} \ No newline at end of file diff --git a/robot/resources/vid/teardown_vid.robot b/robot/resources/vid/teardown_vid.robot new file mode 100644 index 00000000..50b50518 --- /dev/null +++ b/robot/resources/vid/teardown_vid.robot @@ -0,0 +1,63 @@ +*** Settings *** +Documentation The main interface for interacting with VID. It handles low level stuff like managing the selenium request library and VID required steps +Library ExtendedSelenium2Library +Library Collections +Library String +Library StringTemplater +Library UUID +Resource vid_interface.robot +Resource create_vid_vnf.robot +Resource create_service_instance.robot + +*** Variables *** +${VID_ENV} /vid +${VID_SERVICE_MODELS_SEARCH_URL} ${GLOBAL_VID_SERVER}${VID_ENV}/serviceModels.htm#/instances/subdetails?selectedSubscriber=\${customer_id} + +*** Keywords *** + +Teardown VID + [Documentation] Teardown the VID This assumes that the any runnign stacks have been torn down + [Arguments] ${service_instance_id} ${lcp_region} ${tenant} + # Keep going to the VID service instance until all of the remove icons are goe + Wait Until Keyword Succeeds 300s 1s Delete VID ${service_instance_id} ${lcp_region} ${tenant} + + +Delete VID + [Documentation] Teardown the next VID entity that has a Remove icon. + [Arguments] ${service_instance_id} ${lcp_region} ${tenant} + Go To ${VID_SERVICE_MODELS_SEARCH_URL} + Wait Until Page Contains Please search by timeout=60s + Wait Until Page Contains Element xpath=//div[@class='statusLine aaiHidden'] timeout=60s + Wait Until Element Is Not Visible xpath=//div[@class='statusLine aaiHidden'] timeout=60s + + # If we don't wait for this control to be enabled, the submit results in a 'not found' pop-up (UnexpectedAlertPresentException) + Input Text When Enabled //input[@name='selectedServiceInstance'] ${service_instance_id} + Click Button button=Submit + Wait Until Page Contains Element link=View/Edit timeout=60s + Click Element link=View/Edit + Wait Until Page Contains View/Edit Service Instance timeout=60s + ${status} ${data}= Run Keyword And Ignore Error Wait Until Element Is Visible xpath=//li/div/a/span[@class='glyphicon glyphicon-remove'] timeout=120s + Return From Keyword If '${status}' == 'FAIL' + + # At least one more Remove! + + # This list is a bit ogf a hack to determine the order of removal if there is more than one remove icon. + # Cannot tell how this will hold up once all of the VID removes are working for all conditions. + ${remove_order}= Create List Vfmodule_Ete + :for ${remove_first} in @{remove_order} + \ ${status} ${data}= Run Keyword And Ignore Error Page Should Contain Element xpath=//li/div[contains(.,'${remove_first}')]/a/span[@class='glyphicon glyphicon-remove'] + \ Run Keyword If '${status}' == 'PASS' Click On Element When Visible xpath=//li/div[contains(.,'${remove_first}')]/a/span[@class='glyphicon glyphicon-remove'] timeout=120s + \ Run Keyword If '${status}' == 'FAIL' Click On Element When Visible xpath=//li/div/a/span[@class='glyphicon glyphicon-remove'] timeout=120s + + Wait Until Page Contains Element xpath=//select[@parameter-id='lcpRegion'] + Select From List By Label xpath=//select[@parameter-id='lcpRegion'] ${lcp_region} + Select From List By Label xpath=//select[@parameter-id='tenant'] ${tenant} + Click Element xpath=//div[@class='buttonRow']/button[@ngx-enabled='true'] + #//*[@id="mContent"]/div/div/div/div/table/tbody/tr/td/div/div[2]/div/div[1]/div[5]/button[1] + Wait Until Page Contains Status:COMPLETE - 300s + ${response text}= Get Text xpath=//div[@ng-controller='deletionDialogController']//div[@ng-controller= 'msoCommitController']/pre[@class = 'log ng-binding'] + ${request_id}= Parse Request Id ${response text} + Click Element button=Close + Poll MSO Get Request ${GLOBAL_MSO_STATUS_PATH}${request_id} COMPLETE + Fail Successful VID Delete - continue with next delete + diff --git a/robot/resources/vid/vid_interface.robot b/robot/resources/vid/vid_interface.robot new file mode 100644 index 00000000..78b81484 --- /dev/null +++ b/robot/resources/vid/vid_interface.robot @@ -0,0 +1,101 @@ +*** Settings *** +Documentation The main interface for interacting with VID. It handles low level stuff like managing the selenium request library and VID required steps +Library ExtendedSelenium2Library +Library Collections +Library String +Library RequestsLibrary +Library UUID +Resource ../global_properties.robot +Resource ../browser_setup.robot + +*** Variables *** +${VID_ENV} /vid +${VID_LOGIN_URL} ${GLOBAL_VID_SERVER}${VID_ENV}/login_external.htm +${VID_HEALTHCHECK_PATH} ${VID_ENV}/api/users +${VID_HOME_URL} ${GLOBAL_VID_SERVER}${VID_ENV}/vidhome.htm + +*** Keywords *** +Run VID Health Check + [Documentation] Logs in to VID GUI + ${resp}= Run VID Get Request ${VID_HEALTHCHECK_PATH} + Should Be Equal As Strings ${resp.status_code} 200 + Should Be String ${resp.json()[0]['loginId']} + +Run VID Get Request + [Documentation] Runs an VID get request + [Arguments] ${data_path} + ${auth}= Create List ${GLOBAL_VID_HEALTH_USERNAME} ${GLOBAL_VID_HEALTH_PASSWORD} + Log Creating session ${GLOBAL_VID_SERVER} + ${session}= Create Session vid ${GLOBAL_VID_SERVER} auth=${auth} + ${uuid}= Generate UUID + ${headers}= Create Dictionary username=${GLOBAL_VID_HEALTH_USERNAME} password=${GLOBAL_VID_HEALTH_PASSWORD} Accept=application/json Content-Type=application/json X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID} + ${resp}= Get Request vid ${data_path} headers=${headers} + Log Received response from vid ${resp.text} + [Return] ${resp} + +Login To VID GUI + [Documentation] Logs in to VID GUI + # Setup Browser Now being managed by test case + ##Setup Browser + Go To ${VID_LOGIN_URL} + Maximize Browser Window + Set Selenium Speed ${GLOBAL_SELENIUM_DELAY} + Set Browser Implicit Wait ${GLOBAL_SELENIUM_BROWSER_IMPLICIT_WAIT} + Log Logging in to ${GLOBAL_VID_SERVER}${VID_ENV} + Handle Proxy Warning + Title Should Be VID Login + Input Text xpath=//input[@ng-model='loginId'] ${GLOBAL_VID_USERNAME} + Input Password xpath=//input[@ng-model='password'] ${GLOBAL_VID_PASSWORD} + Click Button xpath=//input[@id='loginBtn'] + Wait Until Page Contains Element xpath=//div[@class='applicationWindow'] ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT} + Log Logged in to ${GLOBAL_VID_SERVER}${VID_ENV} + +Go To VID HOME + [Documentation] Naviage to VID Home + Go To ${VID_HOME_URL} + Wait Until Page Contains Element xpath=//div[@class='applicationWindow'] ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT} + +Click On Button When Enabled + [Arguments] ${xpath} ${timeout}=60s + Wait Until Page Contains Element xpath=${xpath} ${timeout} + Wait Until Element Is Enabled xpath=${xpath} ${timeout} + Click Button xpath=${xpath} + +Click On Button When Visible + [Arguments] ${xpath} ${timeout}=60s + Wait Until Page Contains Element xpath=${xpath} ${timeout} + Wait Until Element Is Visible xpath=${xpath} ${timeout} + Click Button xpath=${xpath} + +Click On Element When Visible + [Arguments] ${xpath} ${timeout}=60s + Wait Until Page Contains Element xpath=${xpath} ${timeout} + Wait Until Element Is Visible xpath=${xpath} ${timeout} + Click Element xpath=${xpath} + +Select From List When Enabled + [Arguments] ${xpath} ${value} ${timeout}=60s + Wait Until Page Contains Element xpath=${xpath} ${timeout} + Wait Until Element Is Enabled xpath=${xpath} ${timeout} + Select From List xpath=${xpath} ${value} + +Input Text When Enabled + [Arguments] ${xpath} ${value} ${timeout}=60s + Wait Until Page Contains Element xpath=${xpath} ${timeout} + Wait Until Element Is Enabled xpath=${xpath} ${timeout} + Input Text xpath=${xpath} ${value} + +Parse Request Id + [Arguments] ${mso_response_text} + ${request_list}= Split String ${mso_response_text} 202)\n 1 + ${clean_string}= Replace String ${request_list[1]} \n ${empty} + ${json}= To Json ${clean_string} + ${request_id}= Catenate ${json['requestReferences']['requestId']} + [Return] ${request_id} + +Parse Instance Id + [Arguments] ${mso_response_text} + ${request_list}= Split String ${mso_response_text} 202)\n 1 + ${json}= To Json ${request_list[1]} + ${request_id}= Catenate ${json['requestReferences']['instanceId']} + [Return] ${request_id} \ No newline at end of file -- cgit 1.2.3-korg