Add flow tests for unique value RESTs 35/42935/2
authortalig <talig@amdocs.com>
Mon, 16 Apr 2018 05:50:56 +0000 (08:50 +0300)
committerOren Kleks <orenkle@amdocs.com>
Mon, 16 Apr 2018 06:41:53 +0000 (06:41 +0000)
Change-Id: I6ffbdbbcf83b5d17db83c39cc32fcd164ccfd6c0
Issue-ID: SDC-1177
Signed-off-by: talig <talig@amdocs.com>
openecomp-bdd/features/Example_ResponseData_CheckAndManipulation.feature
openecomp-bdd/features/Onboarding/UniqueValue.feature [new file with mode: 0644]
openecomp-bdd/stepDefinitions/General_Steps.js

index d9d9458..ffc74f1 100644 (file)
@@ -5,7 +5,7 @@ Feature: Example for checking response data
     """
     {
       "field1" : "string field",
-      "field2" : "true",
+      "field2" : true,
       "field3": "5",
       "field4" : [{"entry1":"a"},{"entry2":"b"},{"entry3":"c"}]
     }
@@ -15,7 +15,7 @@ Feature: Example for checking response data
 
     # running the different options of checking the respone data
     Then I want to check property "field1" for value "string field"
-    Then I want to check property "field2" to be "true"
+    Then I want to check property "field2" to be true
     Then I want to check property "field3" for value 5
     Then I want to check property "field4" to have length 3
     Then I want to check property "field4[0].entry1" exists
diff --git a/openecomp-bdd/features/Onboarding/UniqueValue.feature b/openecomp-bdd/features/Onboarding/UniqueValue.feature
new file mode 100644 (file)
index 0000000..31e41b9
--- /dev/null
@@ -0,0 +1,33 @@
+Feature: Unique value
+
+  Scenario: List unique types
+    When I want to get path "/unique-types"
+    Then I want to check property "listCount" for value 2
+    And I want to check property "results[0]" for value "VspName"
+    And I want to check property "results[1]" for value "VlmName"
+
+  Scenario: Get unique value - non existing type (negative)
+    Given I want the following to fail with error code "UNIQUE_TYPE_NOT_FOUND"
+    When I want to get path "/unique-types/nonExistingType/values/someValue"
+
+  Scenario: Get unique value - non existing VLM name
+    When I want to get path "/unique-types/VlmName/values/nonExistingName"
+    Then I want to check property "occupied" to be false
+
+  Scenario: Get unique value - non existing VSP name
+    When I want to get path "/unique-types/VspName/values/nonExistingName"
+    Then I want to check property "occupied" to be false
+
+  Scenario: Get unique value - existing VLM name
+    Given I want to create a VLM
+
+    When I want to get path "/unique-types/VlmName/values/{vlm.name}"
+    Then I want to check property "occupied" to be true
+
+  Scenario: Get unique value - existing VSP name
+    Given I want to create a VLM
+    And I want to create a VSP with onboarding type "NetworkPackage"
+    And I want to get path "/vendor-software-products/{item.id}/versions/{item.versionId}"
+
+    When I want to get path "/unique-types/VspName/values/{responseData.name}"
+    Then I want to check property "occupied" to be true
\ No newline at end of file
index b3fb0e9..bf69d8d 100644 (file)
@@ -115,8 +115,8 @@ Then('I want to check property {string} for value {int}', function(string, int)
  * @exampleFile Example_ResponseData_CheckAndManipulation.feature
  * @step I want to check property {string} to be "True/False"
  **/
-Then('I want to check property {string} to be {string}', function(string, string2)  {
-       assert.equal(_.get(this.context.responseData, string), string2.toLowerCase());
+Then('I want to check property {string} to be {word}', function(string, string2)  {
+    assert.equal(_.get(this.context.responseData, string), string2.toLowerCase() == "true");
 });
 /**
  * @module ResponseData