refactor multiple when steps in OCM tests

Signed-off-by: prashant-gurung899 <prasantgrg777@gmail.com>
This commit is contained in:
prashant-gurung899
2024-11-28 12:36:32 +05:45
parent 46d397d74f
commit cbf2b4f393
5 changed files with 94 additions and 108 deletions
@@ -31,33 +31,6 @@ Feature: create invitation
}
}
"""
When "Alice" lists the created invitations
Then the HTTP status code should be "200"
And the JSON data of the response should match
"""
{
"type": "array",
"minItems": 1,
"maxItems": 1,
"items": {
"type": "object",
"required": [
"expiration",
"token"
],
"properties": {
"expiration": {
"type": "integer",
"pattern": "^[0-9]{10}$"
},
"token": {
"type": "string",
"pattern": "%fed_invitation_token%"
}
}
}
}
"""
@issue-9591
Scenario: user creates invitation with valid email and description
@@ -88,37 +61,6 @@ Feature: create invitation
}
}
"""
When "Alice" lists the created invitations
And the HTTP status code should be "200"
And the JSON data of the response should match
"""
{
"type": "array",
"minItems": 1,
"maxItems": 1,
"items": {
"type": "object",
"required": [
"expiration",
"token",
"description"
],
"properties": {
"expiration": {
"type": "integer",
"pattern": "^[0-9]{10}$"
},
"token": {
"type": "string",
"pattern": "%fed_invitation_token%"
},
"description": {
"const": "a share invitation from Alice"
}
}
}
}
"""
Scenario Outline: user creates invitation with valid/invalid email
@@ -155,30 +97,9 @@ Feature: create invitation
Scenario: user cannot see expired invitation tokens
Given using server "LOCAL"
And the config "OCM_OCM_INVITE_MANAGER_TOKEN_EXPIRATION" has been set to "1s"
When "Alice" creates the federation share invitation
Then the HTTP status code should be "200"
And the JSON data of the response should match
"""
{
"type": "object",
"required": [
"expiration",
"token"
],
"properties": {
"expiration": {
"type": "integer",
"pattern": "^[0-9]{10}$"
},
"token": {
"type": "string",
"pattern": "%fed_invitation_token%"
}
}
}
"""
And the user waits "2" seconds for the token to expire
When "Alice" lists the created invitations
And "Alice" has created the federation share invitation
When the user waits "2" seconds for the invitation token to expire
And "Alice" lists the created invitations
Then the HTTP status code should be "200"
And the JSON data of the response should match
"""
@@ -187,4 +108,72 @@ Feature: create invitation
"minItems": 0,
"maxItems": 0
}
"""
"""
Scenario: user lists created invitation
Given using server "LOCAL"
And "Alice" has created the federation share invitation
When "Alice" lists the created invitations
Then the HTTP status code should be "200"
And the JSON data of the response should match
"""
{
"type": "array",
"minItems": 1,
"maxItems": 1,
"items": {
"type": "object",
"required": [
"expiration",
"token"
],
"properties": {
"expiration": {
"type": "integer",
"pattern": "^[0-9]{10}$"
},
"token": {
"type": "string",
"pattern": "%fed_invitation_token%"
}
}
}
}
"""
@issue-9591
Scenario: user lists invitation created with valid email and description
Given using server "LOCAL"
And "Alice" has created the federation share invitation with email "brian@example.com" and description "a share invitation from Alice"
When "Alice" lists the created invitations
Then the HTTP status code should be "200"
And the JSON data of the response should match
"""
{
"type": "array",
"minItems": 1,
"maxItems": 1,
"items": {
"type": "object",
"required": [
"expiration",
"token",
"description"
],
"properties": {
"expiration": {
"type": "integer",
"pattern": "^[0-9]{10}$"
},
"token": {
"type": "string",
"pattern": "%fed_invitation_token%"
},
"description": {
"const": "a share invitation from Alice"
}
}
}
}
"""