Skip to content

Commit

Permalink
Performance improvement at integration tests
Browse files Browse the repository at this point in the history
Removed duplicated step. This step already is executed at method
beforeFeature.

The method beforeSuite also was refactored to use the method runCommand

Signed-off-by: Vitor Mattos <[email protected]>
  • Loading branch information
vitormattos committed Mar 13, 2024
1 parent a7368e7 commit 14abb43
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 9 deletions.
1 change: 0 additions & 1 deletion tests/integration/features/account/create_to_sign.feature
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
Feature: account/create_to_sign
Background:
Given as user "admin"
And run the command "libresign:developer:reset --all"
And run the command "libresign:configure:openssl --cn test"
And sending "post" to ocs "/apps/provisioning_api/api/v1/config/apps/libresign/identify_methods"
| value | (string)[{"name":"email","enabled":true,"mandatory":true,"can_create_account":true}] |
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/features/bootstrap/FeatureContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ class FeatureContext extends NextcloudApiContext implements OpenedEmailStorageAw
* @BeforeSuite
*/
public static function beforeSuite(BeforeSuiteScope $scope) {
exec('php ../../../../occ config:system:set debug --value true --type boolean', $output);
self::runCommand('config:system:set debug --value true --type boolean');
self::runCommand('app:enable --force notifications');
}

/**
* @BeforeFeature
*/
public static function BeforeFeature(): void {
self::runCommand('libresign:developer:reset --all');
self::runCommand('app:enable --force notifications');
}

/**
Expand Down
7 changes: 1 addition & 6 deletions tests/integration/features/sign/request.feature
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ Feature: request-signature
Scenario: Request to sign with error when the link was expired
Given as user "admin"
And my inbox is empty
And run the command "libresign:developer:reset --all"
And run the command "libresign:configure:openssl --cn test"
And run the command "config:app:set libresign maximum_validity --value 1"
When sending "post" to ocs "/apps/libresign/api/v1/request-signature"
Expand All @@ -119,7 +118,6 @@ Feature: request-signature
Scenario: Request to sign with success when is necessary to renew the link
Given as user "admin"
And my inbox is empty
And run the command "libresign:developer:reset --all"
And run the command "libresign:configure:openssl --cn test"
And sending "post" to ocs "/apps/provisioning_api/api/v1/config/apps/libresign/identify_methods"
| value | (string)[{"name":"email","enabled":true,"mandatory":true,"can_create_account":false}] |
Expand Down Expand Up @@ -184,7 +182,6 @@ Feature: request-signature
Scenario: Request to sign with success using account as identifier
Given as user "admin"
And user "signer1" exists
And run the command "libresign:developer:reset --all"
And run the command "libresign:configure:openssl --cn test"
And set the email of user "signer1" to "[email protected]"
And reset notifications of user "signer1"
Expand All @@ -206,7 +203,6 @@ Feature: request-signature

Scenario: Request to sign with error using account as identifier with invalid email
Given as user "admin"
And run the command "libresign:developer:reset --all"
And run the command "libresign:configure:openssl --cn test"
When sending "post" to ocs "/apps/libresign/api/v1/request-signature"
| file | {"url":"<BASE_URL>/apps/libresign/develop/pdf"} |
Expand Down Expand Up @@ -320,8 +316,7 @@ Feature: request-signature
And I open the latest email to "[email protected]" with subject "LibreSign: There is a file for you to sign"

Scenario: CRUD of identify methods
Given run the command "libresign:developer:reset --all"
And run the command "libresign:configure:openssl --cn test"
Given run the command "libresign:configure:openssl --cn test"
And user "signer1" exists
And as user "admin"
When I send a file to be signed
Expand Down

0 comments on commit 14abb43

Please sign in to comment.