--- /dev/null
+from Selenium2Library import Selenium2Library
+from selenium.webdriver.common.keys import Keys
+import time
+
+class CustomSeleniumLibrary(Selenium2Library):
+ def insert_into_prompt(self, text):
+ alert = None
+ try:
+ time.sleep(5)
+ listOfFields = text.split(" ")
+ allInOneString=""
+ for temp in listOfFields:
+ allInOneString=allInOneString+temp+Keys.TAB
+
+ alert= self._current_browser().switch_to_alert()
+ alert.send_keys(allInOneString)
+ except WebDriverException:
+ raise RuntimeError('There were no alert')
+
+
INTERVAL=5
TIME=0
while [ "$TIME" -lt "$TIME_OUT" ]; do
- response=$(curl --write-out '%{http_code}' --silent --output /dev/null -vk --key config/org.onap.clamp.keyfile https://localhost:8443/restservices/clds/v1/clds/healthcheck); echo $response
+ response=$(curl --write-out '%{http_code}' --silent --output /dev/null -vk --key config/org.onap.clamp.keyfile https://localhost:8443/restservices/clds/v1/healthcheck); echo $response
if [ "$response" == "200" ]; then
echo Clamp and its database well started in $TIME seconds
*** Test Cases ***
Get Requests health check ok
Create the sessions
- ${resp}= Get Request ${clamp_session} /restservices/clds/v1/clds/healthcheck
+ ${resp}= Get Request ${clamp_session} /restservices/clds/v1/healthcheck
Should Be Equal As Strings ${resp.status_code} 200
Get Requests verify test template found
*** Test Cases ***
Get Requests health check ok
- ${resp}= Get Request ${clamp_session} /restservices/clds/v1/clds/healthcheck
+ ${resp}= Get Request ${clamp_session} /restservices/clds/v1/healthcheck
Should Be Equal As Strings ${resp.status_code} 200
Get Requests verify test template found
*** Test Cases ***
Get Clamp properties
- ${resp}= Get Request ${clamp_session} /restservices/clds/v1/clds/properties
- Dictionary Should Contain Key ${resp.json()} global
- Dictionary Should Contain Key ${resp.json()['global']} location
+ ${resp}= Get Request ${clamp_session} /restservices/clds/v1/clds/cldsInfo
+ Dictionary Should Contain Key ${resp.json()} userName
+ Dictionary Should Contain Key ${resp.json()} permissionReadCl
Get Clamp Info
${resp}= Get Request ${clamp_session} /restservices/clds/v1/clds/cldsInfo
Library RequestsLibrary
Library OperatingSystem
Library json
-Library Selenium2Library
+Library ../../../scripts/clamp/python-lib/CustomSeleniumLibrary.py
Library XvfbRobot
*** Variables ***
*** Test Cases ***
Get Requests health check ok
Create the sessions
- ${resp}= Get Request ${clamp_session} /restservices/clds/v1/clds/healthcheck
+ ${resp}= Get Request ${clamp_session} /restservices/clds/v1/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 disable the line.
Start Virtual Display 1920 1080
- Open Browser ${BASE_URL}/designer/index.html browser=firefox
Set Selenium Speed ${SELENIUM_SPEED_SLOW}
+ Open Browser ${BASE_URL}/designer/index.html browser=firefox
+
+Reply to authentication popup
+ Run Keyword And Ignore Error Insert into prompt ${login} ${passw}
+ Confirm action
+
+Good Login to Clamp UI and Verify logged in
Set Window Size 1920 1080
${title}= Get Title
Should Be Equal CLDS ${title}
-
-Good Login to Clamp UI and Verify logged in
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
Close Browser
Close Browser
-
-Verify Holmes CL well created
- ${resp}= Get Request ${clamp_session} /restservices/clds/v1/clds/model-names
- Should Contain Match ${resp} *HolmesModel1*
- Should Not Contain Match ${resp} *HolmesModel99*
Library RequestsLibrary
Library OperatingSystem
Library json
-Library Selenium2Library
+Library ../../../scripts/clamp/python-lib/CustomSeleniumLibrary.py
Library XvfbRobot
*** Variables ***
*** Test Cases ***
Get Requests health check ok
- ${resp}= Get Request ${clamp_session} /restservices/clds/v1/clds/healthcheck
+ ${resp}= Get Request ${clamp_session} /restservices/clds/v1/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 disable the line.
Start Virtual Display 1920 1080
- Open Browser ${BASE_URL}/designer/index.html browser=firefox
Set Selenium Speed ${SELENIUM_SPEED_SLOW}
+ Open Browser ${BASE_URL}/designer/index.html browser=firefox
+
+Reply to authentication popup
+ Run Keyword And Ignore Error Insert into prompt ${login} ${passw}
+ Confirm action
+
+Good Login to Clamp UI and Verify logged in
Set Window Size 1920 1080
${title}= Get Title
Should Be Equal CLDS ${title}
-
-Good Login to Clamp UI and Verify logged in
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
Close Browser
Close Browser
-
-Verify TCA CL well create
- ${resp}= Get Request ${clamp_session} /restservices/clds/v1/clds/model-names
- Should Contain Match ${resp} *TCAModel1*
- Should Not Contain Match ${resp} *TCAModel99*
${passw} password
*** Test Cases ***
+Verify Holmes CL well created
+ ${resp}= Get Request ${clamp_session} /restservices/clds/v1/clds/model-names
+ Should Contain Match ${resp} *HolmesModel1*
+ Should Not Contain Match ${resp} *HolmesModel99*
+
+Verify TCA CL well create
+ ${resp}= Get Request ${clamp_session} /restservices/clds/v1/clds/model-names
+ Should Contain Match ${resp} *TCAModel1*
+ Should Not Contain Match ${resp} *TCAModel99*
+
Verify HolmesModel1
${resp}= Get Request ${clamp_session} /restservices/clds/v1/clds/model/HolmesModel1
Should Contain Match ${resp} *templateHolmes1*
Library RequestsLibrary
Library OperatingSystem
Library json
-Library Selenium2Library
+Library ../../../scripts/clamp/python-lib/CustomSeleniumLibrary.py
Library XvfbRobot
*** Variables ***
*** Test Cases ***
Get Requests health check ok
- ${resp}= Get Request ${clamp_session} /restservices/clds/v1/clds/healthcheck
+ ${resp}= Get Request ${clamp_session} /restservices/clds/v1/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 disable the line.
Start Virtual Display 1920 1080
- Open Browser ${BASE_URL}/designer/index.html browser=firefox
Set Selenium Speed ${SELENIUM_SPEED_SLOW}
+ Open Browser ${BASE_URL}/designer/index.html browser=firefox
+
+Reply to authentication popup
+ Run Keyword And Ignore Error Insert into prompt ${login} ${passw}
+ Confirm action
+
+Good Login to Clamp UI and Verify logged in
Set Window Size 1920 1080
${title}= Get Title
Should Be Equal CLDS ${title}
-
-Good Login to Clamp UI and Verify logged in
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
Library RequestsLibrary
Library OperatingSystem
Library json
-Library Selenium2Library
+Library ../../../scripts/clamp/python-lib/CustomSeleniumLibrary.py
Library XvfbRobot
*** Variables ***
*** Test Cases ***
Get Requests health check ok
- ${resp}= Get Request ${clamp_session} /restservices/clds/v1/clds/healthcheck
+ ${resp}= Get Request ${clamp_session} /restservices/clds/v1/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 disable the line.
Start Virtual Display 1920 1080
- Open Browser ${BASE_URL}/designer/index.html browser=firefox
Set Selenium Speed ${SELENIUM_SPEED_SLOW}
+ Open Browser ${BASE_URL}/designer/index.html browser=firefox
+
+Reply to authentication popup
+ Run Keyword And Ignore Error Insert into prompt ${login} ${passw}
+ Confirm action
+
+Good Login to Clamp UI and Verify logged in
Set Window Size 1920 1080
${title}= Get Title
Should Be Equal CLDS ${title}
-
-Good Login to Clamp UI and Verify logged in
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