From 02201e449b644790e99bbb230579d96cae4a53da Mon Sep 17 00:00:00 2001 From: talig Date: Sun, 5 Aug 2018 10:47:36 +0300 Subject: Refactor and add test flows Small fix in version state filter Change-Id: I015cbc52b8620b92ebb4f8f0167711e39d9d30a8 Issue-ID: SDC-1503 Signed-off-by: talig --- workflow-bdd/features/Version.feature | 32 ++++++++++--- workflow-bdd/features/WorkflowList.feature | 52 +++++++++++----------- .../features/examples/ResponseDataChecks.feature | 50 +++++++++++++++++++++ 3 files changed, 101 insertions(+), 33 deletions(-) create mode 100644 workflow-bdd/features/examples/ResponseDataChecks.feature (limited to 'workflow-bdd/features') diff --git a/workflow-bdd/features/Version.feature b/workflow-bdd/features/Version.feature index e43971cb..a5327fd7 100644 --- a/workflow-bdd/features/Version.feature +++ b/workflow-bdd/features/Version.feature @@ -25,15 +25,16 @@ Feature: Workflow Versions Then I want to get path "/workflows/{item.id}/versions/{item.versionId}" And I want to check that property "id" in the response equals to value of saved property "item.versionId" And I want to get path "/workflows/{item.id}/versions" - And I want to check that element in the response list with "id" equals to value of saved property "item.versionId" exists + And I want to check in the list "items" property "id" with value of saved property "item.versionId" exists Scenario: Create first version with inputs/outputs - When I want to set the input data to file "resources/json/createVersionWithInputsOutputs.json" + When I want to set the input data to file "resources/json/versionWith2Inputs2Outputs1.json" And I want to create for path "/workflows/{item.id}/versions" with the input data from the context - And I want to copy to property "item.versionId" from response data path "id" - Then I want to check property "inputs[0].name" for value "in1" - And I want to check property "outputs[0].name" for value "out1" + Then I want to check in the list "inputs" property "name" with value "in1" exists + And I want to check in the list "inputs" property "name" with value "in2" exists + And I want to check in the list "outputs" property "name" with value "out1" exists + And I want to check in the list "outputs" property "name" with value "out2" exists Scenario: Create second version And I want to update the input property "description" with value "first empty version" @@ -50,7 +51,7 @@ Feature: Workflow Versions Then I want to get path "/workflows/{item.id}/versions/{item.versionId}" And I want to check that property "id" in the response equals to value of saved property "item.versionId" And I want to get path "/workflows/{item.id}/versions" - And I want to check that element in the response list with "id" equals to value of saved property "item.versionId" exists + And I want to check in the list "items" property "id" with value of saved property "item.versionId" exists Scenario: Update version And I want to create input data @@ -62,4 +63,21 @@ Feature: Workflow Versions And I want to update for path "/workflows/{item.id}/versions/{item.versionId}" with the input data from the context Then I want to get path "/workflows/{item.id}/versions/{item.versionId}" - And I want to check property "description" for value "workflow version description updated" \ No newline at end of file + And I want to check property "description" for value "workflow version description updated" + + Scenario: Update version with inputs/outputs (create/update/delete parameters) + And I want to set the input data to file "resources/json/versionWith2Inputs2Outputs1.json" + And I want to create for path "/workflows/{item.id}/versions" with the input data from the context + And I want to copy to property "item.versionId" from response data path "id" + + When I want to set the input data to file "resources/json/versionWith2Inputs2Outputs2.json" + And I want to update for path "/workflows/{item.id}/versions/{item.versionId}" with the input data from the context + + Then I want to get path "/workflows/{item.id}/versions/{item.versionId}" + And I want to check in the list "inputs" property "name" with value "in1" exists + And I want to check in the list "inputs" property "name" with value "in2" does not exist + And I want to check in the list "inputs" property "name" with value "in3" exists + And I want to check in the list "outputs" property "name" with value "out1" exists + And I want to check in the list "outputs" property "name" with value "out2" does not exist + And I want to check in the list "outputs" property "name" with value "out3" exists + diff --git a/workflow-bdd/features/WorkflowList.feature b/workflow-bdd/features/WorkflowList.feature index 5b6941ec..3cd27a05 100644 --- a/workflow-bdd/features/WorkflowList.feature +++ b/workflow-bdd/features/WorkflowList.feature @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -Feature: List Workflows +Feature: Workflows list Background: Init - create various workflows in order to test list filter Given I want to create a Workflow @@ -41,36 +41,36 @@ Feature: List Workflows And I want to create for path "/workflows/{item.id}/versions?baseVersionId={item.versionId}" with the input data from the context Scenario: List all - When I want to get path "/workflows?size=2000" - Then I want to check that element in the response list with "id" equals to value of saved property "noVersionsWorkflowId" exists - And I want to check that element in the response list with "id" equals to value of saved property "draftVersionWorkflowId" exists - And I want to check that element in the response list with "id" equals to value of saved property "certifiedVersionWorkflowId" exists - And I want to check that element in the response list with "id" equals to value of saved property "draftAndCertifiedVersionWorkflowId" exists + When I want to get path "/workflows?limit=2000" + Then I want to check in the list "items" property "id" with value of saved property "noVersionsWorkflowId" exists + And I want to check in the list "items" property "id" with value of saved property "draftVersionWorkflowId" exists + And I want to check in the list "items" property "id" with value of saved property "certifiedVersionWorkflowId" exists + And I want to check in the list "items" property "id" with value of saved property "draftAndCertifiedVersionWorkflowId" exists Scenario: List ones with DRAFT version(s) - When I want to get path "/workflows?versionState=DRAFT&size=2000" - Then I want to check that element in the response list with "id" equals to value of saved property "noVersionsWorkflowId" does not exist - And I want to check that element in the response list with "id" equals to value of saved property "draftVersionWorkflowId" exists - And I want to check that element in the response list with "id" equals to value of saved property "certifiedVersionWorkflowId" does not exist - And I want to check that element in the response list with "id" equals to value of saved property "draftAndCertifiedVersionWorkflowId" exists + When I want to get path "/workflows?versionState=DRAFT&limit=2000" + Then I want to check in the list "items" property "id" with value of saved property "noVersionsWorkflowId" does not exist + And I want to check in the list "items" property "id" with value of saved property "draftVersionWorkflowId" exists + And I want to check in the list "items" property "id" with value of saved property "certifiedVersionWorkflowId" does not exist + And I want to check in the list "items" property "id" with value of saved property "draftAndCertifiedVersionWorkflowId" exists Scenario: List ones with CERTIFIED version(s) - When I want to get path "/workflows?versionState=CERTIFIED&size=2000" - Then I want to check that element in the response list with "id" equals to value of saved property "noVersionsWorkflowId" does not exist - And I want to check that element in the response list with "id" equals to value of saved property "draftVersionWorkflowId" does not exist - And I want to check that element in the response list with "id" equals to value of saved property "certifiedVersionWorkflowId" exists - And I want to check that element in the response list with "id" equals to value of saved property "draftAndCertifiedVersionWorkflowId" exists + When I want to get path "/workflows?versionState=CERTIFIED&limit=2000" + Then I want to check in the list "items" property "id" with value of saved property "noVersionsWorkflowId" does not exist + And I want to check in the list "items" property "id" with value of saved property "draftVersionWorkflowId" does not exist + And I want to check in the list "items" property "id" with value of saved property "certifiedVersionWorkflowId" exists + And I want to check in the list "items" property "id" with value of saved property "draftAndCertifiedVersionWorkflowId" exists Scenario: List ones with DRAFT/CERTIFIED version(s) - When I want to get path "/workflows?versionState=DRAFT,CERTIFIED&size=2000" - Then I want to check that element in the response list with "id" equals to value of saved property "noVersionsWorkflowId" does not exist - And I want to check that element in the response list with "id" equals to value of saved property "draftVersionWorkflowId" exists - And I want to check that element in the response list with "id" equals to value of saved property "certifiedVersionWorkflowId" exists - And I want to check that element in the response list with "id" equals to value of saved property "draftAndCertifiedVersionWorkflowId" exists + When I want to get path "/workflows?versionState=DRAFT,CERTIFIED&limit=2000" + Then I want to check in the list "items" property "id" with value of saved property "noVersionsWorkflowId" does not exist + And I want to check in the list "items" property "id" with value of saved property "draftVersionWorkflowId" exists + And I want to check in the list "items" property "id" with value of saved property "certifiedVersionWorkflowId" exists + And I want to check in the list "items" property "id" with value of saved property "draftAndCertifiedVersionWorkflowId" exists Scenario: List ones with gibberish version(s) = none - When I want to get path "/workflows?versionState=gibberish&size=2000" - Then I want to check that element in the response list with "id" equals to value of saved property "noVersionsWorkflowId" does not exist - And I want to check that element in the response list with "id" equals to value of saved property "draftVersionWorkflowId" does not exist - And I want to check that element in the response list with "id" equals to value of saved property "certifiedVersionWorkflowId" does not exist - And I want to check that element in the response list with "id" equals to value of saved property "draftAndCertifiedVersionWorkflowId" does not exist \ No newline at end of file + When I want to get path "/workflows?versionState=gibberish&limit=2000" + Then I want to check in the list "items" property "id" with value of saved property "noVersionsWorkflowId" does not exist + And I want to check in the list "items" property "id" with value of saved property "draftVersionWorkflowId" does not exist + And I want to check in the list "items" property "id" with value of saved property "certifiedVersionWorkflowId" does not exist + And I want to check in the list "items" property "id" with value of saved property "draftAndCertifiedVersionWorkflowId" does not exist \ No newline at end of file diff --git a/workflow-bdd/features/examples/ResponseDataChecks.feature b/workflow-bdd/features/examples/ResponseDataChecks.feature new file mode 100644 index 00000000..2f8ff52f --- /dev/null +++ b/workflow-bdd/features/examples/ResponseDataChecks.feature @@ -0,0 +1,50 @@ +Feature: Example for checking response data + Scenario: Example Checks + # setting some data just for testing purposes + Given Response Data: + """ + { + "field1" : "string field", + "field2" : true, + "field3": "5", + "field4" : [{"entry1":"a"},{"entry2":"b"},{"entry3":"c"}], + "inputs": [ + { + "mandatory": true, + "name": "in1", + "type": "STRING" + }, + { + "mandatory": true, + "name": "in2", + "type": "INTEGER" + } + ], + "outputs": [ + { + "mandatory": true, + "name": "workflow", + "type": "TIMESTAMP" + }, + { + "mandatory": true, + "name": "out2", + "type": "BOOLEAN" + } + ] + } + """ + # printing out for test purposes + Then I want to print the context 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 "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 + Then I want to check property "field4[0].no_exist" does not exist + Then I want to check property "outputs[0].name" exists + Then I want to check property "outputs[0].name" for value "workflow" + Then I want to check in the list "outputs" property "name" with value "out2" exists + Then I want to check in the list "outputs" property "name" with value "out3" does not exist -- cgit 1.2.3-korg