From d9b34d50b2d5c14cfd0c1d4fb5bfafdcbe245436 Mon Sep 17 00:00:00 2001 From: prashant-gurung899 Date: Thu, 3 Oct 2024 14:32:25 +0545 Subject: [PATCH] add test to check edit activity for a file Signed-off-by: prashant-gurung899 --- .../features/apiActivities/activities.feature | 105 ++++++++++++++++++ 1 file changed, 105 insertions(+) diff --git a/tests/acceptance/features/apiActivities/activities.feature b/tests/acceptance/features/apiActivities/activities.feature index be81fb83d07..3800f6cde4a 100644 --- a/tests/acceptance/features/apiActivities/activities.feature +++ b/tests/acceptance/features/apiActivities/activities.feature @@ -183,6 +183,111 @@ Feature: check activities } """ + @issue-10001 + Scenario: check edit activity of a file + Given user "Alice" has uploaded file with content "ownCloud test text file" to "/textfile.txt" + And user "Alice" has uploaded file with content "edited ownCloud test text file" to "/textfile.txt" + When user "Alice" lists the activities of file "/textfile.txt" from space "Personal" using the Graph API + Then the HTTP status code should be "200" + And the JSON data of the response should match + """ + { + "type": "object", + "required": ["value"], + "properties": { + "value": { + "type": "array", + "minItems": 2, + "maxItems": 2, + "uniqueItems": true, + "items": { + "oneOf": [ + { + "type": "object", + "required": ["id", "template", "times"], + "properties": { + "template": { + "type": "object", + "required": ["message", "variables"], + "properties": { + "message": { + "const": "{user} added {resource} to {folder}" + } + } + } + } + }, + { + "type": "object", + "required": ["id", "template", "times"], + "properties": { + "template": { + "type": "object", + "required": ["message", "variables"], + "properties": { + "message": { + "const": "{user} updated {resource} in {folder}" + }, + "variables": { + "type": "object", + "required": ["folder", "resource", "user"], + "properties": { + "folder": { + "type": "object", + "required": ["name"], + "properties": { + "id": { + "type": "string", + "pattern": "%user_id_pattern%" + }, + "name": { + "const": "Alice Hansen" + } + } + }, + "resource": { + "type": "object", + "required": ["id", "name"], + "properties": { + "id": { + "type": "string", + "pattern": "%file_id_pattern%" + }, + "name": { + "const": "textfile.txt" + } + } + }, + "user": { + "type": "object", + "required": ["id","displayName"], + "properties": { + "id": { + "type": "string", + "pattern": "%user_id_pattern%" + }, + "displayName": { + "const": "Alice Hansen" + } + } + } + } + } + } + }, + "times": { + "type": "object", + "required": ["recordedTime"] + } + } + } + ] + } + } + } + } + """ + @issue-9712 Scenario: check activities after deleting a file and a folder Given user "Alice" has uploaded file with content "ownCloud test text file 0" to "/textfile.txt"