2f8ff52f18ed32e0b8d9acf20f837a58e3e1b924
[sdc/sdc-workflow-designer.git] / workflow-bdd / features / examples / ResponseDataChecks.feature
1 Feature: Example for checking response data
2   Scenario: Example Checks
3     # setting some data just for testing purposes
4     Given Response Data:
5     """
6     {
7       "field1" : "string field",
8       "field2" : true,
9       "field3": "5",
10       "field4" : [{"entry1":"a"},{"entry2":"b"},{"entry3":"c"}],
11       "inputs": [
12         {
13           "mandatory": true,
14           "name": "in1",
15           "type": "STRING"
16         },
17         {
18           "mandatory": true,
19           "name": "in2",
20           "type": "INTEGER"
21         }
22       ],
23       "outputs": [
24         {
25           "mandatory": true,
26           "name": "workflow",
27           "type": "TIMESTAMP"
28         },
29         {
30           "mandatory": true,
31           "name": "out2",
32           "type": "BOOLEAN"
33         }
34       ]
35     }
36     """
37     # printing out for test purposes
38     Then I want to print the context data
39
40     # running the different options of checking the respone data
41     Then I want to check property "field1" for value "string field"
42     Then I want to check property "field2" to be true
43     Then I want to check property "field3" for value 5
44     Then I want to check property "field4" to have length 3
45     Then I want to check property "field4[0].entry1" exists
46     Then I want to check property "field4[0].no_exist" does not exist
47     Then I want to check property "outputs[0].name" exists
48     Then I want to check property "outputs[0].name" for value "workflow"
49     Then I want to check in the list "outputs" property "name" with value "out2" exists
50     Then I want to check in the list "outputs" property "name" with value "out3" does not exist