Skip to content

Commit

Permalink
refactor scenario example table (#6694)
Browse files Browse the repository at this point in the history
  • Loading branch information
PrajwolAmatya authored Jul 4, 2023
1 parent 6535e68 commit 941ef59
Show file tree
Hide file tree
Showing 27 changed files with 353 additions and 420 deletions.
76 changes: 38 additions & 38 deletions tests/acceptance/expected-failures-API-on-OCIS-storage.md

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions tests/acceptance/features/apiGraph/editUser.feature
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ Feature: edit user
| User | Admin |
| User Light | Space Admin |
| User Light | User |
| User Light | User Light |
| User Light | User Light |
| User Light | Admin |


Expand All @@ -209,11 +209,11 @@ Feature: edit user
}
"""
Examples:
| action description | newDisplayName | code | displayNameAsResult |
| change to a display name | Olaf Scholz | 200 | Olaf Scholz |
| override to existing display name | Carol King | 200 | Carol King |
| change to an empty display name | | 400 | Brian Murphy |
| displayName with characters | *:!;_+-&#(?) | 200 | *:!;_+-&#(?) |
| action description | newDisplayName | displayNameAsResult |
| change to a display name | Olaf Scholz | Olaf Scholz |
| override to existing display name | Carol King | Carol King |
| change to an empty display name | | Brian Murphy |
| displayName with characters | *:!;_+-&#(?) | *:!;_+-&#(?) |


Scenario Outline: normal user should not be able to change his/her own display name
Expand All @@ -239,7 +239,7 @@ Feature: edit user
| role |
| Space Admin |
| User |
| User Light |
| User Light |


Scenario Outline: normal user should not be able to edit another user's display name
Expand Down Expand Up @@ -500,4 +500,4 @@ Feature: edit user
| role |
| Space Admin |
| User |
| User Light |
| User Light |
2 changes: 1 addition & 1 deletion tests/acceptance/features/apiGraph/getUser.feature
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ Feature: get users
| User | Admin |
| User Light | Space Admin |
| User Light | User |
| User Light | User Light |
| User Light | User Light |
| User Light | Admin |

@skipOnStable2.0
Expand Down
20 changes: 10 additions & 10 deletions tests/acceptance/features/apiSpaces/quota.feature
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Feature: State of the quota


Scenario Outline: quota information is returned in the list of spaces returned via the Graph API
Given user "Alice" has created a space "<spaceName>" of type "project" with quota "<total>"
Given user "Alice" has created a space "<spaceName>" of type "project" with quota "100"
When user "Alice" uploads a file inside space "<spaceName>" with content "<fileContent>" to "test.txt" using the WebDAV API
And user "Alice" lists all available spaces via the GraphApi
Then the JSON response should contain space called "<spaceName>" and match
Expand Down Expand Up @@ -52,7 +52,7 @@ Feature: State of the quota
},
"total" : {
"type": "number",
"enum": [<total>]
"enum": [100]
},
"remaining" : {
"type": "number",
Expand All @@ -68,14 +68,14 @@ Feature: State of the quota
}
"""
Examples:
| spaceName | fileContent | state | total | remaining | used |
| Quota1% | 1 | normal | 100 | 99 | 1 |
| Quota75% | 123456789 123456789 123456789 123456789 123456789 123456789 123456789 12345 | normal | 100 | 25 | 75 |
| Quota76% | 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456 | nearing | 100 | 24 | 76 |
| Quota90% | 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 1234567890 | nearing | 100 | 10 | 90 |
| Quota91% | 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 1 | critical | 100 | 9 | 91 |
| Quota99% | 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 | critical | 100 | 1 | 99 |
| Quota100% | 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 1234567890 | exceeded | 100 | 0 | 100 |
| spaceName | fileContent | state | remaining | used |
| Quota1% | 1 | normal | 99 | 1 |
| Quota75% | 123456789 123456789 123456789 123456789 123456789 123456789 123456789 12345 | normal | 25 | 75 |
| Quota76% | 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456 | nearing | 24 | 76 |
| Quota90% | 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 1234567890 | nearing | 10 | 90 |
| Quota91% | 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 1 | critical | 9 | 91 |
| Quota99% | 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 | critical | 1 | 99 |
| Quota100% | 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 1234567890 | exceeded | 0 | 100 |


