[tests-only] [full-ci] Refactor scenario related to checking json response (#6034)

* Separate positive and negative testing in different scenario

* Remove duplicate scenario

* Refactor json step graamer

* Remove unnecessary steps

* Add step to check space disable state
This commit is contained in:
Amrita
2023-05-04 14:55:11 +02:00
committed by GitHub
parent 5c3c7278dc
commit 517a177057
11 changed files with 131 additions and 851 deletions
@@ -94,7 +94,7 @@ Feature: Space management
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
And the JSON data of the response should match
"""
{
"type": "object",
@@ -114,27 +114,13 @@ Feature: Space management
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
"""
{
"type": "object",
"required": [
"name"
],
"properties": {
"name": {
"type": "string",
"enum": ["Project"]
}
}
}
"""
And the user "Alice" should have a space called "Project"
@skipOnStable2.0
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
And the JSON data of the response should match
"""
{
"type": "object",
@@ -155,62 +141,12 @@ Feature: Space management
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"
And for user "Alice" the JSON response should contain space called "Project" and match
"""
{
"type": "object",
"required": [
"description"
],
"properties": {
"description": {
"type": "string",
"enum": ["old description"]
}
}
}
"""
@skipOnStable2.0
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
"""
{
"type": "object",
"required": [
"name",
"root"
],
"properties": {
"name": {
"type": "string",
"enum": ["Project"]
},
"root": {
"type": "object",
"required": [
"deleted"
],
"properties": {
"deleted": {
"type": "object",
"required": [
"state"
],
"properties": {
"state": {
"type": "string",
"enum": ["trashed"]
}
}
}
}
}
}
}
"""
And the user "Brian" should not have a space called "Project"
Scenario: user without space admin permission tries to disable the project space
@@ -238,42 +174,6 @@ Feature: Space management
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"
And for user "Alice" the JSON response should contain space called "Project" and match
"""
{
"type": "object",
"required": [
"name",
"root"
],
"properties": {
"name": {
"type": "string",
"enum": ["Project"]
},
"root": {
"type": "object",
"required": [
"deleted"
],
"properties": {
"deleted": {
"type": "object",
"required": [
"state"
],
"properties": {
"state": {
"type": "string",
"enum": ["trashed"]
}
}
}
}
}
}
}
"""
@skipOnStable2.0
Scenario: space admin user enables the project space
@@ -286,39 +186,4 @@ Feature: Space management
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"
And for user "Alice" the JSON response should contain space called "Project" and match
"""
{
"type": "object",
"required": [
"name",
"root"
],
"properties": {
"name": {
"type": "string",
"enum": ["Project"]
},
"root": {
"type": "object",
"required": [
"deleted"
],
"properties": {
"deleted": {
"type": "object",
"required": [
"state"
],
"properties": {
"state": {
"type": "string",
"enum": ["trashed"]
}
}
}
}
}
}
}
"""
And the user "Alice" should have a space "Project" in the disable state