Skip to content

Commit

Permalink
add test for folder deletion activity
Browse files Browse the repository at this point in the history
  • Loading branch information
Salipa-Gurung committed Aug 9, 2024
1 parent a84c45c commit 0624698
Showing 1 changed file with 175 additions and 1 deletion.
176 changes: 175 additions & 1 deletion tests/acceptance/features/apiGraph/activities.feature
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ Feature: check activities

Background:
Given user "Alice" has been created with default attributes and without skeleton files
And user "Alice" has uploaded file with content "ownCloud test text file 0" to "/textfile0.txt"


Scenario: check activities after uploading a file
Given user "Alice" has uploaded file with content "ownCloud test text file 0" to "/textfile0.txt"
When user "Alice" checks the activities for file "textfile0.txt" in space "Personal" using the Graph API
Then the HTTP status code should be "200"
And the JSON data of the response should match
Expand Down Expand Up @@ -102,6 +102,7 @@ Feature: check activities


Scenario: check activities after deleting a file
Given user "Alice" has uploaded file with content "ownCloud test text file 0" to "/textfile0.txt"
When user "Alice" deletes file "/textfile0.txt" using the WebDAV API
And user "Alice" checks the activities in space "Personal" using the Graph API
Then the HTTP status code should be "200"
Expand Down Expand Up @@ -271,3 +272,176 @@ Feature: check activities
}
}
"""


Scenario: check activities after deleting a folder
Given user "Alice" has created folder "/FOLDER"
When user "Alice" deletes folder "/FOLDER" using the WebDAV API
And user "Alice" checks the activities in 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": {
"id": {
"type": "string",
"pattern": "^%user_id_pattern%$"
},
"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": {
"id": {
"const": ""
},
"name": {
"const": "FOLDER"
}
}
},
"space": {
"type": "object",
"required": ["id","name"],
"properties": {
"id": {
"type": "string",
"pattern": "^%file_id_pattern%$"
},
"name": {
"const": "Alice Hansen"
}
}
},
"user": {
"type": "object",
"required": ["id","displayName"],
"properties": {
"id": {
"type": "string",
"pattern": "%user_id_pattern%"
},
"displayName": {
"const": "Alice"
}
}
}
}
}
}
},
"times": {
"type": "object",
"required": ["recordedTime"],
"properties": {
"recordedTime": {
"type": "string",
"format": "date-time"
}
}
}
}
},
{
"type": "object",
"required": ["id","template","times"],
"properties": {
"id": {
"type": "string",
"pattern": "^%user_id_pattern%$"
},
"template": {
"type": "object",
"required": ["message","variables"],
"properties": {
"message": {
"const": "{user} deleted {resource} from {space}"
},
"variables": {
"type": "object",
"required": ["resource","space","user"],
"properties": {
"resource": {
"type": "object",
"required": ["id","name"],
"properties": {
"id": {
"type": "string",
"pattern": "%file_id_pattern%"
},
"name": {
"const": "FOLDER"
}
}
},
"space": {
"type": "object",
"required": ["id","name"],
"properties": {
"id": {
"type": "string",
"pattern": "^%file_id_pattern%$"
},
"name": {
"const": "Alice Hansen"
}
}
},
"user": {
"type": "object",
"required": ["id","displayName"],
"properties": {
"id": {
"type": "string",
"pattern": "%user_id_pattern%"
},
"displayName": {
"const": "Alice"
}
}
}
}
}
}
},
"times": {
"type": "object",
"required": ["recordedTime"],
"properties": {
"recordedTime": {
"type": "string",
"format": "date-time"
}
}
}
}
}
]
}
}
}
}
"""

0 comments on commit 0624698

Please sign in to comment.