Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[full-ci] [tests-only] Added scenarios to check activity list after share is expired for federated share #1115

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions tests/acceptance/config/behat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,3 +117,4 @@ default:
- TrashbinContext:
- PublicWebDavContext:
- FeatureContext: *common_feature_context_params
- FederationContext:
49 changes: 49 additions & 0 deletions tests/acceptance/features/apiActivity/list.feature
Original file line number Diff line number Diff line change
Expand Up @@ -1197,3 +1197,52 @@ Feature: List activity
# | object_type | /^files$/ |
# | typeicon | /^icon-rename/ |
# | subject_prepared | /^The public renamed <file link=\"%base_url%\/(index\.php\/)?apps\/files\/\?dir=\/parent&scrollto=textfile0\.txt\" id=\"\">textfile0\.txt<\/file> to <file link=\"%base_url%\/(index\.php\/)?apps\/files\/\?dir=\/parent&scrollto=textfile\.txt\" id=\"\d+\">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 | /^<federated-cloud-id display-name=\"Brian@\…\" user=\"Brian\" server=\"%remote_server%\">Brian@%remote_server%<\/federated-cloud-id> accepted federated share <file link=\"%base_url%\/(index\.php\/)?apps\/files\/\?dir=\/&scrollto=lorem\.txt\" id=\"\d+\">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 <collection><file link=\"%base_url%\/(index\.php\/)?apps\/files\/\?dir=\/&scrollto=lorem\.txt\" id=\"\d+\">lorem\.txt<\/file><file link=\"%base_url%\/(index\.php\/)?apps\/files\/\?dir=\/" id=\"\d+\">\/<\/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:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we leave a comment here that user brian should have 3 activities but has only 2 are found and no expiry activity is there for user brian.

Copy link
Contributor Author

@grgprarup grgprarup Jun 27, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment has been added in the scenario.
user Alice (sharer) should have 3 activities but has only 2 and no expiry activity is there for user Alice.
For Brian (sharee) the inappropriate message like share is unshared instead of share has expired is in the activity list.
Issues reported here: #1117, #1116

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it would be nice if this message was more specific. The LOCAL server deleted the share when it realized that it was expired. Someone who looks at fixing the issue #1117 can discuss what activity message Brian and see if it is possible to improve this.

| type | /^remote_share$/ |
| affecteduser | /^Brian$/ |
| app | /^files_sharing$/ |
| subject | /^remote_share_unshared$/ |
| object_name | /^$/ |
| object_type | /^files$/ |
| subject_prepared | /^<federated-cloud-id display-name=\"Alice@\…\" user=\"Alice\" server=\"%local_server%\">Alice@%local_server%<\/federated-cloud-id> unshared <parameter>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 <parameter>lorem\.txt<\/parameter> from <federated-cloud-id display-name=\"Alice@\…\" user=\"Alice\" server=\"%local_server%\">Alice@%local_server%<\/federated-cloud-id>$/ |
And the last share id should not be included in the response