Skip to content

Commit 12581bd

Browse files
committed
test(admin): cover policies behavior
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
1 parent 0b2debf commit 12581bd

1 file changed

Lines changed: 61 additions & 0 deletions

File tree

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
Feature: admin/policies
2+
Scenario: Manage signature_flow policy layers through API
3+
Given as user "admin"
4+
And user "signer1" exists
5+
6+
When sending "post" to ocs "/apps/libresign/api/v1/policies/system/signature_flow"
7+
| value | ordered_numeric |
8+
| allowChildOverride | true |
9+
Then the response should have a status code 200
10+
And the response should be a JSON array with the following mandatory values
11+
| key | value |
12+
| (jq).ocs.data.policy.policyKey | signature_flow |
13+
| (jq).ocs.data.policy.sourceScope | system |
14+
| (jq).ocs.data.policy.effectiveValue| ordered_numeric |
15+
16+
When sending "put" to ocs "/apps/libresign/api/v1/policies/group/admin/signature_flow"
17+
| value | ordered_numeric |
18+
| allowChildOverride | true |
19+
Then the response should have a status code 200
20+
And the response should be a JSON array with the following mandatory values
21+
| key | value |
22+
| (jq).ocs.data.policy.policyKey | signature_flow |
23+
| (jq).ocs.data.policy.scope | group |
24+
| (jq).ocs.data.policy.targetId | admin |
25+
| (jq).ocs.data.policy.allowChildOverride | true |
26+
27+
When sending "get" to ocs "/apps/libresign/api/v1/policies/group/admin/signature_flow"
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.policy.policyKey | signature_flow |
32+
| (jq).ocs.data.policy.scope | group |
33+
| (jq).ocs.data.policy.targetId | admin |
34+
35+
When sending "put" to ocs "/apps/libresign/api/v1/policies/user/signer1/signature_flow"
36+
| value | parallel |
37+
Then the response should have a status code 200
38+
And the response should be a JSON array with the following mandatory values
39+
| key | value |
40+
| (jq).ocs.data.policy.policyKey | signature_flow |
41+
| (jq).ocs.data.policy.sourceScope | user |
42+
| (jq).ocs.data.policy.effectiveValue| parallel |
43+
44+
Given as user "signer1"
45+
When sending "get" to ocs "/apps/libresign/api/v1/policies/effective"
46+
Then the response should have a status code 200
47+
And the response should be a JSON array with the following mandatory values
48+
| key | value |
49+
| (jq).ocs.data.policies.signature_flow.effectiveValue | parallel |
50+
| (jq).ocs.data.policies.signature_flow.sourceScope | user |
51+
52+
Given as user "admin"
53+
When sending "delete" to ocs "/apps/libresign/api/v1/policies/user/signer1/signature_flow"
54+
Then the response should have a status code 200
55+
56+
Given as user "signer1"
57+
When sending "get" to ocs "/apps/libresign/api/v1/policies/effective"
58+
Then the response should have a status code 200
59+
And the response should be a JSON array with the following mandatory values
60+
| key | value |
61+
| (jq).ocs.data.policies.signature_flow.effectiveValue | ordered_numeric |

0 commit comments

Comments
 (0)