From 5b9917d3ad117491b5bd89ee63c4752c4add4a27 Mon Sep 17 00:00:00 2001 From: ehautot Date: Tue, 27 Feb 2018 18:32:11 +0100 Subject: Add more integration tests for clamp APIs UIs Change-Id: I7a48bf19f72215316f3fb63db7a4f8a62f7b1aea Signed-off-by: ehautot Issue-ID: CLAMP-100 --- test/csit/tests/clamp/APIs/01__Create_CL_TCA.robot | 46 -------------- test/csit/tests/clamp/APIs/02__Create_CL_TCA.robot | 46 ++++++++++++++ test/csit/tests/clamp/APIs/03__VariousApis.robot | 8 --- .../tests/clamp/APIs/04__Verify_API_Models.robot | 73 ++++++++++++++++++++++ .../tests/clamp/UIs/01__Create_Holmes_model.robot | 33 +++++++++- .../tests/clamp/UIs/02__Create_TCA_model.robot | 28 ++++++++- .../tests/clamp/UIs/03__Verify_UI_Models.robot | 44 +++++++++++++ 7 files changed, 220 insertions(+), 58 deletions(-) delete mode 100644 test/csit/tests/clamp/APIs/01__Create_CL_TCA.robot create mode 100644 test/csit/tests/clamp/APIs/02__Create_CL_TCA.robot create mode 100644 test/csit/tests/clamp/APIs/04__Verify_API_Models.robot create mode 100644 test/csit/tests/clamp/UIs/03__Verify_UI_Models.robot (limited to 'test/csit') diff --git a/test/csit/tests/clamp/APIs/01__Create_CL_TCA.robot b/test/csit/tests/clamp/APIs/01__Create_CL_TCA.robot deleted file mode 100644 index 4805ced60..000000000 --- a/test/csit/tests/clamp/APIs/01__Create_CL_TCA.robot +++ /dev/null @@ -1,46 +0,0 @@ -*** Settings *** -Library Collections -Library RequestsLibrary -Library OperatingSystem -Library json - - -*** Test Cases *** -Get Requests health check ok - CreateSession clamp http://localhost:8080 - ${resp}= Get Request clamp /restservices/clds/v1/clds/healthcheck - Should Be Equal As Strings ${resp.status_code} 200 - -Get Requests verify test template found - ${auth}= Create List admin 5f4dcc3b5aa765d61d8327deb882cf99 - Create Session clamp http://localhost:8080 auth=${auth} - ${resp}= Get Request clamp /restservices/clds/v1/cldsTempate/template-names - Should Be Equal As Strings ${resp.status_code} 200 - Should Contain Match ${resp} *templateTCA1* - Should Contain Match ${resp} *templateTCA2* - Should Not Contain Match ${resp} *templateTCA99* - -Put Requests to add Close Loop ClHolmes1 - ${auth}= Create List admin 5f4dcc3b5aa765d61d8327deb882cf99 - Create Session clamp http://localhost:8080 auth=${auth} - ${data}= Get Binary File ${CURDIR}${/}data${/}createClTCA1.json - &{headers}= Create Dictionary Content-Type=application/json - ${resp}= Put Request clamp /restservices/clds/v1/clds/model/ClTCA1 data=${data} headers=${headers} - Should Be Equal As Strings ${resp.status_code} 200 - -Put Requests to add Close Loop ClHolmes2 - ${auth}= Create List admin 5f4dcc3b5aa765d61d8327deb882cf99 - Create Session clamp http://localhost:8080 auth=${auth} - ${data}= Get Binary File ${CURDIR}${/}data${/}createClTCA2.json - &{headers}= Create Dictionary Content-Type=application/json - ${resp}= Put Request clamp /restservices/clds/v1/clds/model/ClTCA2 data=${data} headers=${headers} - Should Be Equal As Strings ${resp.status_code} 200 - -Get Requests verify CL1 found - ${auth}= Create List admin 5f4dcc3b5aa765d61d8327deb882cf99 - Create Session clamp http://localhost:8080 auth=${auth} - ${resp}= Get Request clamp /restservices/clds/v1/clds/model-names - Should Be Equal As Strings ${resp.status_code} 200 - Should Contain Match ${resp} *ClTCA1* - Should Contain Match ${resp} *ClTCA2* - Should Not Contain Match ${resp} *ClTCA99* diff --git a/test/csit/tests/clamp/APIs/02__Create_CL_TCA.robot b/test/csit/tests/clamp/APIs/02__Create_CL_TCA.robot new file mode 100644 index 000000000..4805ced60 --- /dev/null +++ b/test/csit/tests/clamp/APIs/02__Create_CL_TCA.robot @@ -0,0 +1,46 @@ +*** Settings *** +Library Collections +Library RequestsLibrary +Library OperatingSystem +Library json + + +*** Test Cases *** +Get Requests health check ok + CreateSession clamp http://localhost:8080 + ${resp}= Get Request clamp /restservices/clds/v1/clds/healthcheck + Should Be Equal As Strings ${resp.status_code} 200 + +Get Requests verify test template found + ${auth}= Create List admin 5f4dcc3b5aa765d61d8327deb882cf99 + Create Session clamp http://localhost:8080 auth=${auth} + ${resp}= Get Request clamp /restservices/clds/v1/cldsTempate/template-names + Should Be Equal As Strings ${resp.status_code} 200 + Should Contain Match ${resp} *templateTCA1* + Should Contain Match ${resp} *templateTCA2* + Should Not Contain Match ${resp} *templateTCA99* + +Put Requests to add Close Loop ClHolmes1 + ${auth}= Create List admin 5f4dcc3b5aa765d61d8327deb882cf99 + Create Session clamp http://localhost:8080 auth=${auth} + ${data}= Get Binary File ${CURDIR}${/}data${/}createClTCA1.json + &{headers}= Create Dictionary Content-Type=application/json + ${resp}= Put Request clamp /restservices/clds/v1/clds/model/ClTCA1 data=${data} headers=${headers} + Should Be Equal As Strings ${resp.status_code} 200 + +Put Requests to add Close Loop ClHolmes2 + ${auth}= Create List admin 5f4dcc3b5aa765d61d8327deb882cf99 + Create Session clamp http://localhost:8080 auth=${auth} + ${data}= Get Binary File ${CURDIR}${/}data${/}createClTCA2.json + &{headers}= Create Dictionary Content-Type=application/json + ${resp}= Put Request clamp /restservices/clds/v1/clds/model/ClTCA2 data=${data} headers=${headers} + Should Be Equal As Strings ${resp.status_code} 200 + +Get Requests verify CL1 found + ${auth}= Create List admin 5f4dcc3b5aa765d61d8327deb882cf99 + Create Session clamp http://localhost:8080 auth=${auth} + ${resp}= Get Request clamp /restservices/clds/v1/clds/model-names + Should Be Equal As Strings ${resp.status_code} 200 + Should Contain Match ${resp} *ClTCA1* + Should Contain Match ${resp} *ClTCA2* + Should Not Contain Match ${resp} *ClTCA99* diff --git a/test/csit/tests/clamp/APIs/03__VariousApis.robot b/test/csit/tests/clamp/APIs/03__VariousApis.robot index 47441e894..f875e4c62 100644 --- a/test/csit/tests/clamp/APIs/03__VariousApis.robot +++ b/test/csit/tests/clamp/APIs/03__VariousApis.robot @@ -30,14 +30,6 @@ Get model bpmn by name Should Contain Match ${resp} *Policy_* Should Contain Match ${resp} *EndEvent_* -Get model by name - ${auth}= Create List admin 5f4dcc3b5aa765d61d8327deb882cf99 - Create Session clamp http://localhost:8080 auth=${auth} - ${resp}= Get Request clamp /restservices/clds/v1/clds/model/ClHolmes1 - Dictionary Should Contain Key ${resp.json()} templateName - Dictionary Should Contain Key ${resp.json()} bpmnText - Dictionary Should Contain Key ${resp.json()} imageText - Get model names ${auth}= Create List admin 5f4dcc3b5aa765d61d8327deb882cf99 Create Session clamp http://localhost:8080 auth=${auth} diff --git a/test/csit/tests/clamp/APIs/04__Verify_API_Models.robot b/test/csit/tests/clamp/APIs/04__Verify_API_Models.robot new file mode 100644 index 000000000..f4f762690 --- /dev/null +++ b/test/csit/tests/clamp/APIs/04__Verify_API_Models.robot @@ -0,0 +1,73 @@ +*** Settings *** +Library Collections +Library RequestsLibrary +Library OperatingSystem +Library json + +*** Test Cases *** +Verify HolmesModel1 + ${auth}= Create List admin 5f4dcc3b5aa765d61d8327deb882cf99 + Create Session clamp http://localhost:8080 auth=${auth} + ${resp}= Get Request clamp /restservices/clds/v1/clds/model/ClHolmes1 + Should Contain Match ${resp} *templateHolmes1* + Should Contain Match ${resp} *DC1* + Should Contain Match ${resp} *DC2* + Should Contain Match ${resp} *Policy1* + Should Contain Match ${resp} *vnfRecipe* + Should Contain Match ${resp} *180* + Should Contain Match ${resp} *345* + Should Contain Match ${resp} *Config Policy name1* + +Verify HolmesModel2 + ${auth}= Create List admin 5f4dcc3b5aa765d61d8327deb882cf99 + Create Session clamp http://localhost:8080 auth=${auth} + ${resp}= Get Request clamp /restservices/clds/v1/clds/model/ClHolmes2 + Should Contain Match ${resp} *templateHolmes2* + Should Contain Match ${resp} *DC2* + Should Contain Match ${resp} *DC3* + Should Contain Match ${resp} *Policy2* + Should Contain Match ${resp} *enbRecipe* + Should Contain Match ${resp} *reset* + Should Contain Match ${resp} *360* + Should Contain Match ${resp} *345* + Should Contain Match ${resp} *Config Policy Name2* + +Verify TCAModel1 + ${auth}= Create List admin 5f4dcc3b5aa765d61d8327deb882cf99 + Create Session clamp http://localhost:8080 auth=${auth} + ${resp}= Get Request clamp /restservices/clds/v1/clds/model/ClTCA1 + Should Contain Match ${resp} *templateTCA1* + Should Contain Match ${resp} *vnfRecipe* + Should Contain Match ${resp} *DC1* + Should Contain Match ${resp} *DC2* + Should Contain Match ${resp} *Policy3* + Should Contain Match ${resp} *345* + Should Contain Match ${resp} *200* + Should Contain Match ${resp} *ONSET* + +Verify TCAModel2 + ${auth}= Create List admin 5f4dcc3b5aa765d61d8327deb882cf99 + Create Session clamp http://localhost:8080 auth=${auth} + ${resp}= Get Request clamp /restservices/clds/v1/clds/model/ClTCA2 + Should Contain Match ${resp} *templateTCA2* + Should Contain Match ${resp} *vnfRecipe* + Should Contain Match ${resp} *DC1* + Should Contain Match ${resp} *DC2* + Should Contain Match ${resp} *DC3* + Should Contain Match ${resp} *Policy4* + Should Contain Match ${resp} *vLoadBalancer* + Should Contain Match ${resp} *345* + Should Contain Match ${resp} *300* + Should Contain Match ${resp} *VM* + +Get model names + ${auth}= Create List admin 5f4dcc3b5aa765d61d8327deb882cf99 + Create Session clamp http://localhost:8080 auth=${auth} + ${resp}= Get Request clamp /restservices/clds/v1/clds/model-names + Should Contain Match ${resp} *ClHolmes1* + Should Contain Match ${resp} *ClHolmes2* + Should Contain Match ${resp} *ClTCA1* + Should Contain Match ${resp} *ClTCA2* + Should Not Contain Match ${resp} *ClTCA99* + Should Not Contain Match ${resp} *ClHolmes99* + diff --git a/test/csit/tests/clamp/UIs/01__Create_Holmes_model.robot b/test/csit/tests/clamp/UIs/01__Create_Holmes_model.robot index 7a45dbb80..a94255099 100644 --- a/test/csit/tests/clamp/UIs/01__Create_Holmes_model.robot +++ b/test/csit/tests/clamp/UIs/01__Create_Holmes_model.robot @@ -7,8 +7,8 @@ Library Selenium2Library Library XvfbRobot *** Variables *** -${SELENIUM_SPEED_FAST} 0.2 seconds -${SELENIUM_SPEED_SLOW} 2 seconds +${SELENIUM_SPEED_FAST} .2 seconds +${SELENIUM_SPEED_SLOW} .5 seconds *** Test Cases *** Get Requests health check ok @@ -41,6 +41,35 @@ Create Model from Menu Select From List By Label id=templateName templateHolmes1 Click Button locator=Create +Set Properties for HolmesModel1 + Wait Until Element Is Visible xpath=//*[@id="navbar"]/ul/li[1]/a timeout=60 + Click Element xpath=//*[@id="navbar"]/ul/li[1]/a + Wait Until Element Is Visible locator=Properties CL timeout=60 + Click Element locator=Properties CL + Select From List By Label id=service vFirewall + Select From List By Label id=vf vFirewall 0 + Select From List By Label id=actionSet VNF + Select From List By Label id=location Data Center 2 Data Center 3 + Click Button locator=Save + +Set Policy Box properties for HolmesModel1 + Wait Until Element Is Visible xpath=//*[@data-element-id="Policy_136qatf"] timeout=60 + Click Element xpath=//*[@data-element-id="Policy_136qatf"] + Click Button locator=New Policy + Input Text locator=//*[@id="pname"] text=Policy1 + Select From List By Label id=recipe Migrate + Input Text locator=maxRetries text=5 + Input Text locator=retryTimeLimit text=240 + Input Text locator=timeout text=390 + Click Button locator=Close + +Set Holmes Box properties for HolmesModel1 + Wait Until Element Is Visible xpath=//*[@data-element-id="Holmes_1gxp0mm"] timeout=60 + Click Element xpath=//*[@data-element-id="Holmes_1gxp0mm"] + Input Text locator=correlationalLogic text=correlational Logic1 + Input Text locator=configPolicyName text=config Policy Name1 + Click Button locator=Save + Save Model from Menu Wait Until Element Is Visible xpath=//*[@id="navbar"]/ul/li[1]/a timeout=60 Click Element xpath=//*[@id="navbar"]/ul/li[1]/a diff --git a/test/csit/tests/clamp/UIs/02__Create_TCA_model.robot b/test/csit/tests/clamp/UIs/02__Create_TCA_model.robot index e0240721c..caacec36a 100644 --- a/test/csit/tests/clamp/UIs/02__Create_TCA_model.robot +++ b/test/csit/tests/clamp/UIs/02__Create_TCA_model.robot @@ -7,8 +7,8 @@ Library Selenium2Library Library XvfbRobot *** Variables *** -${SELENIUM_SPEED_FAST} 0.2 seconds -${SELENIUM_SPEED_SLOW} 2 seconds +${SELENIUM_SPEED_FAST} .2 seconds +${SELENIUM_SPEED_SLOW} .5 seconds *** Test Cases *** Get Requests health check ok @@ -41,6 +41,30 @@ Create Model from Menu Select From List By Label id=templateName templateTCA1 Click Button locator=Create +Set Properties for TCAModel1 + Wait Until Element Is Visible xpath=//*[@id="navbar"]/ul/li[1]/a timeout=60 + Click Element xpath=//*[@id="navbar"]/ul/li[1]/a + Wait Until Element Is Visible locator=Properties CL timeout=60 + Click Element locator=Properties CL + Select From List By Label id=service vLoadBalancer + Select From List By Label id=vf vLoadBalancer 0 + Select From List By Label id=actionSet eNodeB + Select From List By Label id=location Data Center 1 Data Center 3 + Click Button locator=Save + +Set Policy Box properties for TCAModel1 + Wait Until Element Is Visible xpath=//*[@data-element-id="Policy_12lup3h"] timeout=60 + Click Element xpath=//*[@data-element-id="Policy_12lup3h"] + Click Button locator=New Policy + Input Text locator=//*[@id="pname"] text=Policy2 + Select From List By Label id=recipe Reset + Input Text locator=maxRetries text=6 + Input Text locator=retryTimeLimit text=280 + Input Text locator=timeout text=400 + Click Button locator=Close + +### Cannot set TCA box attributes due to element not interractable with Selenium + Save Model from Menu Wait Until Element Is Visible xpath=//*[@id="navbar"]/ul/li[1]/a timeout=60 Click Element xpath=//*[@id="navbar"]/ul/li[1]/a diff --git a/test/csit/tests/clamp/UIs/03__Verify_UI_Models.robot b/test/csit/tests/clamp/UIs/03__Verify_UI_Models.robot new file mode 100644 index 000000000..c866174f1 --- /dev/null +++ b/test/csit/tests/clamp/UIs/03__Verify_UI_Models.robot @@ -0,0 +1,44 @@ +*** Settings *** +Library Collections +Library RequestsLibrary +Library OperatingSystem +Library jsons + +*** Test Cases *** +Verify HolmesModel1 + ${auth}= Create List admin 5f4dcc3b5aa765d61d8327deb882cf99 + Create Session clamp http://localhost:8080 auth=${auth} + ${resp}= Get Request clamp /restservices/clds/v1/clds/model/HolmesModel1 + Should Contain Match ${resp} *templateHolmes1* + Should Contain Match ${resp} *DC2* + Should Contain Match ${resp} *DC3* + Should Contain Match ${resp} *Policy1* + Should Contain Match ${resp} *07e266fc-49ab-4cd7-8378-ca4676f1b9ec* + Should Contain Match ${resp} *migrate* + Should Contain Match ${resp} *240* + Should Contain Match ${resp} *390* + Should Contain Match ${resp} *correlational Logic1* + Should Contain Match ${resp} *config Policy Name1* + +Verify TCAModel1 + ${auth}= Create List admin 5f4dcc3b5aa765d61d8327deb882cf99 + Create Session clamp http://localhost:8080 auth=${auth} + ${resp}= Get Request clamp /restservices/clds/v1/clds/model/TCAModel1 + Should Contain Match ${resp} *templateTCA1* + Should Contain Match ${resp} *c95b0e7c-c1f0-4287-9928-7964c5377a46* + Should Contain Match ${resp} *enbRecipe* + Should Contain Match ${resp} *DC1* + Should Contain Match ${resp} *DC3* + Should Contain Match ${resp} *Policy2* + Should Contain Match ${resp} *reset* + Should Contain Match ${resp} *280* + Should Contain Match ${resp} *400* + +Get model names + ${auth}= Create List admin 5f4dcc3b5aa765d61d8327deb882cf99 + Create Session clamp http://localhost:8080 auth=${auth} + ${resp}= Get Request clamp /restservices/clds/v1/clds/model-names + Should Contain Match ${resp} *HolmesModel1* + Should Contain Match ${resp} *TCAModel1* + Should Not Contain Match ${resp} *TCAModel99* + Should Not Contain Match ${resp} *HolmesModel99* -- cgit 1.2.3-korg