Scenario: file cannot be uploaded if there is insufficient quota
Expand Down
12 changes: 6 additions & 6 deletions tests/acceptance/features/apiSpaces/removeSpaceObjects.feature
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@api
@api
Feature: Remove files, folder
As a user
I want to be able to remove files, folders
Expand Down Expand Up @@ -65,11 +65,11 @@ Feature: Remove files, folder
| text.txt |
And as "<user>" file "text.txt" <shouldOrNotBeInTrash> exist in the trashbin of the space "delete objects"
Examples:
| user | role | code | shouldOrNotBeInSpace | shouldOrNotBeInTrash | quotaValue |
| Alice | manager | 204 | should not | should | 0 |
| Brian | manager | 204 | should not | should | 0 |
| Brian | editor | 204 | should not | should | 0 |
| Brian | viewer | 403 | should | should not | 12 |
| user | role | code | shouldOrNotBeInSpace | shouldOrNotBeInTrash |
| Alice | manager | 204 | should not | should |
| Brian | manager | 204 | should not | should |
| Brian | editor | 204 | should not | should |
| Brian | viewer | 403 | should | should not |


Scenario: try to delete an empty string folder from a space
Expand Down
16 changes: 8 additions & 8 deletions tests/acceptance/features/apiSpaces/restoreSpaceObjects.feature
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@api
@api
Feature: Restore files, folder
As a user with manager and editor role
I want to be able to restore files, folders
Expand Down Expand Up @@ -27,15 +27,15 @@ Feature: Restore files, folder
| role | <role> |
And user "Alice" has removed the file "newFolder/file.txt" from space "restore objects"
And user "Alice" has removed the folder "newFolder" from space "restore objects"
When user "<user>" lists all deleted files in the trash bin of the space "restore objects"
When user "Brian" lists all deleted files in the trash bin of the space "restore objects"
Then the HTTP status code should be "207"
And as "<user>" folder "newFolder" should exist in the trashbin of the space "restore objects"
And as "<user>" file "file.txt" should exist in the trashbin of the space "restore objects"
And as "Brian" folder "newFolder" should exist in the trashbin of the space "restore objects"
And as "Brian" file "file.txt" should exist in the trashbin of the space "restore objects"
Examples:
| user | role |
| Brian | manager |
| Brian | editor |
| Brian | viewer |
| role |
| manager |
| editor |
| viewer |


Scenario Outline: user can restore a folder with some objects from the trash via the webDav API
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,15 @@ Feature: Share a file or folder that is inside a space
| path | <entity> |
| shareWith | Bob |
| role | editor |
Then the HTTP status code should be "<statusCode>"
And the OCS status code should be "<statusCode>"
And the OCS status message should be "<statusMessage>"
Then the HTTP status code should be "404"
And the OCS status code should be "404"
And the OCS status message should be "No share permission"
Examples:
| entity | spaceRole | statusCode | statusMessage |
| folder | editor | 404 | No share permission |
| file.txt | editor | 404 | No share permission |
| file.txt | viewer | 404 | No share permission |
| folder | viewer | 404 | No share permission |
| entity | spaceRole |
| folder | editor |
| file.txt | editor |
| file.txt | viewer |
| folder | viewer |


Scenario Outline: user participant of the project space can see the created resources share
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,14 @@ Feature: COPY file/folder
| /remote.php/dav/files/%username%/PARENT/parent.txt |
Then the HTTP status code of responses on all endpoints should be "403"

@skipOnRevaMaster
Scenario: send COPY requests to another user's webDav endpoints as normal user using the spaces WebDAV API
When user "Brian" requests these endpoints with "COPY" about user "Alice"
| endpoint |
| /remote.php/dav/spaces/%spaceid%/textfile0.txt |
| /remote.php/dav/spaces/%spaceid%/PARENT |
| /remote.php/dav/spaces/%spaceid%/PARENT/parent.txt |
Then the HTTP status code of responses on all endpoints should be "403"
@skipOnRevaMaster
Scenario: send COPY requests to another user's webDav endpoints as normal user using the spaces WebDAV API
When user "Brian" requests these endpoints with "COPY" about user "Alice"
| endpoint |
| /remote.php/dav/spaces/%spaceid%/textfile0.txt |
| /remote.php/dav/spaces/%spaceid%/PARENT |
| /remote.php/dav/spaces/%spaceid%/PARENT/parent.txt |
Then the HTTP status code of responses on all endpoints should be "403"


Scenario: send COPY requests to webDav endpoints using invalid username but correct password
Expand Down Expand Up @@ -114,7 +114,7 @@ Feature: COPY file/folder
| /remote.php/dav/files/%username%/PARENT/parent.txt |
Then the HTTP status code of responses on all endpoints should be "415"

@skipOnRevaMaster
@skipOnRevaMaster
Scenario: send COPY requests to webDav endpoints with body as normal user using the spaces WebDAV API
When user "Alice" requests these endpoints with "COPY" including body "doesnotmatter" about user "Alice"
| endpoint |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ Feature: capabilities
}
"""

@skipOnReva
@skipOnReva
Scenario: getting versions app capability with admin user
When the administrator retrieves the capabilities using the capabilities API
Then the OCS status code should be "100"
Expand Down
Loading

0 comments on commit 941ef59

Please sign in to comment.