From f3dbe137e329208666c7627c1805b264e81c5547 Mon Sep 17 00:00:00 2001 From: Prarup Gurung Date: Mon, 20 Jun 2022 16:34:51 +0545 Subject: [PATCH] Added scenarios to check activity list after share is expired for federated share --- tests/acceptance/config/behat.yml | 1 + .../features/apiActivity/list.feature | 49 +++++++++++++++++++ 2 files changed, 50 insertions(+) diff --git a/tests/acceptance/config/behat.yml b/tests/acceptance/config/behat.yml index 763da663..df9f5f0b 100644 --- a/tests/acceptance/config/behat.yml +++ b/tests/acceptance/config/behat.yml @@ -117,3 +117,4 @@ default: - TrashbinContext: - PublicWebDavContext: - FeatureContext: *common_feature_context_params + - FederationContext: diff --git a/tests/acceptance/features/apiActivity/list.feature b/tests/acceptance/features/apiActivity/list.feature index b0ce4909..d358e5eb 100644 --- a/tests/acceptance/features/apiActivity/list.feature +++ b/tests/acceptance/features/apiActivity/list.feature @@ -1197,3 +1197,52 @@ Feature: List activity # | object_type | /^files$/ | # | typeicon | /^icon-rename/ | # | subject_prepared | /^The public renamed textfile0\.txt<\/file> to textfile\.txt<\/file>$/ | + + + Scenario: Check activity list after share is expired for federated share + Given using server "REMOTE" + And user "Brian" has been created with default attributes and without skeleton files + And using server "LOCAL" + And user "Alice" has been created with default attributes and without skeleton files + And user "Alice" has uploaded file "filesForUpload/lorem.txt" to "/lorem.txt" + And user "Alice" from server "LOCAL" has shared "/lorem.txt" with user "Brian" from server "REMOTE" with expiry date of "+15 days" + And user "Brian" from server "REMOTE" has accepted the last pending share + When the administrator expires the last created share using the testing API + And user "Alice" gets all shares shared by him using the sharing API + # The user "Alice" should have 3 activities, but only 2 have been found, and no removal of share activity is there for user "Alice" + Then the activity number 1 of user "Alice" should match these properties: + | type | /^remote_share/ | + | affecteduser | /^Alice$/ | + | app | /^files_sharing$/ | + | subject | /^remote_share_accepted$/ | + | object_name | /^\/lorem.txt$/ | + | object_type | /^files$/ | + | subject_prepared | /^Brian@%remote_server%<\/federated-cloud-id> accepted federated share lorem\.txt<\/file>$/ | + And the activity number 2 of user "Alice" should match these properties: + | type | /^file_created/ | + | user | /^Alice$/ | + | affecteduser | /^Alice$/ | + | app | /^files$/ | + | subject | /^created_self$/ | + | object_name | /^\/lorem.txt$/ | + | object_type | /^files$/ | + | subject_prepared | /^You created lorem\.txt<\/file>\/<\/file><\/collection>$/ | + And using server "REMOTE" + # The user "Brian" should have 'share expired message' on activities list, but 'unshared share message' is on activities list + And the activity number 1 of user "Brian" should match these properties: + | type | /^remote_share$/ | + | affecteduser | /^Brian$/ | + | app | /^files_sharing$/ | + | subject | /^remote_share_unshared$/ | + | object_name | /^$/ | + | object_type | /^files$/ | + | subject_prepared | /^Alice@%local_server%<\/federated-cloud-id> unshared lorem\.txt<\/parameter> from you$/ | + And the activity number 2 of user "Brian" should match these properties: + | type | /^remote_share$/ | + | affecteduser | /^Brian$/ | + | app | /^files_sharing$/ | + | subject | /^remote_share_received$/ | + | object_name | /^$/ | + | object_type | /^files$/ | + | subject_prepared | /^You received a new federated share lorem\.txt<\/parameter> from Alice@%local_server%<\/federated-cloud-id>$/ | + And the last share id should not be included in the response \ No newline at end of file