ayalaben | 21c8991 | 2018-07-23 11:39:56 +0300 | [diff] [blame] | 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 | |
talig | 39c01dd | 2018-07-15 15:41:31 +0300 | [diff] [blame] | 15 | Feature: 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 | |
talig | f96e244 | 2018-07-24 10:30:55 +0300 | [diff] [blame] | 28 | Scenario: Update state to current state - invalid |
talig | 39c01dd | 2018-07-15 15:41:31 +0300 | [diff] [blame] | 29 | 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 | |
talig | f96e244 | 2018-07-24 10:30:55 +0300 | [diff] [blame] | 40 | Scenario: Update state when CERTIFIED - invalid |
talig | 39c01dd | 2018-07-15 15:41:31 +0300 | [diff] [blame] | 41 | 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 |
talig | f96e244 | 2018-07-24 10:30:55 +0300 | [diff] [blame] | 44 | 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 |
talig | e131bf1 | 2018-08-15 13:32:41 +0300 | [diff] [blame] | 54 | Then I want the following to fail with response status code 422 |
talig | f96e244 | 2018-07-24 10:30:55 +0300 | [diff] [blame] | 55 | When I want to create for path "/workflows/{item.id}/versions?baseVersionId={item.versionId}" with the input data from the context |