Fix name convention issue
[sdc/sdc-workflow-designer.git] / sdc-workflow-bdd / features / Version.feature
1 # Copyright © 2018 European Support Limited
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 #      http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14
15 Feature: Workflow Versions
16
17   Background: Init - Create workflow
18     Given I want to create a Workflow
19
20   Scenario: Create first empty version
21     When I want to update the input property "description" with value "first empty version"
22     And I want to create for path "/workflows/{item.id}/versions" with the input data from the context
23     And I want to copy to property "item.versionId" from response data path "id"
24
25     Then I want to get path "/workflows/{item.id}/versions/{item.versionId}"
26     And I want to check that property "id" in the response equals to value of saved property "item.versionId"
27     And I want to get path "/workflows/{item.id}/versions"
28     And I want to check in the list "items" property "id" with value of saved property "item.versionId" exists
29
30   Scenario: Create first version with inputs/outputs
31     When I want to set the input data to file "resources/json/versionWith2Inputs2Outputs1.json"
32     And I want to create for path "/workflows/{item.id}/versions" with the input data from the context
33
34     Then I want to check in the list "inputs" property "name" with value "in1" exists
35     And I want to check in the list "inputs" property "name" with value "in2" exists
36     And I want to check in the list "outputs" property "name" with value "out1" exists
37     And I want to check in the list "outputs" property "name" with value "out2" exists
38
39   Scenario: Create second version
40     And I want to update the input property "description" with value "first empty version"
41     And I want to create for path "/workflows/{item.id}/versions" with the input data from the context
42     And I want to copy to property "item.firstVersionId" from response data path "id"
43     And I want to update the input property "name" with value "CERTIFIED"
44     And I want to create for path "/workflows/{item.id}/versions/{item.firstVersionId}/state" with the input data from the context
45
46     When I want to create input data
47     And I want to update the input property "description" with value "second empty version"
48     And I want to create for path "/workflows/{item.id}/versions?baseVersionId={item.firstVersionId}" with the input data from the context
49     And I want to copy to property "item.versionId" from response data path "id"
50
51     Then I want to get path "/workflows/{item.id}/versions/{item.versionId}"
52     And I want to check that property "id" in the response equals to value of saved property "item.versionId"
53     And I want to get path "/workflows/{item.id}/versions"
54     And I want to check in the list "items" property "id" with value of saved property "item.versionId" exists
55
56   Scenario: Update version
57     And I want to create input data
58     And I want to update the input property "description" with value "workflow version description"
59     And I want to create for path "/workflows/{item.id}/versions" with the input data from the context
60     And I want to copy to property "item.versionId" from response data path "id"
61
62     When I want to update the input property "description" with value "workflow version description updated"
63     And I want to update for path "/workflows/{item.id}/versions/{item.versionId}" with the input data from the context
64
65     Then I want to get path "/workflows/{item.id}/versions/{item.versionId}"
66     And I want to check property "description" for value "workflow version description updated"
67
68   Scenario: Update version with duplicate input name - invalid
69     And I want to update the input property "description" with value "version with with duplicate input name"
70     And I want to create for path "/workflows/{item.id}/versions" with the input data from the context
71     And I want to copy to property "item.versionId" from response data path "id"
72
73     And I want to set the input data to file "resources/json/versionWithDuplicateInputName.json"
74     Then I want the following to fail with response status code 400
75     When I want to update for path "/workflows/{item.id}/versions/{item.versionId}" with the input data from the context
76
77   Scenario: Update version with duplicate output name - invalid
78     And I want to update the input property "description" with value "version with with duplicate output name"
79     And I want to create for path "/workflows/{item.id}/versions" with the input data from the context
80     And I want to copy to property "item.versionId" from response data path "id"
81
82     And I want to set the input data to file "resources/json/versionWithDuplicateOutputName.json"
83     Then I want the following to fail with response status code 400
84     When I want to update for path "/workflows/{item.id}/versions/{item.versionId}" with the input data from the context
85
86   Scenario: Update version with inputs/outputs (create/update/delete parameters)
87     And I want to set the input data to file "resources/json/versionWith2Inputs2Outputs1.json"
88     And I want to create for path "/workflows/{item.id}/versions" with the input data from the context
89     And I want to copy to property "item.versionId" from response data path "id"
90
91     When I want to set the input data to file "resources/json/versionWith2Inputs2Outputs2.json"
92     And I want to update for path "/workflows/{item.id}/versions/{item.versionId}" with the input data from the context
93
94     Then I want to get path "/workflows/{item.id}/versions/{item.versionId}"
95     And I want to check in the list "inputs" property "name" with value "in1" exists
96     And I want to check in the list "inputs" property "name" with value "in2" does not exist
97     And I want to check in the list "inputs" property "name" with value "in3" exists
98     And I want to check in the list "outputs" property "name" with value "out1" exists
99     And I want to check in the list "outputs" property "name" with value "out2" does not exist
100     And I want to check in the list "outputs" property "name" with value "out3" exists
101