From 118eea2b30c598d8335e78563bc65eea01beae5e Mon Sep 17 00:00:00 2001 From: eh552t Date: Wed, 6 Sep 2017 16:51:14 +0200 Subject: Modify tests to be able to add Holmes Change-Id: Ifee8c7351be96103ed6968068b54242baca6aebc Signed-off-by: eh552t Issue-Id: CLAMP-34 --- test/csit/tests/clamp/TCA/01__TCA.robot | 62 ++++++++++++++++ test/csit/tests/clamp/TCA/test1.robot | 63 ----------------- .../csit/tests/clamp/UIs/01__Create_template.robot | 81 +++++++++++++++++++++ test/csit/tests/clamp/UIs/02__Create_model.robot | 48 +++++++++++++ .../tests/clamp/UIs/test1_create_template.robot | 82 ---------------------- test/csit/tests/clamp/UIs/test2_create_Model.robot | 49 ------------- 6 files changed, 191 insertions(+), 194 deletions(-) create mode 100644 test/csit/tests/clamp/TCA/01__TCA.robot delete mode 100644 test/csit/tests/clamp/TCA/test1.robot create mode 100644 test/csit/tests/clamp/UIs/01__Create_template.robot create mode 100644 test/csit/tests/clamp/UIs/02__Create_model.robot delete mode 100644 test/csit/tests/clamp/UIs/test1_create_template.robot delete mode 100644 test/csit/tests/clamp/UIs/test2_create_Model.robot (limited to 'test/csit') diff --git a/test/csit/tests/clamp/TCA/01__TCA.robot b/test/csit/tests/clamp/TCA/01__TCA.robot new file mode 100644 index 000000000..45f20f248 --- /dev/null +++ b/test/csit/tests/clamp/TCA/01__TCA.robot @@ -0,0 +1,62 @@ +*** 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 + +Put Requests to add template1 with yaml properties + ${auth}= Create List admin 5f4dcc3b5aa765d61d8327deb882cf99 + Create Session clamp http://localhost:8080 auth=${auth} + ${data}= Get Binary File ${CURDIR}${/}data${/}createTemplate1.json + &{headers}= Create Dictionary Content-Type=application/json + ${resp}= Put Request clamp /restservices/clds/v1/cldsTempate/template/template1 data=${data} headers=${headers} + Should Be Equal As Strings ${resp.status_code} 200 + +Put Requests to add template2 with yaml properties + ${auth}= Create List admin 5f4dcc3b5aa765d61d8327deb882cf99 + Create Session clamp http://localhost:8080 auth=${auth} + ${data}= Get Binary File ${CURDIR}${/}data${/}createTemplate2.json + &{headers}= Create Dictionary Content-Type=application/json + ${resp}= Put Request clamp /restservices/clds/v1/cldsTempate/template/template2 data=${data} headers=${headers} + Should Be Equal As Strings ${resp.status_code} 200 + +Get Requests verify template1 and template2 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} *template1* + Should Contain Match ${resp} *template2* + Should Not Contain Match ${resp} *template99* + +Put Requests to add Close Loop Model1 + ${auth}= Create List admin 5f4dcc3b5aa765d61d8327deb882cf99 + Create Session clamp http://localhost:8080 auth=${auth} + ${data}= Get Binary File ${CURDIR}${/}data${/}createModel1.json + &{headers}= Create Dictionary Content-Type=application/json + ${resp}= Put Request clamp /restservices/clds/v1/clds/model/Model1 data=${data} headers=${headers} + Should Be Equal As Strings ${resp.status_code} 200 + +Put Requests to add Close Loop Model2 + ${auth}= Create List admin 5f4dcc3b5aa765d61d8327deb882cf99 + Create Session clamp http://localhost:8080 auth=${auth} + ${data}= Get Binary File ${CURDIR}${/}data${/}createModel2.json + &{headers}= Create Dictionary Content-Type=application/json + ${resp}= Put Request clamp /restservices/clds/v1/clds/model/Model2 data=${data} headers=${headers} + Should Be Equal As Strings ${resp.status_code} 200 + +Get Requests verify Model1 and Model2 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} *Model1* + Should Contain Match ${resp} *Model2* + Should Not Contain Match ${resp} *Model99* diff --git a/test/csit/tests/clamp/TCA/test1.robot b/test/csit/tests/clamp/TCA/test1.robot deleted file mode 100644 index b1fb0f440..000000000 --- a/test/csit/tests/clamp/TCA/test1.robot +++ /dev/null @@ -1,63 +0,0 @@ -*** Settings *** -Library Collections -Library RequestsLibrary -Library OperatingSystem -Library json -Library HttpLibrary.HTTP - - -*** 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 - -Put Requests to add template1 with yaml properties - ${auth}= Create List admin 5f4dcc3b5aa765d61d8327deb882cf99 - Create Session clamp http://localhost:8080 auth=${auth} - ${data}= Get Binary File ${CURDIR}${/}data${/}createTemplate1.json - &{headers}= Create Dictionary Content-Type=application/json - ${resp}= Put Request clamp /restservices/clds/v1/cldsTempate/template/template1 data=${data} headers=${headers} - Should Be Equal As Strings ${resp.status_code} 200 - -Put Requests to add template2 with yaml properties - ${auth}= Create List admin 5f4dcc3b5aa765d61d8327deb882cf99 - Create Session clamp http://localhost:8080 auth=${auth} - ${data}= Get Binary File ${CURDIR}${/}data${/}createTemplate2.json - &{headers}= Create Dictionary Content-Type=application/json - ${resp}= Put Request clamp /restservices/clds/v1/cldsTempate/template/template2 data=${data} headers=${headers} - Should Be Equal As Strings ${resp.status_code} 200 - -Get Requests verify template1 and template2 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} *template1* - Should Contain Match ${resp} *template2* - Should Not Contain Match ${resp} *template99* - -Put Requests to add Close Loop Model1 - ${auth}= Create List admin 5f4dcc3b5aa765d61d8327deb882cf99 - Create Session clamp http://localhost:8080 auth=${auth} - ${data}= Get Binary File ${CURDIR}${/}data${/}createModel1.json - &{headers}= Create Dictionary Content-Type=application/json - ${resp}= Put Request clamp /restservices/clds/v1/clds/model/Model1 data=${data} headers=${headers} - Should Be Equal As Strings ${resp.status_code} 200 - -Put Requests to add Close Loop Model2 - ${auth}= Create List admin 5f4dcc3b5aa765d61d8327deb882cf99 - Create Session clamp http://localhost:8080 auth=${auth} - ${data}= Get Binary File ${CURDIR}${/}data${/}createModel2.json - &{headers}= Create Dictionary Content-Type=application/json - ${resp}= Put Request clamp /restservices/clds/v1/clds/model/Model2 data=${data} headers=${headers} - Should Be Equal As Strings ${resp.status_code} 200 - -Get Requests verify Model1 and Model2 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} *Model1* - Should Contain Match ${resp} *Model2* - Should Not Contain Match ${resp} *Model99* diff --git a/test/csit/tests/clamp/UIs/01__Create_template.robot b/test/csit/tests/clamp/UIs/01__Create_template.robot new file mode 100644 index 000000000..d740ac987 --- /dev/null +++ b/test/csit/tests/clamp/UIs/01__Create_template.robot @@ -0,0 +1,81 @@ +*** Settings *** +Library Collections +Library RequestsLibrary +Library OperatingSystem +Library json +Library Selenium2Library +Library XvfbRobot + + +*** 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 + +Open Browser +# Next line is to be enabled for Headless tests only (jenkins?). To see the tests desable the line. + Start Virtual Display 1920 1080 + Open Browser http://localhost:8080/designer/index.html browser=firefox + Set Selenium Speed .2 seconds + Set Window Size 1920 1080 + ${title}= Get Title + Should Be Equal CLDS ${title} + +Bad Login to Clamp UI and Verify not logged in + Input Text locator=username text=bad_login + Input Text locator=password text=This_is_bad_password + Press Key locator=password key=\\13 + Wait Until Element Is Visible locator=username timeout=5 + Page Should Not Contain Element xpath=//*[@class="navbar-brand logo_name ng-binding"] expected=*Hello:admin* + +Good Login to Clamp UI and Verify logged in + Input Text locator=username text=admin + Input Text locator=password text=password + Press Key locator=password key=\\13 + Wait Until Element Is Visible xpath=//*[@class="navbar-brand logo_name ng-binding"] timeout=60 + Element Text Should Be xpath=//*[@class="navbar-brand logo_name ng-binding"] expected=Hello:admin + +Create Template 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 + Wait Until Element Is Visible locator=Create Template timeout=60 + Click Element locator=Create Template + Input Text locator=modelName text=template + Click Button locator=OK + +Drag and Drop Boxes for template + Wait Until Element Is Visible xpath=//*[@class="entry icon-collector-node"] timeout=60 + Drag And Drop By Offset xpath=//*[@class="entry icon-collector-node"] 280 280 + Drag And Drop By Offset xpath=//*[@class="entry icon-tca-node"] 550 280 + Drag And Drop By Offset xpath=//*[@class="entry icon-policy-node"] 800 280 + Drag And Drop By Offset xpath=//*[@class="entry icon-end-event-none"] 1000 280 + +Drag and Drop Connectors for template + Click Element xpath=//*[starts-with(@data-element-id, "StartEvent_")] + Wait Until Element Is Enabled xpath=//*[@id="js-canvas"]/div/div/div[2]/div[5]/div/div/div[2]/div + Drag And Drop xpath=//*[@id="js-canvas"]/div/div/div[2]/div[5]/div/div/div[2]/div xpath=//*[starts-with(@data-element-id, "Collector_")] + Wait Until Element Is Enabled xpath=//*[@id="js-canvas"]/div/div/div[2]/div[1]/div/div/div[3]/div + Drag And Drop xpath=//*[@id="js-canvas"]/div/div/div[2]/div[1]/div/div/div[3]/div xpath=//*[starts-with(@data-element-id, "TCA_")] + Wait Until Element Is Enabled xpath=//*[@id="js-canvas"]/div/div/div[2]/div[2]/div/div/div[3]/div + Drag And Drop xpath=//*[@id="js-canvas"]/div/div/div[2]/div[2]/div/div/div[3]/div xpath=//*[starts-with(@data-element-id, "Policy_")] + Wait Until Element Is Enabled xpath=//*[@id="js-canvas"]/div/div/div[2]/div[3]/div/div/div[3]/div + Drag And Drop xpath=//*[@id="js-canvas"]/div/div/div[2]/div[3]/div/div/div[3]/div xpath=//*[starts-with(@data-element-id, "EndEvent_")] + +Add Template properties yaml from Menu + Click Element xpath=//*[@id="navbar"]/ul/li[1]/a + Wait Until Element Is Visible locator=Template Properties timeout=60 + Click Element locator=Template Properties + ${data}= Get Binary File ${CURDIR}${/}data${/}TCA_template_properties.yml + Input Text locator=service text=${data} + Click Button locator=Close + +Save Template from Menu + Click Element xpath=//*[@id="navbar"]/ul/li[1]/a + Wait Until Element Is Visible locator=Save Template timeout=60 + Click Element locator=Save Template + Wait Until Element Is Visible xpath=//*[@id="alert_message_"] timeout=60 + Element Text Should Be xpath=//*[@id="alert_message_"] expected=Action Successful:SAVE + +Close Browser + Close Browser \ No newline at end of file diff --git a/test/csit/tests/clamp/UIs/02__Create_model.robot b/test/csit/tests/clamp/UIs/02__Create_model.robot new file mode 100644 index 000000000..979a9802e --- /dev/null +++ b/test/csit/tests/clamp/UIs/02__Create_model.robot @@ -0,0 +1,48 @@ +*** Settings *** +Library Collections +Library RequestsLibrary +Library OperatingSystem +Library json +Library Selenium2Library +Library XvfbRobot + + +*** 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 + +Open Browser +# Next line is to be enabled for Headless tests only (jenkins?). To see the tests desable the line. + Start Virtual Display 1920 1080 + Open Browser http://localhost:8080/designer/index.html browser=firefox + Set Selenium Speed .2 seconds + Set Window Size 1920 1080 + ${title}= Get Title + Should Be Equal CLDS ${title} + +Good Login to Clamp UI and Verify logged in + Input Text locator=username text=admin + Input Text locator=password text=password + Press Key locator=password key=\\13 + Wait Until Element Is Visible xpath=//*[@class="navbar-brand logo_name ng-binding"] timeout=60 + Element Text Should Be xpath=//*[@class="navbar-brand logo_name ng-binding"] expected=Hello:admin + +Create Model from Menu + Wait Until Element Is Visible xpath=//*[@id="navbar"]/ul/li[2]/a timeout=60 + Click Element xpath=//*[@id="navbar"]/ul/li[2]/a + Wait Until Element Is Visible locator=Create CL timeout=60 + Click Element locator=Create CL + Input Text locator=modelName text=model1 + Click Button locator=Create + +Save Model from Menu + Click Element xpath=//*[@id="navbar"]/ul/li[2]/a + Wait Until Element Is Visible locator=Save CL timeout=60 + Click Element locator=Save CL + Wait Until Element Is Visible xpath=//*[@id="alert_message_"] timeout=60 + Element Text Should Be xpath=//*[@id="alert_message_"] expected=Action Successful:SAVE + +Close Browser + Close Browser diff --git a/test/csit/tests/clamp/UIs/test1_create_template.robot b/test/csit/tests/clamp/UIs/test1_create_template.robot deleted file mode 100644 index 008b13d2a..000000000 --- a/test/csit/tests/clamp/UIs/test1_create_template.robot +++ /dev/null @@ -1,82 +0,0 @@ -*** Settings *** -Library Collections -Library RequestsLibrary -Library OperatingSystem -Library json -Library HttpLibrary.HTTP -Library Selenium2Library -Library XvfbRobot - - -*** 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 - -Open Browser -# Next line is to be enabled for Headless tests only (jenkins?). To see the tests desable the line. - Start Virtual Display 1920 1080 - Open Browser http://localhost:8080/designer/index.html browser=firefox - Set Selenium Speed .2 seconds - Set Window Size 1920 1080 - ${title}= Get Title - Should Be Equal CLDS ${title} - -Bad Login to Clamp UI and Verify not logged in - Input Text locator=username text=bad_login - Input Text locator=password text=This_is_bad_password - Press Key locator=password key=\\13 - Wait Until Element Is Visible locator=username timeout=5 - Page Should Not Contain Element xpath=//*[@class="navbar-brand logo_name ng-binding"] expected=*Hello:admin* - -Good Login to Clamp UI and Verify logged in - Input Text locator=username text=admin - Input Text locator=password text=password - Press Key locator=password key=\\13 - Wait Until Element Is Visible xpath=//*[@class="navbar-brand logo_name ng-binding"] timeout=60 - Element Text Should Be xpath=//*[@class="navbar-brand logo_name ng-binding"] expected=Hello:admin - -Create Template 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 - Wait Until Element Is Visible locator=Create Template timeout=60 - Click Element locator=Create Template - Input Text locator=modelName text=template1 - Click Button locator=OK - -Drag and Drop Boxes for template - Wait Until Element Is Visible xpath=//*[@id="js-canvas"]/div/div/div[4]/div[1]/div/div[2] timeout=60 - Drag And Drop By Offset xpath=//*[@id="js-canvas"]/div/div/div[4]/div[1]/div/div[2] 280 280 - Drag And Drop By Offset xpath=//*[@id="js-canvas"]/div/div/div[4]/div[1]/div/div[4] 550 280 - Drag And Drop By Offset xpath=//*[@id="js-canvas"]/div/div/div[4]/div[1]/div/div[5] 800 280 - Drag And Drop By Offset xpath=//*[@id="js-canvas"]/div/div/div[4]/div[1]/div/div[6] 1000 280 - -Drag and Drop Connectors for template - Click Element xpath=//*[starts-with(@data-element-id, "StartEvent_")] - Wait Until Element Is Enabled xpath=//*[@id="js-canvas"]/div/div/div[2]/div[5]/div/div/div[2]/div - Drag And Drop xpath=//*[@id="js-canvas"]/div/div/div[2]/div[5]/div/div/div[2]/div xpath=//*[starts-with(@data-element-id, "Collector_")] - Wait Until Element Is Enabled xpath=//*[@id="js-canvas"]/div/div/div[2]/div[1]/div/div/div[3]/div - Drag And Drop xpath=//*[@id="js-canvas"]/div/div/div[2]/div[1]/div/div/div[3]/div xpath=//*[starts-with(@data-element-id, "TCA_")] - Wait Until Element Is Enabled xpath=//*[@id="js-canvas"]/div/div/div[2]/div[2]/div/div/div[3]/div - Drag And Drop xpath=//*[@id="js-canvas"]/div/div/div[2]/div[2]/div/div/div[3]/div xpath=//*[starts-with(@data-element-id, "Policy_")] - Wait Until Element Is Enabled xpath=//*[@id="js-canvas"]/div/div/div[2]/div[3]/div/div/div[3]/div - Drag And Drop xpath=//*[@id="js-canvas"]/div/div/div[2]/div[3]/div/div/div[3]/div xpath=//*[starts-with(@data-element-id, "EndEvent_")] - -Add Template properties yaml from Menu - Click Element xpath=//*[@id="navbar"]/ul/li[1]/a - Wait Until Element Is Visible locator=Template Properties timeout=60 - Click Element locator=Template Properties - ${data}= Get Binary File ${CURDIR}${/}data${/}TCA_template_properties.yml - Input Text locator=service text=${data} - Click Button locator=Close - -Save Template from Menu - Click Element xpath=//*[@id="navbar"]/ul/li[1]/a - Wait Until Element Is Visible locator=Save Template timeout=60 - Click Element locator=Save Template - Wait Until Element Is Visible xpath=//*[@id="alert_message_"] timeout=60 - Element Text Should Be xpath=//*[@id="alert_message_"] expected=Action Successful:SAVE - -Close Browser - Close Browser \ No newline at end of file diff --git a/test/csit/tests/clamp/UIs/test2_create_Model.robot b/test/csit/tests/clamp/UIs/test2_create_Model.robot deleted file mode 100644 index e8de881bb..000000000 --- a/test/csit/tests/clamp/UIs/test2_create_Model.robot +++ /dev/null @@ -1,49 +0,0 @@ -*** Settings *** -Library Collections -Library RequestsLibrary -Library OperatingSystem -Library json -Library HttpLibrary.HTTP -Library Selenium2Library -Library XvfbRobot - - -*** 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 - -Open Browser -# Next line is to be enabled for Headless tests only (jenkins?). To see the tests desable the line. - Start Virtual Display 1920 1080 - Open Browser http://localhost:8080/designer/index.html browser=firefox - Set Selenium Speed .2 seconds - Set Window Size 1920 1080 - ${title}= Get Title - Should Be Equal CLDS ${title} - -Good Login to Clamp UI and Verify logged in - Input Text locator=username text=admin - Input Text locator=password text=password - Press Key locator=password key=\\13 - Wait Until Element Is Visible xpath=//*[@class="navbar-brand logo_name ng-binding"] timeout=60 - Element Text Should Be xpath=//*[@class="navbar-brand logo_name ng-binding"] expected=Hello:admin - -Create Model from Menu - Wait Until Element Is Visible xpath=//*[@id="navbar"]/ul/li[2]/a timeout=60 - Click Element xpath=//*[@id="navbar"]/ul/li[2]/a - Wait Until Element Is Visible locator=Create CL timeout=60 - Click Element locator=Create CL - Input Text locator=modelName text=model1 - Click Button locator=Create - -Save Model from Menu - Click Element xpath=//*[@id="navbar"]/ul/li[2]/a - Wait Until Element Is Visible locator=Save CL timeout=60 - Click Element locator=Save CL - Wait Until Element Is Visible xpath=//*[@id="alert_message_"] timeout=60 - Element Text Should Be xpath=//*[@id="alert_message_"] expected=Action Successful:SAVE - -Close Browser - Close Browser -- cgit 1.2.3-korg