mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-01-04 03:09:33 -06:00
Merge pull request #10534 from owncloud/tests-copy-activities-by-fileid
[tests-only][full-ci] add test to check activities of destination file and folder by copying a file using file-id
This commit is contained in:
@@ -8,11 +8,102 @@ Feature: check activities
|
||||
And using spaces DAV path
|
||||
|
||||
|
||||
Scenario: check copy activity
|
||||
Scenario: check copy activity of destination resources
|
||||
Given user "Alice" has uploaded file with content "ownCloud test text file" to "textfile.txt"
|
||||
And we save it into "FILEID"
|
||||
And user "Alice" has created folder "newFolder"
|
||||
And user "Alice" has copied file with id "<<FILEID>>" as "textfile.txt" into folder "newFolder" inside space "Personal"
|
||||
When user "Alice" lists the activities of file "newFolder/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": 1,
|
||||
"maxItems": 1,
|
||||
"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 {folder}"
|
||||
},
|
||||
"variables": {
|
||||
"type": "object",
|
||||
"required": ["folder", "resource", "user"],
|
||||
"properties": {
|
||||
"folder": {
|
||||
"type": "object",
|
||||
"required": ["name"],
|
||||
"properties": {
|
||||
"name": {
|
||||
"const": "newFolder"
|
||||
}
|
||||
}
|
||||
},
|
||||
"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"],
|
||||
"properties": {
|
||||
"recordedTime": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
"""
|
||||
When user "Alice" lists the activities of folder "newFolder" from space "Personal" using the Graph API
|
||||
Then the HTTP status code should be "200"
|
||||
And the JSON data of the response should match
|
||||
@@ -1286,3 +1377,505 @@ Feature: check activities
|
||||
}
|
||||
}
|
||||
"""
|
||||
|
||||
|
||||
Scenario: check activities of destination resources after copying a file by renaming the destination file
|
||||
Given user "Alice" has uploaded file with content "ownCloud test text file" to "textfile.txt"
|
||||
And we save it into "FILEID"
|
||||
And user "Alice" has created folder "newFolder"
|
||||
And user "Alice" has copied file with id "<<FILEID>>" as "renamed.txt" into folder "newFolder" inside space "Personal"
|
||||
When user "Alice" lists the activities of file "newFolder/renamed.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": 1,
|
||||
"maxItems": 1,
|
||||
"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 {folder}"
|
||||
},
|
||||
"variables": {
|
||||
"type": "object",
|
||||
"required": ["folder", "resource", "user"],
|
||||
"properties": {
|
||||
"folder": {
|
||||
"type": "object",
|
||||
"required": ["name"],
|
||||
"properties": {
|
||||
"name": {
|
||||
"const": "newFolder"
|
||||
}
|
||||
}
|
||||
},
|
||||
"resource": {
|
||||
"type": "object",
|
||||
"required": ["id","name"],
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string",
|
||||
"pattern": "^%file_id_pattern%$"
|
||||
},
|
||||
"name": {
|
||||
"const": "renamed.txt"
|
||||
}
|
||||
}
|
||||
},
|
||||
"user": {
|
||||
"type": "object",
|
||||
"required": ["id","displayName"],
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string",
|
||||
"pattern": "%user_id_pattern%"
|
||||
},
|
||||
"displayName": {
|
||||
"const": "Alice Hansen"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"times": {
|
||||
"type": "object",
|
||||
"required": ["recordedTime"],
|
||||
"properties": {
|
||||
"recordedTime": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
"""
|
||||
When user "Alice" lists the activities of folder "newFolder" 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}"
|
||||
},
|
||||
"variables": {
|
||||
"type": "object",
|
||||
"required": ["folder", "resource", "user"],
|
||||
"properties": {
|
||||
"resource": {
|
||||
"type": "object",
|
||||
"required": ["id","name"],
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string",
|
||||
"pattern": "^%file_id_pattern%$"
|
||||
},
|
||||
"name": {
|
||||
"const": "newFolder"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"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 {folder}"
|
||||
},
|
||||
"variables": {
|
||||
"type": "object",
|
||||
"required": ["folder", "resource", "user"],
|
||||
"properties": {
|
||||
"folder": {
|
||||
"type": "object",
|
||||
"required": ["name"],
|
||||
"properties": {
|
||||
"name": {
|
||||
"const": "newFolder"
|
||||
}
|
||||
}
|
||||
},
|
||||
"resource": {
|
||||
"type": "object",
|
||||
"required": ["id","name"],
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string",
|
||||
"pattern": "^%file_id_pattern%$"
|
||||
},
|
||||
"name": {
|
||||
"const": "renamed.txt"
|
||||
}
|
||||
}
|
||||
},
|
||||
"user": {
|
||||
"type": "object",
|
||||
"required": ["id","displayName"],
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string",
|
||||
"pattern": "%user_id_pattern%"
|
||||
},
|
||||
"displayName": {
|
||||
"const": "Alice Hansen"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"times": {
|
||||
"type": "object",
|
||||
"required": ["recordedTime"],
|
||||
"properties": {
|
||||
"recordedTime": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
"""
|
||||
|
||||
|
||||
Scenario: check activities of destination resources after copying file into same folder by renaming the destination file
|
||||
Given user "Alice" has created folder "/FOLDER"
|
||||
And user "Alice" has uploaded file with content "ownCloud test text file" to "FOLDER/textfile.txt"
|
||||
And we save it into "FILEID"
|
||||
And user "Alice" has copied file with id "<<FILEID>>" as "renamed.txt" into folder "FOLDER" inside space "Personal"
|
||||
When user "Alice" lists the activities of file "FOLDER/renamed.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": 1,
|
||||
"maxItems": 1,
|
||||
"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 {folder}"
|
||||
},
|
||||
"variables": {
|
||||
"type": "object",
|
||||
"required": ["folder", "resource", "user"],
|
||||
"properties": {
|
||||
"folder": {
|
||||
"type": "object",
|
||||
"required": ["name"],
|
||||
"properties": {
|
||||
"name": {
|
||||
"const": "FOLDER"
|
||||
}
|
||||
}
|
||||
},
|
||||
"resource": {
|
||||
"type": "object",
|
||||
"required": ["id","name"],
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string",
|
||||
"pattern": "^%file_id_pattern%$"
|
||||
},
|
||||
"name": {
|
||||
"const": "renamed.txt"
|
||||
}
|
||||
}
|
||||
},
|
||||
"user": {
|
||||
"type": "object",
|
||||
"required": ["id","displayName"],
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string",
|
||||
"pattern": "%user_id_pattern%"
|
||||
},
|
||||
"displayName": {
|
||||
"const": "Alice Hansen"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"times": {
|
||||
"type": "object",
|
||||
"required": ["recordedTime"],
|
||||
"properties": {
|
||||
"recordedTime": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
"""
|
||||
When user "Alice" lists the activities of file "FOLDER" 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": 3,
|
||||
"maxItems": 3,
|
||||
"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}"
|
||||
},
|
||||
"variables": {
|
||||
"type": "object",
|
||||
"required": ["folder", "resource", "user"],
|
||||
"properties": {
|
||||
"folder": {
|
||||
"type": "object",
|
||||
"required": ["name"],
|
||||
"properties": {
|
||||
"name": {
|
||||
"const": "Alice Hansen"
|
||||
}
|
||||
}
|
||||
},
|
||||
"resource": {
|
||||
"type": "object",
|
||||
"required": ["id", "name"],
|
||||
"properties": {
|
||||
"name": {
|
||||
"const": "FOLDER"
|
||||
}
|
||||
}
|
||||
},
|
||||
"user": {
|
||||
"type": "object",
|
||||
"required": ["id","displayName"],
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string",
|
||||
"pattern": "%user_id_pattern%"
|
||||
},
|
||||
"displayName": {
|
||||
"const": "Alice Hansen"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"required": ["id", "template", "times"],
|
||||
"properties": {
|
||||
"template": {
|
||||
"type": "object",
|
||||
"required": ["message", "variables"],
|
||||
"properties": {
|
||||
"message": {
|
||||
"const": "{user} added {resource} to {folder}"
|
||||
},
|
||||
"variables": {
|
||||
"type": "object",
|
||||
"required": ["folder", "resource", "user"],
|
||||
"properties": {
|
||||
"folder": {
|
||||
"type": "object",
|
||||
"required": ["name"],
|
||||
"properties": {
|
||||
"name": {
|
||||
"const": "FOLDER"
|
||||
}
|
||||
}
|
||||
},
|
||||
"resource": {
|
||||
"type": "object",
|
||||
"required": ["id", "name"],
|
||||
"properties": {
|
||||
"name": {
|
||||
"const": "textfile.txt"
|
||||
}
|
||||
}
|
||||
},
|
||||
"user": {
|
||||
"type": "object",
|
||||
"required": ["id","displayName"],
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string",
|
||||
"pattern": "%user_id_pattern%"
|
||||
},
|
||||
"displayName": {
|
||||
"const": "Alice Hansen"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"required": ["id", "template", "times"],
|
||||
"properties": {
|
||||
"template": {
|
||||
"type": "object",
|
||||
"required": ["message", "variables"],
|
||||
"properties": {
|
||||
"message": {
|
||||
"const": "{user} added {resource} to {folder}"
|
||||
},
|
||||
"variables": {
|
||||
"type": "object",
|
||||
"required": ["folder", "resource", "user"],
|
||||
"properties": {
|
||||
"folder": {
|
||||
"type": "object",
|
||||
"required": ["name"],
|
||||
"properties": {
|
||||
"name": {
|
||||
"const": "FOLDER"
|
||||
}
|
||||
}
|
||||
},
|
||||
"resource": {
|
||||
"type": "object",
|
||||
"required": ["id", "name"],
|
||||
"properties": {
|
||||
"name": {
|
||||
"const": "renamed.txt"
|
||||
}
|
||||
}
|
||||
},
|
||||
"user": {
|
||||
"type": "object",
|
||||
"required": ["id","displayName"],
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string",
|
||||
"pattern": "%user_id_pattern%"
|
||||
},
|
||||
"displayName": {
|
||||
"const": "Alice Hansen"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"times": {
|
||||
"type": "object",
|
||||
"required": ["recordedTime"]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user