[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:
@@ -28,42 +28,6 @@ Feature: Disabling and deleting space
|
||||
Given the administrator has given "Alice" the role "<role>" using the settings api
|
||||
When user "Alice" disables a space "Project Moon"
|
||||
Then the HTTP status code should be "204"
|
||||
And for user "Alice" the JSON response should contain space called "Project Moon" and match
|
||||
"""
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"name",
|
||||
"root"
|
||||
],
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string",
|
||||
"enum": ["Project Moon"]
|
||||
},
|
||||
"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 Moon"
|
||||
And the user "Bob" should not have a space called "Project Moon"
|
||||
Examples:
|
||||
@@ -78,36 +42,8 @@ Feature: Disabling and deleting space
|
||||
Given the administrator has given "Carol" the role "<role>" using the settings api
|
||||
When user "Carol" tries to disable a space "Project Moon" owned by user "Alice"
|
||||
Then the HTTP status code should be "403"
|
||||
And for user "Brian" the JSON response should contain space called "Project Moon" and match
|
||||
"""
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"name"
|
||||
],
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string",
|
||||
"enum": ["Project Moon"]
|
||||
}
|
||||
}
|
||||
}
|
||||
"""
|
||||
And for user "Bob" the JSON response should contain space called "Project Moon" and match
|
||||
"""
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"name"
|
||||
],
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string",
|
||||
"enum": ["Project Moon"]
|
||||
}
|
||||
}
|
||||
}
|
||||
"""
|
||||
And the user "Brian" should have a space called "Project Moon"
|
||||
And the user "Bob" should have a space called "Project Moon"
|
||||
Examples:
|
||||
| role |
|
||||
| User |
|
||||
@@ -128,21 +64,7 @@ Feature: Disabling and deleting space
|
||||
Given the administrator has given "Alice" the role "<role>" using the settings api
|
||||
When user "Alice" deletes a space "Project Moon"
|
||||
Then the HTTP status code should be "400"
|
||||
And for user "Alice" the JSON response should contain space called "Project Moon" and match
|
||||
"""
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"name"
|
||||
],
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string",
|
||||
"enum": ["Project Moon"]
|
||||
}
|
||||
}
|
||||
}
|
||||
"""
|
||||
And the user "Alice" should have a space called "Project Moon"
|
||||
Examples:
|
||||
| role |
|
||||
| Admin |
|
||||
@@ -167,44 +89,9 @@ Feature: Disabling and deleting space
|
||||
|
||||
Scenario Outline: an admin and space manager can disable other space via the Graph API
|
||||
Given the administrator has given "Carol" the role "<role>" using the settings api
|
||||
When user "Carol" tries to disable a space "Project Moon" owned by user "Alice"
|
||||
When user "Carol" disables a space "Project Moon" owned by user "Alice"
|
||||
Then the HTTP status code should be "204"
|
||||
And for user "Alice" the JSON response should contain space called "Project Moon" and match
|
||||
"""
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"name",
|
||||
"root"
|
||||
],
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string",
|
||||
"enum": ["Project Moon"]
|
||||
},
|
||||
"root": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"deleted"
|
||||
],
|
||||
"properties": {
|
||||
"deleted": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"state"
|
||||
],
|
||||
"properties": {
|
||||
"state": {
|
||||
"type": "string",
|
||||
"enum": ["trashed"]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
"""
|
||||
And the user "Carol" should not have a space called "Project Moon"
|
||||
Examples:
|
||||
| role |
|
||||
| Admin |
|
||||
@@ -214,9 +101,10 @@ Feature: Disabling and deleting space
|
||||
Scenario Outline: an admin and space manager can delete other disabled Space
|
||||
Given the administrator has given "Carol" the role "<role>" using the settings api
|
||||
And user "Alice" has disabled a space "Project Moon"
|
||||
When user "Carol" tries to delete a space "Project Moon" owned by user "Alice"
|
||||
When user "Carol" deletes a space "Project Moon" owned by user "Alice"
|
||||
Then the HTTP status code should be "204"
|
||||
And the user "Alice" should not have a space called "Project Moon"
|
||||
And the user "Carol" should not have a space called "Project Moon"
|
||||
Examples:
|
||||
| role |
|
||||
| Admin |
|
||||
|
||||
Reference in New Issue
Block a user