Skip to content

Commit

Permalink
Merge pull request #2670 from LibreSign/chore/update-dependencies
Browse files Browse the repository at this point in the history
Update dependencies
  • Loading branch information
vitormattos authored Apr 6, 2024
2 parents fd43025 + 293a117 commit 411751d
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 36 deletions.
52 changes: 26 additions & 26 deletions tests/integration/composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 7 additions & 10 deletions tests/integration/features/bootstrap/FeatureContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,15 +125,12 @@ protected function beforeRequest(string $fullUrl, array $options): array {
}

protected function parseText(string $text): string {
$patterns = [
'/<SIGN_UUID>/',
'/<BASE_URL>/',
];
$replacements = [
$this->signer['sign_uuid'] ?? null,
$this->baseUrl . '/index.php',
];
foreach ($this->fields as $key => $value) {
$fields = $this->fields;
if (!empty($this->signer['sign_uuid'])) {
$fields['SIGN_UUID'] = $this->signer['sign_uuid'];
}
$fields['BASE_URL'] = $this->baseUrl . '/index.php';
foreach ($fields as $key => $value) {
$patterns[] = '/<' . $key . '>/';
$replacements[] = $value;
}
Expand Down Expand Up @@ -188,7 +185,7 @@ public function iSendAFileToBeSigned(TableNode $body): void {
/**
* @When follow the link on opened email
*/
public function iDoSomethingWithTheOpenedEmail(): void {
public function followTheLinkOnOpenedEmail(): void {
if (!$this->openedEmailStorage->hasOpenedEmail()) {
throw new RuntimeException('No email opened, unable to do something!');
}
Expand Down
37 changes: 37 additions & 0 deletions tests/integration/features/sign/request.feature
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,43 @@ Feature: request-signature
| type | signature |
Then the response should have a status code 200

Scenario: Sign file
Given as user "admin"
And user "signer1" exists
And run the command "libresign:install --java" with result code 0
And run the command "libresign:install --jsignpdf" with result code 0
And run the command "libresign:install --pdftk" with result code 0
And run the command "libresign:configure:openssl --cn=Common\ Name --c=BR --o=Organization --st=State\ of\ Company --l=City\ Name --ou=Organization\ Unit" with result code 0
And run the command "config:app:set libresign add_footer --value=1" with result code 0
And run the command "config:app:set libresign write_qrcode_on_footer --value=1" with result code 0
And sending "post" to ocs "/apps/provisioning_api/api/v1/config/apps/libresign/identify_methods"
| value | (string)[{"name":"account","enabled":true,"mandatory":true,"signatureMethods":{"password":{"name":"password","enabled":true}},"signatureMethodEnabled":"password"}] |
And the response should have a status code 200
And my inbox is empty
When sending "post" to ocs "/apps/libresign/api/v1/request-signature"
| file | {"url":"<BASE_URL>/apps/libresign/develop/pdf"} |
| users | [{"displayName": "Signer Name","description": "Please, sign this document","identify": {"account": "signer1"}}] |
| name | Document Name |
And the response should have a status code 200
And as user "signer1"
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 |
| data | (jq).[].name == "Document Name"|
And fetch field "(SIGN_URL)data.0.url" from prevous JSON response
And fetch field "(SIGN_UUID)data.0.signers.0.sign_uuid" from prevous JSON response
And fetch field "(FILE_UUID)data.0.uuid" from prevous JSON response
And sending "post" to ocs "/apps/libresign/api/v1/account/signature"
| signPassword | TheComplexPfxPasswordHere |
And sending "post" to ocs "/apps/libresign/api/v1/sign/uuid/<SIGN_UUID>"
| method | password |
| token | TheComplexPfxPasswordHere |
And the response should have a status code 200
Then the response should be a JSON array with the following mandatory values
| key | value |
| message | File signed |
| (jq).file.uuid | <FILE_UUID> |

Scenario: Request to sign with success using multiple users
Given as user "admin"
And user "signer1" exists
Expand Down

0 comments on commit 411751d

Please sign in to comment.