Skip to content

Commit 09997bb

Browse files
committed
Revert "fix(behat): remove feature files with undefined custom steps"
This reverts commit 1f66a37. Signed-off-by: Vitor Mattos <[email protected]>
1 parent 1f66a37 commit 09997bb

3 files changed

Lines changed: 202 additions & 0 deletions

File tree

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
Feature: admin/collect_metadata_policy
2+
Scenario: Manage collect_metadata 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/collect_metadata"
6+
And the response should have a status code 200
7+
8+
When sending "post" to ocs "/apps/libresign/api/v1/policies/system/collect_metadata"
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 | collect_metadata |
15+
| (jq).ocs.data.policy.effectiveValue| false |
16+
17+
When sending "put" to ocs "/apps/libresign/api/v1/policies/group/admin/collect_metadata"
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 | collect_metadata |
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.collect_metadata.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.collect_metadata.effectiveValue | false |
39+
40+
Given as user "admin"
41+
When sending "put" to ocs "/apps/libresign/api/v1/policies/user/signer1/collect_metadata"
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 | collect_metadata |
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.collect_metadata.effectiveValue | true |
56+
| (jq).ocs.data.policies.collect_metadata.sourceScope | user_policy |
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
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
Feature: Signature text policy layer
2+
Background:
3+
Given the app "libresign" is installed
4+
And user "admin" exists with default attributes
5+
6+
Scenario: Admin can set system-level signature text template via policy
7+
When I am logged in as admin
8+
And I set the policy "signature_text_template" with system value "Welcome {{SignerCommonName}}" via policy service
9+
Then the system policy "signature_text_template" should be "Welcome {{SignerCommonName}}"
10+
And the effective policy "signature_text_template" should be "Welcome {{SignerCommonName}}"
11+
12+
Scenario: Admin can set signature render mode via policy
13+
When I am logged in as admin
14+
And I set the policy "signature_render_mode" with system value "DESCRIPTION_ONLY" via policy service
15+
Then the system policy "signature_render_mode" should be "DESCRIPTION_ONLY"
16+
17+
Scenario: Admin can set signature dimensions via policy
18+
When I am logged in as admin
19+
And I set the policy "signature_width" with system value "100" via policy service
20+
And I set the policy "signature_height" with system value "60" via policy service
21+
Then the system policy "signature_width" should be "100"
22+
And the system policy "signature_height" should be "60"
23+
24+
Scenario: Admin can set signature font sizes via policy
25+
When I am logged in as admin
26+
And I set the policy "template_font_size" with system value "8.5" via policy service
27+
And I set the policy "signature_font_size" with system value "18" via policy service
28+
Then the system policy "template_font_size" should be "8.5"
29+
And the system policy "signature_font_size" should be "18"
30+
31+
Scenario: Policy fallback to appconfig during migration
32+
When I am logged in as admin
33+
And appConfig key "signature_text_template" is set to "Legacy template {{SignerCommonName}}"
34+
And the policy service is unavailable
35+
Then the effective policy "signature_text_template" should return "Legacy template {{SignerCommonName}}" from appConfig fallback
36+
37+
Scenario: User-level policy override for signature text
38+
Given user "signer" exists with default attributes
39+
When I am logged in as admin
40+
And I set the policy "signature_text_template" with user "signer" value "User-specific: {{SignerCommonName}}" via policy service
41+
Then the user "signer" effective policy "signature_text_template" should be "User-specific: {{SignerCommonName}}"
42+
43+
Scenario: Group-level policy for signature text
44+
Given user "signer" exists with default attributes
45+
And group "signers" exists
46+
And user "signer" is member of group "signers"
47+
When I am logged in as admin
48+
And I set the policy "signature_render_mode" with group "signers" value "GRAPHIC_ONLY" via policy service
49+
Then the user "signer" effective policy "signature_render_mode" should be "GRAPHIC_ONLY"
50+
51+
Scenario: Policy value normalization
52+
When I am logged in as admin
53+
And I set the policy "signature_width" with system value "350.75" via policy service
54+
Then the system policy "signature_width" should be normalized to float "350.75"
55+
56+
Scenario: Invalid policy value rejection
57+
When I am logged in as admin
58+
And I try to set the policy "signature_render_mode" with system value "INVALID_MODE" via policy service
59+
Then the invalid policy value should be normalized to default "default"

0 commit comments

Comments
 (0)