aboutsummaryrefslogtreecommitdiffstats
path: root/workflow/workflow-bdd
diff options
context:
space:
mode:
Diffstat (limited to 'workflow/workflow-bdd')
-rw-r--r--workflow/workflow-bdd/features/VersionState.feature (renamed from workflow/workflow-bdd/features/Version_State.feature)0
-rw-r--r--workflow/workflow-bdd/features/Version_Create_Update.feature36
-rw-r--r--workflow/workflow-bdd/features/Workflow.feature11
-rw-r--r--workflow/workflow-bdd/features/WorkflowList.feature64
-rw-r--r--workflow/workflow-bdd/features/Workflow_Create_Update.feature27
-rw-r--r--workflow/workflow-bdd/pom.xml6
-rw-r--r--workflow/workflow-bdd/resources/json/createWorkflow.json5
-rw-r--r--workflow/workflow-bdd/stepDefinitions/General_Steps.js6
-rw-r--r--workflow/workflow-bdd/stepDefinitions/InputData_steps.js10
9 files changed, 110 insertions, 55 deletions
diff --git a/workflow/workflow-bdd/features/Version_State.feature b/workflow/workflow-bdd/features/VersionState.feature
index 8c1e13fd..8c1e13fd 100644
--- a/workflow/workflow-bdd/features/Version_State.feature
+++ b/workflow/workflow-bdd/features/VersionState.feature
diff --git a/workflow/workflow-bdd/features/Version_Create_Update.feature b/workflow/workflow-bdd/features/Version_Create_Update.feature
index 2cb05804..656cdaf0 100644
--- a/workflow/workflow-bdd/features/Version_Create_Update.feature
+++ b/workflow/workflow-bdd/features/Version_Create_Update.feature
@@ -3,26 +3,26 @@ Feature: Workflow Versions
Background: Init
Given I want to create a Workflow
- Scenario: Create and get version
+ Scenario: Create first empty version
When I want to create input data
- Then I want to update the input property "description" with value "workflow version description"
- Then I want to create for path "/workflows/{item.id}/versions" with the input data from the context
- Then I want to copy to property "versionId" from response data path "id"
- Then I want to get path "/workflows/{item.id}/versions/{versionId}"
- Then I want to check that property "id" in the response equals to value of saved property "versionId"
-
- When I want to get path "/workflows/{item.id}/versions"
- Then I want to check that element in the response list with "id" equals to value of saved property "versionId" exists
+ And I want to update the input property "description" with value "first empty version"
+ 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 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
Scenario: Update version
- When I want to create input data
- Then I want to update the input property "description" with value "workflow version description"
- Then I want to create for path "/workflows/{item.id}/versions" with the input data from the context
- Then I want to copy to property "versionId" from response data path "id"
+ And I want to create input data
+ And I want to update the input property "description" with value "workflow version description"
+ 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 property "updatedDesc" to value "workflow version description updated"
+ And I want to update the input property "description" with value of property "updatedDesc"
+ And I want to update for path "/workflows/{item.id}/versions/{item.versionId}" with the input data from the context
- Then I want to update the input property "description" with value "workflow version description updated"
- Then I want to set property "desc" to value "workflow version description updated"
- Then I want to update for path "/workflows/{item.id}/versions/{versionId}" with the input data from the context
- Then I want to get path "/workflows/{item.id}/versions/{versionId}"
- Then I want to check that property "description" in the response equals to value of saved property "desc" \ No newline at end of file
+ Then I want to get path "/workflows/{item.id}/versions/{item.versionId}"
+ And I want to check that property "description" in the response equals to value of saved property "updatedDesc" \ No newline at end of file
diff --git a/workflow/workflow-bdd/features/Workflow.feature b/workflow/workflow-bdd/features/Workflow.feature
new file mode 100644
index 00000000..992b40fa
--- /dev/null
+++ b/workflow/workflow-bdd/features/Workflow.feature
@@ -0,0 +1,11 @@
+Feature: Workflow
+
+ Scenario: Create valid
+ When I want to create a Workflow
+
+ Scenario: Update and Get workflow
+ When I want to create a Workflow
+ Then I want to update the input property "description" with value "workflow desc updated"
+ Then I want to update for path "/workflows/{item.id}" with the input data from the context
+ Then I want to get path "/workflows/{item.id}"
+ Then I want to check that property "description" in the response equals to value of saved property "inputData.description"
diff --git a/workflow/workflow-bdd/features/WorkflowList.feature b/workflow/workflow-bdd/features/WorkflowList.feature
new file mode 100644
index 00000000..0ce680ed
--- /dev/null
+++ b/workflow/workflow-bdd/features/WorkflowList.feature
@@ -0,0 +1,64 @@
+Feature: List Workflows
+
+ Background: Init - create various workflows in order to test list filter
+ Given I want to create a Workflow
+ And I want to copy to property "noVersionsWorkflowId" from response data path "id"
+
+ Given I want to create a Workflow
+ And I want to copy to property "draftVersionWorkflowId" from response data path "id"
+ And I want to update the input property "description" with value "first version"
+ And I want to create for path "/workflows/{item.id}/versions" with the input data from the context
+
+ Given I want to create a Workflow
+ And I want to copy to property "certifiedVersionWorkflowId" from response data path "id"
+ And I want to update the input property "description" with value "first version"
+ And I want to create for path "/workflows/{item.id}/versions" with the input data from the context
+ And I want to update the input property "name" with value "CERTIFIED"
+ And I want to create for path "/workflows/{item.id}/versions/{responseData.id}/state" with the input data from the context
+
+ Given I want to create a Workflow
+ And I want to copy to property "draftAndCertifiedVersionWorkflowId" from response data path "id"
+ And I want to update the input property "description" with value "first version"
+ 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"
+ And I want to update the input property "name" with value "CERTIFIED"
+ And I want to create for path "/workflows/{item.id}/versions/{item.versionId}/state" with the input data from the context
+ And I want to update the input property "description" with value "second version"
+ And I want to update the input property "baseVersionId" with value of property "item.versionId"
+ And I want to create for path "/workflows/{item.id}/versions" with the input data from the context
+ #And I want to print the context data
+
+ Scenario: List all
+ When I want to get path "/workflows"
+ 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
+
+ Scenario: List ones with DRAFT version(s)
+ When I want to get path "/workflows?versionState=DRAFT"
+ Then I want to check that element in the response list with "id" equals to value of saved property "noVersionsWorkflowId" does not exist
+ Then I want to check that element in the response list with "id" equals to value of saved property "draftVersionWorkflowId" exists
+ Then I want to check that element in the response list with "id" equals to value of saved property "certifiedVersionWorkflowId" does not exist
+ Then I want to check that element in the response list with "id" equals to value of saved property "draftAndCertifiedVersionWorkflowId" exists
+
+ Scenario: List ones with CERTIFIED version(s)
+ When I want to get path "/workflows?versionState=CERTIFIED"
+ Then I want to check that element in the response list with "id" equals to value of saved property "noVersionsWorkflowId" does not exist
+ Then I want to check that element in the response list with "id" equals to value of saved property "draftVersionWorkflowId" does not exist
+ Then I want to check that element in the response list with "id" equals to value of saved property "certifiedVersionWorkflowId" exists
+ Then I want to check that element in the response list with "id" equals to value of saved property "draftAndCertifiedVersionWorkflowId" exists
+
+ Scenario: List ones with DRAFT/CERTIFIED version(s)
+ When I want to get path "/workflows?versionState=DRAFT,CERTIFIED"
+ Then I want to check that element in the response list with "id" equals to value of saved property "noVersionsWorkflowId" does not exist
+ Then I want to check that element in the response list with "id" equals to value of saved property "draftVersionWorkflowId" exists
+ Then I want to check that element in the response list with "id" equals to value of saved property "certifiedVersionWorkflowId" exists
+ Then I want to check that element in the response list with "id" equals to value of saved property "draftAndCertifiedVersionWorkflowId" exists
+
+ Scenario: List ones with gibberish version(s) = none
+ When I want to get path "/workflows?versionState=gibberish"
+ Then I want to check that element in the response list with "id" equals to value of saved property "noVersionsWorkflowId" does not exist
+ Then I want to check that element in the response list with "id" equals to value of saved property "draftVersionWorkflowId" does not exist
+ Then I want to check that element in the response list with "id" equals to value of saved property "certifiedVersionWorkflowId" does not exist
+ Then 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
diff --git a/workflow/workflow-bdd/features/Workflow_Create_Update.feature b/workflow/workflow-bdd/features/Workflow_Create_Update.feature
deleted file mode 100644
index 04a64bf8..00000000
--- a/workflow/workflow-bdd/features/Workflow_Create_Update.feature
+++ /dev/null
@@ -1,27 +0,0 @@
-Feature: Workflow Example File
-
- Scenario: Create and get workflow
- When I want to create input data
- Then I want to update the input property "name" with a random value
- Then I want to update the input property "description" with value "workflow desc"
- Then I want to update the input property "category" with value "workflow category"
-
- Then I want to create for path "/workflows" with the input data from the context
- Then I want to copy to property "workflowId" from response data path "id"
- When I want to get path "/workflows"
- Then I want to check that element in the response list with "id" equals to value of saved property "workflowId" exists
-
-
- Scenario: Update workflow
- When I want to create input data
- Then I want to update the input property "name" with a random value
- Then I want to update the input property "description" with value "workflow desc"
- Then I want to update the input property "category" with value "workflow category"
- Then I want to create for path "/workflows" with the input data from the context
- Then I want to copy to property "workflowId" from response data path "id"
-
- Then I want to update the input property "description" with value "workflow desc updated"
- Then I want to set property "desc" to value "workflow desc updated"
- Then I want to update for path "/workflows/{workflowId}" with the input data from the context
- Then I want to get path "/workflows/{workflowId}"
- Then I want to check that property "description" in the response equals to value of saved property "desc"
diff --git a/workflow/workflow-bdd/pom.xml b/workflow/workflow-bdd/pom.xml
index 3502451c..8ad0584d 100644
--- a/workflow/workflow-bdd/pom.xml
+++ b/workflow/workflow-bdd/pom.xml
@@ -8,12 +8,6 @@
<name>cucumber-report</name>
<version>1.2.0-SNAPSHOT</version>
-<!-- <parent>
- <groupId>org.onap.sdc.sdc-workflow-designer</groupId>
- <artifactId>sdc-workflow-designer</artifactId>
- <version>1.2.0-SNAPSHOT</version>
- </parent>-->
-
<build>
<plugins>
<plugin>
diff --git a/workflow/workflow-bdd/resources/json/createWorkflow.json b/workflow/workflow-bdd/resources/json/createWorkflow.json
index 074899e9..cc200efb 100644
--- a/workflow/workflow-bdd/resources/json/createWorkflow.json
+++ b/workflow/workflow-bdd/resources/json/createWorkflow.json
@@ -1 +1,4 @@
-{"name":"RANDOM","description":"Workflow Description","category":"category"} \ No newline at end of file
+{
+ "name": "RANDOM",
+ "description": "Workflow Description"
+} \ No newline at end of file
diff --git a/workflow/workflow-bdd/stepDefinitions/General_Steps.js b/workflow/workflow-bdd/stepDefinitions/General_Steps.js
index 0550e415..2e74c6ee 100644
--- a/workflow/workflow-bdd/stepDefinitions/General_Steps.js
+++ b/workflow/workflow-bdd/stepDefinitions/General_Steps.js
@@ -151,7 +151,7 @@ Then('I want to check property {string} does not exist', function(string) {
* @module ContextData
* @description Use during development to see what is on the context
* @exampleFile Example_ResponseData_CheckAndManipulation.feature
-* @step I want to print context data
+* @step I want to print the context data
**/
Then('I want to print the context data', function() {
console.log('------------ context ---------------');
@@ -268,13 +268,13 @@ Then('I want to check that element in the response list with {string} equals to
**/
Then('I want to check that element in the response list with {string} equals to value of saved property {string} exists', function(propertyPath, valueProperty) {
const results = this.context.responseData.results;
- assert.notEqual(results.find(result => this.context[valueProperty] === _.get(result, propertyPath)), undefined);
+ assert.notEqual(results.find(result => _.get(this.context, valueProperty) === _.get(result, propertyPath)), undefined);
});
Then('I want to check that property {string} in the response equals to value of saved property {string}', function(propertyPath, valueProperty) {
const results = this.context.responseData;
- assert.equal(results[propertyPath],this.context[valueProperty]);
+ assert.equal(results[propertyPath], _.get(this.context, valueProperty));
});
/**
diff --git a/workflow/workflow-bdd/stepDefinitions/InputData_steps.js b/workflow/workflow-bdd/stepDefinitions/InputData_steps.js
index 73695d0e..6263bb73 100644
--- a/workflow/workflow-bdd/stepDefinitions/InputData_steps.js
+++ b/workflow/workflow-bdd/stepDefinitions/InputData_steps.js
@@ -64,6 +64,16 @@ Then('I want to update the input property {string} with value {string}', functio
/**
* @module InputData
+ * @description sets the property on the input data to the value of the given property
+ * @exampleFile WorkflowList.feature
+ * @step I want to update the input property {string} with value of property {string}
+ **/
+Then('I want to update the input property {string} with value of property {string}', function(string, string2) {
+ _.set(this.context.inputData, string, _.get(this.context, string2));
+});
+
+/**
+ * @module InputData
* @description removes a property from the input data object
* @exampleFile Example_Rest_Calls.feature
* @step I want to remove {string} from the input data