From edc947fbf559172bdd6bed1d6de57c188062514a Mon Sep 17 00:00:00 2001 From: eh552t Date: Fri, 25 Aug 2017 18:00:32 +0200 Subject: Add 2 Models and fix UI test Add 2 Models using the templates created and fix UI test Change-Id: I051aca6afe87e2c93fb0e035432fe72e98bfd5f3 Signed-off-by: eh552t Issue-Id: CLAMP-18 --- test/csit/tests/clamp/TCA/data/createModel1.json | 8 ++++++++ test/csit/tests/clamp/TCA/data/createModel2.json | 8 ++++++++ test/csit/tests/clamp/TCA/test1.robot | 25 ++++++++++++++++++++++++ test/csit/tests/clamp/UIs/test1.robot | 1 + 4 files changed, 42 insertions(+) create mode 100644 test/csit/tests/clamp/TCA/data/createModel1.json create mode 100644 test/csit/tests/clamp/TCA/data/createModel2.json diff --git a/test/csit/tests/clamp/TCA/data/createModel1.json b/test/csit/tests/clamp/TCA/data/createModel1.json new file mode 100644 index 000000000..49ff85c28 --- /dev/null +++ b/test/csit/tests/clamp/TCA/data/createModel1.json @@ -0,0 +1,8 @@ +{ + "name": "Model1", + "controlNamePrefix": "ClosedLoop-", + "bpmnText": " SequenceFlow_0wokvsg SequenceFlow_0wokvsg SequenceFlow_0w8129u SequenceFlow_0w8129u SequenceFlow_0bdkahu SequenceFlow_0bdkahu SequenceFlow_039geog SequenceFlow_039geog ", + "propText": "{\"Collector_04kan6k\":[{\"name\":\"topicPublishes\",\"value\":\"DCAE-COLLECTOR-UCSNMP\"}],\"TCA_0laok3g\":{\"New_Set\":[{\"name\":\"tname\",\"value\":\"New_Set\"},{\"name\":\"tuuid\",\"value\":\"06663292-a9ca-te93-329f-bd12accc6bd9\"},{\"name\":\"tnfc\",\"value\":\"\"},{\"name\":\"tcaEnab\",\"value\":\"on\"},{\"name\":\"tcaPolId\",\"value\":\"\"},{\"name\":\"tcaInt\",\"value\":\"1\"},{\"name\":\"tcaSev\",\"value\":\"Normal\"},{\"name\":\"tcaVio\",\"value\":\"1\"},{\"serviceConfigurations\":[]}]},\"Policy_1u1q61z\":{}}", + "imageText": "", + "templateName": "template1" +} \ No newline at end of file diff --git a/test/csit/tests/clamp/TCA/data/createModel2.json b/test/csit/tests/clamp/TCA/data/createModel2.json new file mode 100644 index 000000000..6e08bc4ad --- /dev/null +++ b/test/csit/tests/clamp/TCA/data/createModel2.json @@ -0,0 +1,8 @@ +{ + "name": "Model2", + "controlNamePrefix": "ClosedLoop-", + "bpmnText": " SequenceFlow_0wokvsg SequenceFlow_0wokvsg SequenceFlow_0w8129u SequenceFlow_0w8129u SequenceFlow_0bdkahu SequenceFlow_0bdkahu SequenceFlow_039geog SequenceFlow_039geog ", + "propText": "{\"Collector_04kan6k\":[{\"name\":\"topicPublishes\",\"value\":\"DCAE-COLLECTOR-UCSNMP\"}],\"TCA_0laok3g\":{\"TCA1\":[{\"name\":\"tname\",\"value\":\"TCA1\"},{\"name\":\"tuuid\",\"value\":\"22edf952-0c3f-t957-94e0-d5911e155aff\"},{\"name\":\"tnfc\",\"value\":\"\"},{\"name\":\"tcaEnab\",\"value\":\"on\"},{\"name\":\"tcaPol\",\"value\":\"Policy1\"},{\"name\":\"tcaPolId\",\"value\":\"0\"},{\"name\":\"tcaInt\",\"value\":\"1\"},{\"name\":\"tcaSev\",\"value\":\"Normal\"},{\"name\":\"tcaVio\",\"value\":\"1\"},{\"serviceConfigurations\":[]}]},\"Policy_1u1q61z\":{\"Policy1\":[{\"name\":\"pname\",\"value\":\"Policy1\"},{\"name\":\"pid\",\"value\":\"0\"},{\"name\":\"timeout\",\"value\":\"345\"},{\"policyConfigurations\":[[{\"name\":\"recipe\",\"value\":[\"migrate\"]},{\"name\":\"maxRetries\",\"value\":[\"3\"]},{\"name\":\"retryTimeLimit\",\"value\":[\"180\"]},{\"name\":\"_id\",\"value\":[\"Maw1TWE\"]},{\"name\":\"parentPolicy\",\"value\":[\"\"]}]]}]},\"global\":[{\"name\":\"service\",\"value\":[\"e27f3679-8d95-4ee1-a5a3-95a7e243306f\"]},{\"name\":\"vf\",\"value\":[\"6c7aaec2-59eb-41d9-8681-b7f976ab668d\"]},{\"name\":\"actionSet\",\"value\":[\"vnfRecipe\"]}]}", + "imageText": "", + "templateName": "template1" +} \ No newline at end of file diff --git a/test/csit/tests/clamp/TCA/test1.robot b/test/csit/tests/clamp/TCA/test1.robot index e9b630f72..b1fb0f440 100644 --- a/test/csit/tests/clamp/TCA/test1.robot +++ b/test/csit/tests/clamp/TCA/test1.robot @@ -36,3 +36,28 @@ Get Requests verify template1 and template2 found 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/test1.robot b/test/csit/tests/clamp/UIs/test1.robot index 942715ce2..fafb00042 100644 --- a/test/csit/tests/clamp/UIs/test1.robot +++ b/test/csit/tests/clamp/UIs/test1.robot @@ -37,6 +37,7 @@ Good Login to Clamp UI and Verify logged in 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 -- cgit 1.2.3-korg