Skip to content

Commit

Permalink
added test to list drives after share has been disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
PrajwolAmatya committed Dec 17, 2024
1 parent f902067 commit c1084ac
Showing 1 changed file with 318 additions and 0 deletions.
318 changes: 318 additions & 0 deletions tests/acceptance/features/apiSpaces/listSpaces.feature
Original file line number Diff line number Diff line change
Expand Up @@ -526,3 +526,321 @@ Feature: List and create spaces
| Space Admin |
| User |
| User Light |

@env-config
Scenario Outline: sharee lists drives after the share role Secure Viewer has been disabled (Personal Space)
Given user "Brian" has been created with default attributes
And the administrator has enabled the permissions role "Secure Viewer"
And user "Alice" has uploaded file with content "some content" to "textfile.txt"
And user "Alice" has created folder "folderToShare"
And user "Alice" has sent the following resource share invitation:
| resource | <resource> |
| space | Personal |
| sharee | Brian |
| shareType | user |
| permissionsRole | Secure Viewer |
And user "Brian" has a share "<resource>" synced
And the administrator has disabled the permissions role "Secure Viewer"
When user "Brian" lists all available spaces via the Graph API
Then the HTTP status code should be "200"
And the JSON response should contain space called "Shares" owned by "Brian" and match
"""
{
"type": "object",
"required": [
"driveAlias",
"driveType",
"id",
"name",
"root",
"webUrl"
],
"properties": {
"driveAlias": {
"const": "virtual/shares"
},
"driveType": {
"const": "virtual"
},
"id": {
"const": "%space_id%"
},
"name": {
"const": "Shares"
},
"root": {
"type": "object",
"required": ["eTag", "webDavUrl"],
"properties": {
"eTag": {
"type": "string",
"pattern": "%etag_pattern%"
},
"webDavUrl": {
"const": "%base_url%/dav/spaces/%space_id%"
}
}
},
"webUrl": {
"const": "%base_url%/f/%space_id%"
}
}
}
"""
Examples:
| resource |
| textfile.txt |
| folderToShare |

@env-config
Scenario: sharee lists drives after the share role Denied has been disabled (Personal Space)
Given user "Brian" has been created with default attributes
And the administrator has enabled the permissions role "Denied"
And user "Alice" has created folder "folderToShare"
And user "Alice" has sent the following resource share invitation:
| resource | folderToShare |
| space | Personal |
| sharee | Brian |
| shareType | user |
| permissionsRole | Denied |
And the administrator has disabled the permissions role "Denied"
When user "Brian" lists all available spaces via the Graph API
Then the HTTP status code should be "200"
And the JSON response should contain space called "Shares" owned by "Brian" and match
"""
{
"type": "object",
"required": [
"driveAlias",
"driveType",
"id",
"name",
"root",
"webUrl"
],
"properties": {
"driveAlias": {
"const": "virtual/shares"
},
"driveType": {
"const": "virtual"
},
"id": {
"const": "%space_id%"
},
"name": {
"const": "Shares"
},
"root": {
"type": "object",
"required": ["eTag", "webDavUrl"],
"properties": {
"eTag": {
"const": "%space_etag%"
},
"webDavUrl": {
"const": "%base_url%/dav/spaces/%space_id%"
}
}
},
"webUrl": {
"const": "%base_url%/f/%space_id%"
}
}
}
"""

