blob: 09e93a753f69545ec73dc7f3aa1abdc7678a53c7 [file] [log] [blame]
ayalaben21c89912018-07-23 11:39:56 +03001# 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
talig39c01dd2018-07-15 15:41:31 +030015Feature: Workflow Version State
16
17 Background: Create workflow and first version
18 Given I want to create a Workflow
19 And I want to update the input property "description" with value "workflow version description"
20 And I want to create for path "/workflows/{item.id}/versions" with the input data from the context
21 And I want to copy to property "item.versionId" from response data path "id"
22
23 Scenario: Get state after creation
24 When I want to get path "/workflows/{item.id}/versions/{item.versionId}/state"
25 Then I want to check property "name" for value "DRAFT"
26 And I want to check property "nextStates[0]" for value "CERTIFIED"
27
taligf96e2442018-07-24 10:30:55 +030028 Scenario: Update state to current state - invalid
talig39c01dd2018-07-15 15:41:31 +030029 Then I want the following to fail with response status code 422
30 When I want to update the input property "name" with value "DRAFT"
31 And I want to create for path "/workflows/{item.id}/versions/{item.versionId}/state" with the input data from the context
32
33 Scenario: Update state - DRAFT to CERTIFIED
34 When I want to update the input property "name" with value "CERTIFIED"
35 And I want to create for path "/workflows/{item.id}/versions/{item.versionId}/state" with the input data from the context
36 Then I want to get path "/workflows/{item.id}/versions/{item.versionId}/state"
37 And I want to check property "name" for value "CERTIFIED"
38 And I want to check property "nextStates" to have length 0
39
taligf96e2442018-07-24 10:30:55 +030040 Scenario: Update state when CERTIFIED - invalid
talig39c01dd2018-07-15 15:41:31 +030041 When I want to update the input property "name" with value "CERTIFIED"
42 And I want to create for path "/workflows/{item.id}/versions/{item.versionId}/state" with the input data from the context
43 When I want the following to fail with response status code 422
taligf96e2442018-07-24 10:30:55 +030044 Then I want to create for path "/workflows/{item.id}/versions/{item.versionId}/state" with the input data from the context
45
46 Scenario: Update when CERTIFIED - invalid
47 When I want to update the input property "name" with value "CERTIFIED"
48 And I want to create for path "/workflows/{item.id}/versions/{item.versionId}/state" with the input data from the context
49 And I want to update the input property "description" with value "workflow version description updated"
50 Then I want the following to fail with response status code 422
51 When I want to update for path "/workflows/{item.id}/versions/{item.versionId}" with the input data from the context
52
53 Scenario: Create second version based on non CERTIFIED one - invalid
talige131bf12018-08-15 13:32:41 +030054 Then I want the following to fail with response status code 422
taligf96e2442018-07-24 10:30:55 +030055 When I want to create for path "/workflows/{item.id}/versions?baseVersionId={item.versionId}" with the input data from the context