Refactor the syntax of the scenarios in local API tests

This commit is contained in:
Swikriti Tripathi
2023-04-20 15:32:15 +05:45
parent 53419c9f2b
commit 7db5b86bd4
49 changed files with 528 additions and 463 deletions
@@ -2,9 +2,10 @@
Feature: Space management
As a user with space admin permission
I want to be able to manage all existing project space
- I can get all project space where I am not member using "graph/v1.0/drives" endpoint
- I can edit space: change quota, name, description
- I can enable, disable, delete space
So that
- I can get all project space where I am not member using "graph/v1.0/drives" endpoint
- I can edit space: change quota, name, description
- I can enable, disable, delete space
Note - this feature is run in CI with ACCOUNTS_HASH_DIFFICULTY set to the default for production
See https://github.com/owncloud/ocis/issues/1542 and https://github.com/owncloud/ocis/pull/839
@@ -21,7 +22,7 @@ Feature: Space management
And user "Alice" has created a space "Project" of type "project" with quota "10"
Scenario: The space admin user can see another project space even if he is not member of the space
Scenario: space admin user can see another project space even if he is not member of the space
When user "Brian" lists all spaces via the GraphApi with query "$filter=driveType eq 'project'"
Then the HTTP status code should be "200"
And the JSON response should contain space called "Project" and match
@@ -52,7 +53,7 @@ Feature: Space management
And the json responded should not contain a space with name "Alice Hansen"
Scenario: The space admin user can see another personal spaces
Scenario: space admin user can see another personal spaces
When user "Brian" lists all spaces via the GraphApi with query "$filter=driveType eq 'personal'"
Then the HTTP status code should be "200"
And the JSON response should contain space called "Alice Hansen" and match
@@ -83,14 +84,14 @@ Feature: Space management
And the json responded should not contain a space with name "Project"
Scenario: The user without space admin permissions cannot see another spaces
Scenario: user without space admin permission cannot see another spaces
When user "Carol" tries to list all spaces via the GraphApi
Then the HTTP status code should be "200"
And the json responded should not contain a space with name "Project"
And the json responded should not contain a space with name "Alice Hansen"
@skipOnStable2.0
Scenario: The space admin user changes the name of the project space
Scenario: space admin user changes the name of the project space
When user "Brian" changes the name of the "Project" space to "New Name" owned by user "Alice"
Then the HTTP status code should be "200"
And for user "Alice" the JSON response should contain space called "New Name" and match
@@ -110,7 +111,7 @@ Feature: Space management
"""
Scenario: The user without space admin permissions tries to change the name of the project space
Scenario: user without space admin permission tries to change the name of the project space
When user "Carol" tries to change the name of the "Project" space to "New Name" owned by user "Alice"
Then the HTTP status code should be "403"
And for user "Alice" the JSON response should contain space called "Project" and match
@@ -130,7 +131,7 @@ Feature: Space management
"""
@skipOnStable2.0
Scenario: The space admin user changes the description of the project space
Scenario: space admin user changes the description of the project space
When user "Brian" changes the description of the "Project" space to "New description" owned by user "Alice"
Then the HTTP status code should be "200"
And for user "Alice" the JSON response should contain space called "Project" and match
@@ -150,7 +151,7 @@ Feature: Space management
"""
Scenario: The user without space admin permissions tries to change the description of the project space
Scenario: user without space admin permission tries to change the description of the project space
Given user "Alice" has changed the description of the "Project" space to "old description"
When user "Carol" tries to change the description of the "Project" space to "New description" owned by user "Alice"
Then the HTTP status code should be "403"
@@ -171,7 +172,7 @@ Feature: Space management
"""
@skipOnStable2.0
Scenario: The space admin user disables the project space
Scenario: space admin user disables the project space
When user "Brian" disables a space "Project" owned by user "Alice"
Then the HTTP status code should be "204"
And for user "Alice" the JSON response should contain space called "Project" and match
@@ -212,12 +213,12 @@ Feature: Space management
"""
Scenario: The user without space admin permissions tries to disable the project space
Scenario: user without space admin permission tries to disable the project space
When user "Carol" tries to disable a space "Project" owned by user "Alice"
Then the HTTP status code should be "403"
Scenario Outline: The space admin user tries to disable the personal space
Scenario Outline: space admin user tries to disable the personal space
When user "<user>" disables a space "Alice Hansen" owned by user "Alice"
Then the HTTP status code should be "403"
Examples:
@@ -226,14 +227,14 @@ Feature: Space management
| Carol |
@skipOnStable2.0
Scenario: The space admin user deletes the project space
Scenario: space admin user deletes the project space
Given user "Alice" has disabled a space "Project"
When user "Brian" deletes a space "Project" owned by user "Alice"
Then the HTTP status code should be "204"
And the user "Alice" should not have a space called "Project"
Scenario: The user without space admin permissions tries to delete the project space
Scenario: user without space admin permission tries to delete the project space
Given user "Alice" has disabled a space "Project"
When user "Carol" tries to delete a space "Project" owned by user "Alice"
Then the HTTP status code should be "403"
@@ -275,13 +276,13 @@ Feature: Space management
"""
@skipOnStable2.0
Scenario: The space admin user enables the project space
Scenario: space admin user enables the project space
Given user "Alice" has disabled a space "Project"
When user "Brian" restores a disabled space "Project" owned by user "Alice"
Then the HTTP status code should be "200"
Scenario: The user without space admin permissions tries to enable the project space
Scenario: user without space admin permission tries to enable the project space
Given user "Alice" has disabled a space "Project"
When user "Carol" tries to restore a disabled space "Project" owned by user "Alice"
Then the HTTP status code should be "404"