mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-03-20 00:17:10 -04:00
500 lines
18 KiB
Gherkin
500 lines
18 KiB
Gherkin
Feature: check share activity
|
|
As a user
|
|
I want to check who shared which file to whom
|
|
So that I can track activities of a file
|
|
|
|
Background:
|
|
Given these users have been created with default attributes and without skeleton files:
|
|
| username |
|
|
| Alice |
|
|
| Brian |
|
|
And user "Alice" has uploaded file with content "ownCloud test text file" to "textfile.txt"
|
|
|
|
|
|
Scenario: check activities after adding share to a file
|
|
Given user "Alice" has sent the following resource share invitation:
|
|
| resource | textfile.txt |
|
|
| space | Personal |
|
|
| sharee | Brian |
|
|
| shareType | user |
|
|
| permissionsRole | Viewer |
|
|
When user "Alice" lists the activities for file "textfile.txt" 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",
|
|
"required": ["id","template","times"],
|
|
"properties": {
|
|
"id": {
|
|
"type": "string",
|
|
"pattern": "^%user_id_pattern%$"
|
|
},
|
|
"template": {
|
|
"type": "object",
|
|
"required": ["message","variables"],
|
|
"properties": {
|
|
"message": {
|
|
"const": "{user} shared {resource} with {sharee}"
|
|
},
|
|
"variables": {
|
|
"type": "object",
|
|
"required": ["resource","sharee","user"],
|
|
"properties": {
|
|
"resource": {
|
|
"type": "object",
|
|
"required": ["id","name"],
|
|
"properties": {
|
|
"id": {
|
|
"type": "string",
|
|
"pattern": "^%file_id_pattern%$"
|
|
},
|
|
"name": {
|
|
"const": "textfile.txt"
|
|
}
|
|
}
|
|
},
|
|
"sharee": {
|
|
"type": "object",
|
|
"required": ["id","displayName"],
|
|
"properties": {
|
|
"id": {
|
|
"type": "string",
|
|
"pattern": "^%user_id_pattern%$"
|
|
},
|
|
"displayName": {
|
|
"const": "Brian"
|
|
}
|
|
}
|
|
},
|
|
"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"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
"""
|
|
|
|
|
|
Scenario: check activities after removing share from a file
|
|
Given user "Alice" has sent the following resource share invitation:
|
|
| resource | textfile.txt |
|
|
| space | Personal |
|
|
| sharee | Brian |
|
|
| shareType | user |
|
|
| permissionsRole | Viewer |
|
|
And user "Alice" has removed the access of user "Brian" from resource "textfile.txt" of space "Personal"
|
|
When user "Alice" lists the activities for file "textfile.txt" 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": 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 {space}"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"type": "object",
|
|
"required": ["id","template","times"],
|
|
"properties": {
|
|
"id": {
|
|
"type": "string",
|
|
"pattern": "^%user_id_pattern%$"
|
|
},
|
|
"template": {
|
|
"type": "object",
|
|
"required": ["message","variables"],
|
|
"properties": {
|
|
"message": {
|
|
"const": "{user} shared {resource} with {sharee}"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"type": "object",
|
|
"required": ["id","template","times"],
|
|
"properties": {
|
|
"id": {
|
|
"type": "string",
|
|
"pattern": "^%user_id_pattern%$"
|
|
},
|
|
"template": {
|
|
"type": "object",
|
|
"required": ["message","variables"],
|
|
"properties": {
|
|
"message": {
|
|
"const": "{user} removed {sharee} from {resource}"
|
|
},
|
|
"variables": {
|
|
"type": "object",
|
|
"required": ["resource","sharee","user"],
|
|
"properties": {
|
|
"resource": {
|
|
"type": "object",
|
|
"required": ["id","name"],
|
|
"properties": {
|
|
"id": {
|
|
"type": "string",
|
|
"pattern": "%file_id_pattern%"
|
|
},
|
|
"name": {
|
|
"const": "textfile.txt"
|
|
}
|
|
}
|
|
},
|
|
"sharee": {
|
|
"type": "object",
|
|
"required": ["id","displayName"],
|
|
"properties": {
|
|
"id": {
|
|
"type": "string",
|
|
"pattern": "%user_id_pattern%"
|
|
},
|
|
"displayName": {
|
|
"const": "Brian"
|
|
}
|
|
}
|
|
},
|
|
"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"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
"""
|
|
|
|
|
|
Scenario: check link creation activity for a file
|
|
Given user "Alice" has created the following resource link share:
|
|
| resource | textfile.txt |
|
|
| space | Personal |
|
|
| permissionsRole | view |
|
|
| password | %public% |
|
|
When user "Alice" lists the activities for file "textfile.txt" 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",
|
|
"required": ["id","template","times"],
|
|
"properties": {
|
|
"id": {
|
|
"type": "string",
|
|
"pattern": "^%user_id_pattern%$"
|
|
},
|
|
"template": {
|
|
"type": "object",
|
|
"required": ["message","variables"],
|
|
"properties": {
|
|
"message": {
|
|
"const": "{user} shared {resource} via link"
|
|
},
|
|
"variables": {
|
|
"type": "object",
|
|
"required": ["resource","user"],
|
|
"properties": {
|
|
"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"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"times": {
|
|
"type": "object",
|
|
"required": ["recordedTime"],
|
|
"properties": {
|
|
"recordedTime": {
|
|
"type": "string",
|
|
"format": "date-time"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
"""
|
|
|
|
|
|
Scenario: check link deletion activity for a file
|
|
Given user "Alice" has created the following resource link share:
|
|
| resource | textfile.txt |
|
|
| space | Personal |
|
|
| permissionsRole | view |
|
|
| password | %public% |
|
|
And user "Alice" has removed the last link share of file "textfile.txt" from space "Personal"
|
|
When user "Alice" lists the activities for file "textfile.txt" 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": 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 {space}"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"type": "object",
|
|
"required": ["id","template","times"],
|
|
"properties": {
|
|
"id": {
|
|
"type": "string",
|
|
"pattern": "^%user_id_pattern%$"
|
|
},
|
|
"template": {
|
|
"type": "object",
|
|
"required": ["message","variables"],
|
|
"properties": {
|
|
"message": {
|
|
"const": "{user} shared {resource} via link"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"type": "object",
|
|
"required": ["id","template","times"],
|
|
"properties": {
|
|
"id": {
|
|
"type": "string",
|
|
"pattern": "^%user_id_pattern%$"
|
|
},
|
|
"template": {
|
|
"type": "object",
|
|
"required": ["message","variables"],
|
|
"properties": {
|
|
"message": {
|
|
"const": "{user} removed link to {resource}"
|
|
},
|
|
"variables": {
|
|
"type": "object",
|
|
"required": ["resource","user"],
|
|
"properties": {
|
|
"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"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"times": {
|
|
"type": "object",
|
|
"required": ["recordedTime"],
|
|
"properties": {
|
|
"recordedTime": {
|
|
"type": "string",
|
|
"format": "date-time"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
"""
|