From 317bb6cc2ff8f0d8045e30897e4088b0a9904a15 Mon Sep 17 00:00:00 2001 From: Salipa-Gurung Date: Tue, 13 Aug 2024 17:02:16 +0545 Subject: [PATCH] refactor scenario for deletion activity --- .../features/apiGraph/activities.feature | 94 ++++++++++--------- 1 file changed, 50 insertions(+), 44 deletions(-) diff --git a/tests/acceptance/features/apiGraph/activities.feature b/tests/acceptance/features/apiGraph/activities.feature index b49d6c1c63..b90a831c57 100644 --- a/tests/acceptance/features/apiGraph/activities.feature +++ b/tests/acceptance/features/apiGraph/activities.feature @@ -101,9 +101,11 @@ Feature: check activities """ @issue-9712 - Scenario: check activities after deleting a file + Scenario: check activities after deleting a file and a folder Given user "Alice" has uploaded file with content "ownCloud test text file 0" to "/textfile0.txt" + And user "Alice" has created folder "/FOLDER" And user "Alice" has deleted file "textfile0.txt" + And user "Alice" has deleted folder "FOLDER" When user "Alice" lists the activities of space "Personal" using the Graph API Then the HTTP status code should be "200" And the JSON data of the response should match @@ -114,8 +116,8 @@ Feature: check activities "properties": { "value": { "type": "array", - "minItems": 2, - "maxItems": 2, + "minItems": 4, + "maxItems": 4, "uniqueItems": true, "items": { "oneOf": [ @@ -129,6 +131,51 @@ Feature: check activities "properties": { "message": { "const": "{user} added {resource} to {space}" + }, + "variables": { + "type": "object", + "required": ["resource", "space", "user"], + "properties": { + "resource": { + "type": "object", + "required": ["id", "name"], + "properties": { + "name": { + "const": "textfile0.txt" + } + } + } + } + } + } + } + } + }, + { + "type": "object", + "required": ["id","template","times"], + "properties": { + "template": { + "type": "object", + "required": ["message","variables"], + "properties": { + "message": { + "const": "{user} added {resource} to {space}" + }, + "variables": { + "type": "object", + "required": ["resource", "space", "user"], + "properties": { + "resource": { + "type": "object", + "required": ["id", "name"], + "properties": { + "name": { + "const": "FOLDER" + } + } + } + } } } } @@ -207,47 +254,6 @@ Feature: check activities } } } - } - ] - } - } - } - } - """ - - @issue-9712 - Scenario: check activities after deleting a folder - Given user "Alice" has created folder "/FOLDER" - And user "Alice" has deleted folder "FOLDER" - When user "Alice" lists the activities of 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 {space}" - } - } - } - } }, { "type": "object",