Skip to content

Commit e42beeb

Browse files
committed
test(integration): add identification_documents policy feature coverage
Signed-off-by: Vitor Mattos <[email protected]>
1 parent b54753b commit e42beeb

1 file changed

Lines changed: 87 additions & 0 deletions

File tree

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
Feature: admin/identification_documents_policy
2+
Scenario: Manage identification_documents policy layers through API
3+
Given as user "admin"
4+
And user "signer1" exists
5+
And sending "delete" to ocs "/apps/libresign/api/v1/policies/user/signer1/identification_documents"
6+
And the response should have a status code 200
7+
8+
When sending "post" to ocs "/apps/libresign/api/v1/policies/system/identification_documents"
9+
| value | false |
10+
| allowChildOverride | true |
11+
Then the response should have a status code 200
12+
And the response should be a JSON array with the following mandatory values
13+
| key | value |
14+
| (jq).ocs.data.policy.policyKey | identification_documents |
15+
| (jq).ocs.data.policy.effectiveValue| false |
16+
17+
When sending "put" to ocs "/apps/libresign/api/v1/policies/group/admin/identification_documents"
18+
| value | true |
19+
| allowChildOverride | true |
20+
Then the response should have a status code 200
21+
And the response should be a JSON array with the following mandatory values
22+
| key | value |
23+
| (jq).ocs.data.policy.policyKey | identification_documents |
24+
| (jq).ocs.data.policy.scope | group |
25+
| (jq).ocs.data.policy.targetId | admin |
26+
27+
When sending "get" to ocs "/apps/libresign/api/v1/policies/effective"
28+
Then the response should have a status code 200
29+
And the response should be a JSON array with the following mandatory values
30+
| key | value |
31+
| (jq).ocs.data.policies.identification_documents.effectiveValue | true |
32+
33+
Given as user "signer1"
34+
When sending "get" to ocs "/apps/libresign/api/v1/policies/effective"
35+
Then the response should have a status code 200
36+
And the response should be a JSON array with the following mandatory values
37+
| key | value |
38+
| (jq).ocs.data.policies.identification_documents.effectiveValue | false |
39+
40+
Given as user "admin"
41+
When sending "put" to ocs "/apps/libresign/api/v1/policies/user/signer1/identification_documents"
42+
| value | true |
43+
Then the response should have a status code 200
44+
And the response should be a JSON array with the following mandatory values
45+
| key | value |
46+
| (jq).ocs.data.policy.policyKey | identification_documents |
47+
| (jq).ocs.data.policy.scope | user_policy |
48+
| (jq).ocs.data.policy.targetId | signer1 |
49+
50+
Given as user "signer1"
51+
When sending "get" to ocs "/apps/libresign/api/v1/policies/effective"
52+
Then the response should have a status code 200
53+
And the response should be a JSON array with the following mandatory values
54+
| key | value |
55+
| (jq).ocs.data.policies.identification_documents.effectiveValue | true |
56+
| (jq).ocs.data.policies.identification_documents.sourceScope | user_policy |
57+
58+
Scenario: Identification document approval visibility follows policy and role
59+
Given as user "admin"
60+
And user "signer1" exists
61+
And run the command "libresign:configure:openssl --cn test" with result code 0
62+
And sending "post" to ocs "/apps/libresign/api/v1/policies/system/identification_documents"
63+
| value | true |
64+
And the response should have a status code 200
65+
And sending "post" to ocs "/apps/provisioning_api/api/v1/config/apps/libresign/identify_methods"
66+
| value | (string)[{"name":"account","enabled":true,"mandatory":true,"signatureMethods":{"clickToSign":{"enabled":true}}}] |
67+
And the response should have a status code 200
68+
69+
When sending "post" to ocs "/apps/libresign/api/v1/request-signature"
70+
| file | {"url":"<BASE_URL>/apps/libresign/develop/pdf"} |
71+
| signers | [{"identifyMethods":[{"method":"account","value":"signer1"}]}] |
72+
| name | Identification flow document |
73+
Then the response should have a status code 200
74+
75+
Given as user "signer1"
76+
When sending "get" to ocs "/apps/libresign/api/v1/file/list"
77+
Then the response should have a status code 200
78+
And the response should be a JSON array with the following mandatory values
79+
| key | value |
80+
| (jq).ocs.data.settings.needIdentificationDocuments | true |
81+
| (jq).ocs.data.settings.identificationDocumentsWaitingApproval | false |
82+
83+
When sending "post" to ocs "/apps/libresign/api/v1/id-docs"
84+
| files | [{"file":{"url":"<BASE_URL>/apps/libresign/develop/pdf"},"type":"IDENTIFICATION"}] |
85+
86+
When sending "get" to ocs "/apps/libresign/api/v1/id-docs/approval/list"
87+
Then the response should have a status code 404

0 commit comments

Comments
 (0)