-
-
Notifications
You must be signed in to change notification settings - Fork 111
Expand file tree
/
Copy pathlist.feature
More file actions
104 lines (103 loc) · 7.53 KB
/
list.feature
File metadata and controls
104 lines (103 loc) · 7.53 KB
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
Feature: file-list
Scenario: Return a list with two signers
Given as user "admin"
Given user "signer1" exists
Given user "signer2" exists
And set the libresign email of user "signer1" to "[email protected]"
And set the libresign email of user "signer2" to ""
And sending "post" to ocs "/apps/libresign/api/v1/request-signature"
| file | {"url":"<BASE_URL>/apps/libresign/develop/pdf"} |
| users | [{"identify":{"email":"[email protected]"}},{"identify":{"account":"signer2"}}] |
| name | document |
And the response should have a status code 200
When sending "get" to ocs "/apps/libresign/api/v1/file/list"
Then the response should be a JSON array with the following mandatory values
| key | value |
| (jq).ocs.data.data[0].name | document |
| (jq).ocs.data.data[0].status | 1 |
| (jq).ocs.data.data[0].statusText | available for signature |
| (jq).ocs.data.data[0].requested_by.userId | admin |
| (jq).ocs.data.data[0].signers\|length | 2 |
| (jq).ocs.data.data[0].signers[0].email | [email protected] |
| (jq).ocs.data.data[0].signers[0].identifyMethods\|length | 1 |
| (jq).ocs.data.data[0].signers[0].identifyMethods[0].method | email |
| (jq).ocs.data.data[0].signers[0].me | false |
| (jq).ocs.data.data[0].signers[1].email | |
| (jq).ocs.data.data[0].signers[1].me | false |
| (jq).ocs.data.data[0].signers[0].identifyMethods\|length | 1 |
| (jq).ocs.data.data[0].signers[1].identifyMethods[0].method | account |
When fetch field "(FILE_ID)ocs.data.data.0.id" from previous JSON response
And fetch field "(SIGN_REQUEST_ID)ocs.data.data.0.signers.0.signRequestId" from previous JSON response
And sending "delete" to ocs "/apps/libresign/api/v1/sign/file_id/<FILE_ID>/<SIGN_REQUEST_ID>"
And sending "get" to ocs "/apps/libresign/api/v1/file/list"
Then the response should be a JSON array with the following mandatory values
| key | value |
| (jq).ocs.data.data[0].name | document |
| (jq).ocs.data.data[0].status | 1 |
| (jq).ocs.data.data[0].statusText | available for signature |
| (jq).ocs.data.data[0].requested_by.userId | admin |
| (jq).ocs.data.data[0].signers\|length | 1 |
| (jq).ocs.data.data[0].signers[0].email | |
| (jq).ocs.data.data[0].signers[0].me | false |
| (jq).ocs.data.data[0].signers[0].identifyMethods\|length | 1 |
| (jq).ocs.data.data[0].signers[0].identifyMethods[0].method | account |
Scenario: Return a list with 3 pages
Given as user "admin"
And sending "post" to ocs "/apps/provisioning_api/api/v1/config/apps/libresign/identify_methods"
| value | (string)[{"name":"email","enabled":true,"mandatory":true,"can_create_account":false}] |
And sending "post" to ocs "/apps/libresign/api/v1/request-signature"
| file | {"url":"<BASE_URL>/apps/libresign/develop/pdf"} |
| users | [{"identify":{"email":"[email protected]"}}] |
| name | document |
And the response should have a status code 200
And sending "post" to ocs "/apps/libresign/api/v1/request-signature"
| file | {"url":"<BASE_URL>/apps/libresign/develop/pdf"} |
| users | [{"identify":{"email":"[email protected]"}}] |
| name | document |
And the response should have a status code 200
And sending "post" to ocs "/apps/libresign/api/v1/request-signature"
| file | {"url":"<BASE_URL>/apps/libresign/develop/pdf"} |
| users | [{"identify":{"email":"[email protected]"}}] |
| name | document |
And sending "post" to ocs "/apps/libresign/api/v1/request-signature"
| file | {"url":"<BASE_URL>/apps/libresign/develop/pdf"} |
| users | [{"identify":{"email":"[email protected]"}}] |
| name | document |
And sending "post" to ocs "/apps/libresign/api/v1/request-signature"
| file | {"url":"<BASE_URL>/apps/libresign/develop/pdf"} |
| users | [{"identify":{"email":"[email protected]"}}] |
| name | document |
And the response should have a status code 200
# first page
When sending "get" to ocs "/apps/libresign/api/v1/file/list?length=2"
Then the response should be a JSON array with the following mandatory values
| key | value |
| (jq).ocs.data.data[0].name | document |
| (jq).ocs.data.pagination.total | 5 |
| (jq).ocs.data.pagination.current | <BASE_URL>/ocsapp/apps/libresign/api/v1/file/list?length=2&page=1 |
| (jq).ocs.data.pagination.next | <BASE_URL>/ocsapp/apps/libresign/api/v1/file/list?length=2&page=2 |
| (jq).ocs.data.pagination.prev | null |
| (jq).ocs.data.pagination.last | <BASE_URL>/ocsapp/apps/libresign/api/v1/file/list?length=2&page=3 |
| (jq).ocs.data.pagination.first | null |
# second page
When sending "get" to ocs "/apps/libresign/api/v1/file/list?length=2&page=2"
Then the response should be a JSON array with the following mandatory values
| key | value |
| (jq).ocs.data.data[0].name | document |
| (jq).ocs.data.pagination.total | 5 |
| (jq).ocs.data.pagination.current | <BASE_URL>/ocsapp/apps/libresign/api/v1/file/list?length=2&page=2 |
| (jq).ocs.data.pagination.next | <BASE_URL>/ocsapp/apps/libresign/api/v1/file/list?length=2&page=3 |
| (jq).ocs.data.pagination.prev | <BASE_URL>/ocsapp/apps/libresign/api/v1/file/list?length=2&page=1 |
| (jq).ocs.data.pagination.last | <BASE_URL>/ocsapp/apps/libresign/api/v1/file/list?length=2&page=3 |
| (jq).ocs.data.pagination.first | <BASE_URL>/ocsapp/apps/libresign/api/v1/file/list?length=2&page=1 |
# last page
When sending "get" to ocs "/apps/libresign/api/v1/file/list?page=3&length=2"
Then the response should be a JSON array with the following mandatory values
| key | value |
| (jq).ocs.data.data[0].name | document |
| (jq).ocs.data.pagination.total | 5 |
| (jq).ocs.data.pagination.current | <BASE_URL>/ocsapp/apps/libresign/api/v1/file/list?length=2&page=3 |
| (jq).ocs.data.pagination.next | null |
| (jq).ocs.data.pagination.prev | <BASE_URL>/ocsapp/apps/libresign/api/v1/file/list?length=2&page=2 |
| (jq).ocs.data.pagination.last | null |
| (jq).ocs.data.pagination.first | <BASE_URL>/ocsapp/apps/libresign/api/v1/file/list?length=2&page=1 |