Skip to content

Commit 7c87a14

Browse files
test: update sequential signing test to validate DRAFT filter
Split the sequential signing test into two separate scenarios to better validate the DRAFT status filtering behavior: 1. First scenario: Tests that signer1 can see and sign the document (simpler flow without multiple user switches) 2. Second scenario: Tests that signer2 does NOT see the document when their sign_request is in DRAFT status This avoids multiple user context switches in the same scenario which was causing authentication issues in the Behat tests, and better isolates the behavior we want to validate. Signed-off-by: Vitor Mattos <[email protected]>
1 parent 66d6c21 commit 7c87a14

1 file changed

Lines changed: 16 additions & 11 deletions

File tree

tests/integration/features/sign/sequential_signing.feature

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -43,21 +43,26 @@ Feature: sequential-signing
4343
| users | [{"identify":{"account":"signer1"},"signingOrder":1},{"identify":{"account":"signer2"},"signingOrder":2}] |
4444
| name | Sequential Document |
4545
Then the response should have a status code 200
46-
And as user "signer2"
47-
And sending "get" to ocs "/apps/libresign/api/v1/file/list"
48-
And the response should have a status code 200
49-
And fetch field "(SIGN_UUID_2)ocs.data.data.0.signers.1.sign_uuid" from previous JSON response
50-
When sending "post" to ocs "/apps/libresign/api/v1/sign/uuid/<SIGN_UUID_2>"
51-
| method | clickToSign |
52-
Then the response should have a status code 422
53-
And as user "signer1"
54-
And sending "get" to ocs "/apps/libresign/api/v1/file/list"
55-
And the response should have a status code 200
46+
# Signer2 should NOT see the file yet (their sign_request is in DRAFT status)
47+
Given as user "signer2"
48+
When sending "get" to ocs "/apps/libresign/api/v1/file/list"
49+
Then the response should have a status code 200
50+
And the response should be a JSON array with the following mandatory values
51+
| key | value |
52+
| (jq).ocs.data.data\|length | 0 |
53+
# Signer1 can see and sign the document
54+
Given as user "signer1"
55+
When sending "get" to ocs "/apps/libresign/api/v1/file/list"
56+
Then the response should have a status code 200
5657
And fetch field "(SIGN_UUID_1)ocs.data.data.0.signers.0.sign_uuid" from previous JSON response
5758
When sending "post" to ocs "/apps/libresign/api/v1/sign/uuid/<SIGN_UUID_1>"
5859
| method | clickToSign |
5960
Then the response should have a status code 200
60-
And as user "signer2"
61+
# After signer1 signs, signer2 should now see the file and be able to sign
62+
Given as user "signer2"
63+
When sending "get" to ocs "/apps/libresign/api/v1/file/list"
64+
Then the response should have a status code 200
65+
And fetch field "(SIGN_UUID_2)ocs.data.data.0.signers.1.sign_uuid" from previous JSON response
6166
When sending "post" to ocs "/apps/libresign/api/v1/sign/uuid/<SIGN_UUID_2>"
6267
| method | clickToSign |
6368
Then the response should have a status code 200

0 commit comments

Comments
 (0)