@env-config
Scenario Outline: sharee lists drives after the share role Secure Viewer has been disabled (Project Space)
Given user "Brian" has been created with default attributes
And the administrator has enabled the permissions role "Secure Viewer"
And the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API
And user "Alice" has created a space "new-space" with the default quota using the Graph API
And user "Alice" has uploaded a file inside space "new-space" with content "some content" to "textfile.txt"
And user "Alice" has created a folder "folderToShare" in space "new-space"
And user "Alice" has sent the following resource share invitation:
| resource | <resource> |
| space | new-space |
| sharee | Brian |
| shareType | user |
| permissionsRole | Secure Viewer |
And user "Brian" has a share "<resource>" synced
And the administrator has disabled the permissions role "Secure Viewer"
When user "Brian" lists all available spaces via the Graph API
Then the HTTP status code should be "200"
And the JSON response should contain space called "Shares" owned by "Brian" and match
"""
{
"type": "object",
"required": [
"driveAlias",
"driveType",
"id",
"name",
"root",
"webUrl"
],
"properties": {
"driveAlias": {
"const": "virtual/shares"
},
"driveType": {
"const": "virtual"
},
"id": {
"const": "%space_id%"
},
"name": {
"const": "Shares"
},
"root": {
"type": "object",
"required": ["eTag", "webDavUrl"],
"properties": {
"eTag": {
"type": "string",
"pattern": "%etag_pattern%"
},
"webDavUrl": {
"const": "%base_url%/dav/spaces/%space_id%"
}
}
},
"webUrl": {
"const": "%base_url%/f/%space_id%"
}
}
}
"""
Examples:
| resource |
| textfile.txt |
| folderToShare |

@env-config
Scenario: sharee lists drives after the share role Denied has been disabled (Project Space)
Given user "Brian" has been created with default attributes
And the administrator has enabled the permissions role "Denied"
And the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API
And user "Alice" has created a space "new-space" with the default quota using the Graph API
And user "Alice" has created a folder "folderToShare" in space "new-space"
And user "Alice" has sent the following resource share invitation:
| resource | folderToShare |
| space | new-space |
| sharee | Brian |
| shareType | user |
| permissionsRole | Denied |
And the administrator has disabled the permissions role "Denied"
When user "Brian" lists all available spaces via the Graph API
Then the HTTP status code should be "200"
And the JSON response should contain space called "Shares" owned by "Brian" and match
"""
{
"type": "object",
"required": [
"driveAlias",
"driveType",
"id",
"name",
"root",
"webUrl"
],
"properties": {
"driveAlias": {
"const": "virtual/shares"
},
"driveType": {
"const": "virtual"
},
"id": {
"const": "%space_id%"
},
"name": {
"const": "Shares"
},
"root": {
"type": "object",
"required": ["eTag", "webDavUrl"],
"properties": {
"eTag": {
"const": "%space_etag%"
},
"webDavUrl": {
"const": "%base_url%/dav/spaces/%space_id%"
}
}
},
"webUrl": {
"const": "%base_url%/f/%space_id%"
}
}
}
"""

@env-config
Scenario: sharee lists drives after the share role Space Editor Without Versions has been disabled
Given user "Brian" has been created with default attributes
And the administrator has enabled the permissions role "Space Editor Without Versions"
And the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API
And user "Alice" has created a space "new-space" with the default quota using the Graph API
And user "Alice" has sent the following space share invitation:
| space | new-space |
| sharee | Brian |
| shareType | user |
| permissionsRole | Space Editor Without Versions |
And the administrator has disabled the permissions role "Space Editor Without Versions"
When user "Brian" lists all available spaces via the Graph API
Then the HTTP status code should be "200"
And the JSON response should contain space called "new-space" and match
"""
{
"type": "object",
"required": [
"driveType",
"driveAlias",
"name",
"id",
"quota",
"root",
"webUrl"
],
"properties": {
"name": {
"const": "new-space"
},
"driveType": {
"const": "project"
},
"driveAlias": {
"const": "project/new-space"
},
"id": {
"type": "string",
"enum": ["%space_id%"]
},
"quota": {
"type": "object",
"required": ["state"],
"properties": {
"state": {
"const": "normal"
}
}
},
"root": {
"type": "object",
"required": ["webDavUrl"],
"properties": {
"webDavUrl": {
"type": "string",
"enum": ["%base_url%/dav/spaces/%space_id%"]
}
}
},
"webUrl": {
"type": "string",
"enum": ["%base_url%/f/%space_id%"]
}
}
}
"""

0 comments on commit c1084ac

Please sign in to comment.