-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
TestDataTable-API_REST.robot
161 lines (139 loc) · 3.66 KB
/
TestDataTable-API_REST.robot
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
*** Settings ***
Resource environment.robot
Library REST ${TDT_Host}
*** Test cases ***
Create Table regression 1
[Tags] Create Table
PUT /regression+1
Output
Number response status 201
${msg} Output $.message
Should Be Equal "${msg}" "table regression 1 created"
Show Tables
[Tags] Table
GET /tables
Output
Number response status 200
Table regression 1 exists
[Tags] Table
GET /tables
Output
Number response status 200
${tbl_id} Output $.tables[?(@.table=="regression 1")].tbl_id
${tbl_name} Output $.tables[?(@.table=="regression 1")].table
Should Be Equal "${tbl_name}" "regression 1"
Create Table regression 1 again
[Tags] Create Table Negative Case
PUT /regression+1
Output
Number response status 200
${msg} Output $.message
Should Be Equal "${msg}" "table regression 1 exists"
GET /tables
Number response status 200
${tbl_name} Output $.tables[?(@.table=="regression 1")].table
Should Be Equal "${tbl_name}" "regression 1"
Create Column Col_A
[Tags] Create Column
PUT /regression+1/Col_A
Output
# Expect Response { "status": "200" } merge=true
Number response status 201
${msg} Output $.message
Should Be Equal "${msg}" "column Col_A created"
Create Column Col_A again
[Tags] Create Column Negative Case
PUT /regression+1/Col_A
Output
# Expect Response { "status": "200" } merge=true
Number response status 200
${msg} Output $.message
Should Be Equal "${msg}" "column Col_A exists"
Create Column Col_B and Col_C
[Tags] Create Column
PUT /regression+1/Col_B
Output
Number response status 201
PUT /regression+1/Col_C
Output
Number response status 201
Post row of data
[Tags] Create Values
POST /regression+1/row {"Col_A":"Value A","Col_B":"Value B","Col_C":"Value C"}
Output
Number response status 201
POST /regression+1/row {"Col_A":"Value X", "Col_B":"Value Y", "Col_C":"Value Z"}
Number response status 201
Get Table regression 1
[Tags] Table
GET /regression+1
Output
Number response status 200
Get Table regression 1 columns
[Tags] Table
GET /regression+1/columns
Output
Number response status 200
Get Table regression 1 row
[Tags] Values
GET /regression+1/row
Output
Number response status 200
# DELETE /<table name>/<column name>
Delete Column Col_C
[Tags] Delete Column
DELETE /regression+1/Col_C
Output
Number response status 200
# GET /<table name>/<column name>
Get Column Col_A
[Tags] Values
GET /regression+1/Col_A
Output
Number response status 200
# PUT /<table name>/<column name>/<value>
Add value to Column Col_A
[Tags] Create Values
PUT /regression+1/Col_A/Value+1
Output
Number response status 201
Add more values to Column Col_A
[Tags] Create Values
PUT /regression+1/Col_A/Value+2
Number response status 201
PUT /regression+1/Col_A/Value+3
Number response status 201
PUT /regression+1/Col_A/Value+4
Number response status 201
PUT /regression+1/Col_A/Value+5
Number response status 201
PUT /regression+1/Col_A/Value+6
Number response status 201
# GET /<table name>/<column name>/all
Get all values for Column Col_A for Value Id's
[Tags] Values
GET /regression+1/Col_A/all
Output
Number response status 200
# ${id} Output $.Col_A
# ${id} Output $.Col_A[-1]
${id} Output $.Col_A[-1].val_id
Set Global Variable ${value_id} ${id}
# GET /<table name>/<column name>/<id>
Get value by id from Column Col_A
[Tags] Values
GET /regression+1/Col_A/${value_id}
Output
Number response status 200
Delete Table regression 1
[Tags] Delete Table
DELETE /regression+1
Output
# Expect Response { "status": "200" } merge=true
Number response status 200
Table regression 1 removed
[Tags] Delete Table
GET /tables
Output
Number response status 200
Missing $.tables[?(@.table=="regression 1")]