diff options
author | ayalaben <ayala.benzvi@amdocs.com> | 2018-06-26 09:29:06 +0300 |
---|---|---|
committer | ayalaben <ayala.benzvi@amdocs.com> | 2018-06-26 09:29:06 +0300 |
commit | e9d97234f17d8ecdbfc0481d6a2ba2698d52ddd0 (patch) | |
tree | 0990c708c3b50c84115efeecab6df5346d430749 /workflow-bdd | |
parent | 3fb47c47b301bf8f401cabf63b13f17a39182d85 (diff) |
workflow version API
Change-Id: Iadbf5325091084b4feca386740d6655845904d88
Issue-ID: SDC-1445
Signed-off-by: ayalaben <ayala.benzvi@amdocs.com>
Diffstat (limited to 'workflow-bdd')
-rw-r--r-- | workflow-bdd/features/Version_Create_Update.feature | 28 | ||||
-rw-r--r-- | workflow-bdd/resources/json/createWorkflow.json | 1 | ||||
-rw-r--r-- | workflow-bdd/stepDefinitions/Workflow_Steps.js | 19 |
3 files changed, 48 insertions, 0 deletions
diff --git a/workflow-bdd/features/Version_Create_Update.feature b/workflow-bdd/features/Version_Create_Update.feature new file mode 100644 index 00000000..2cb05804 --- /dev/null +++ b/workflow-bdd/features/Version_Create_Update.feature @@ -0,0 +1,28 @@ +Feature: Workflow Versions + + Background: Init + Given I want to create a Workflow + + Scenario: Create and get 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 + + + 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" + + 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 diff --git a/workflow-bdd/resources/json/createWorkflow.json b/workflow-bdd/resources/json/createWorkflow.json new file mode 100644 index 00000000..074899e9 --- /dev/null +++ b/workflow-bdd/resources/json/createWorkflow.json @@ -0,0 +1 @@ +{"name":"RANDOM","description":"Workflow Description","category":"category"}
\ No newline at end of file diff --git a/workflow-bdd/stepDefinitions/Workflow_Steps.js b/workflow-bdd/stepDefinitions/Workflow_Steps.js new file mode 100644 index 00000000..59c95d89 --- /dev/null +++ b/workflow-bdd/stepDefinitions/Workflow_Steps.js @@ -0,0 +1,19 @@ +/** + * @module WORKFLOW + * @description Creates a new WORKFLOW with a random name and saves the id and versionId on the context item object and the context vlm object<br> + * Input data will be taken from the 'resources/json/createWorkflow.json' file. + * @step I want to create a Workflow + **/ + +const {Then, When, Given} = require('cucumber'); +const assert = require('assert'); +const util = require('./Utils.js'); + +When('I want to create a Workflow', function() { + let inputData = util.getJSONFromFile('resources/json/createWorkflow.json'); + inputData.name = util.random(); + let path = '/workflows'; + return util.request(this.context, 'POST', path, inputData).then(result => { + this.context.item ={id : result.data.id}; +}); +});
\ No newline at end of file |