more ocm tests

This commit is contained in:
Viktor Scharf
2024-07-08 07:59:52 +02:00
parent 4b05f35d52
commit 97bce8edd4
11 changed files with 640 additions and 38 deletions
+137
View File
@@ -0,0 +1,137 @@
@ocm
Feature: accepting invitation
As a user
I can accept invitations from users of other ocis instances
Background:
Given user "Alice" has been created with default attributes and without skeleton files
And using server "REMOTE"
Given these users have been created with default attributes and without skeleton files:
| username |
| Brian |
| Carol |
Scenario: user accepts invitation
Given using server "LOCAL"
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_pattern%$"
}
}
}
"""
When using server "REMOTE"
And "Brian" accepts the last federation share invitation
Then the HTTP status code should be "200"
Scenario: user accepts invitation sent with email and description
Given using server "LOCAL"
When "Alice" creates the federation share invitation with email "alice@example.com" and description "a share invitation from Alice"
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_pattern%$"
}
}
}
"""
When using server "REMOTE"
And "Brian" accepts the last federation share invitation
Then the HTTP status code should be "200"
Scenario: two users can accept one invitation
Given using server "LOCAL"
And "Alice" has created the federation share invitation
When using server "REMOTE"
And "Brian" accepts the last federation share invitation
Then the HTTP status code should be "200"
And "Carol" accepts the last federation share invitation
Then the HTTP status code should be "200"
Scenario: user tries to accept the invitation twice
Given using server "LOCAL"
And "Alice" has created the federation share invitation
When using server "REMOTE"
And "Brian" accepts the last federation share invitation
Then the HTTP status code should be "200"
When "Brian" tries to accept the last federation share invitation
Then the HTTP status code should be "409"
And the JSON data of the response should match
"""
{
"type": "object",
"required": [
"code",
"message"
],
"properties": {
"code": {
"const": "ALREADY_EXIST"
},
"message": {
"const": "user already known"
}
}
}
"""
Scenario: users try to accept each other's invitation
Given using server "LOCAL"
And "Alice" has created the federation share invitation
And using server "REMOTE"
And "Brian" has accepted invitation
And "Brian" has created the federation share invitation
When using server "LOCAL"
And "Alice" tries to accept the last federation share invitation
Then the HTTP status code should be "409"
And the JSON data of the response should match
"""
{
"type": "object",
"required": [
"code",
"message"
],
"properties": {
"code": {
"const": "ALREADY_EXIST"
},
"message": {
"const": "user already known"
}
}
}
"""
@@ -1,20 +0,0 @@
@ocm
Feature: an user shares resources usin ScienceMesh application
As a user
I want to share resources between different ocis instances
Background:
Given these users have been created with default attributes and without skeleton files:
| username |
| Alice |
And using server "REMOTE"
And user "Brian" has been created with default attributes and without skeleton files
Scenario: user generates invitation
Given using server "LOCAL"
When "Alice" generates invitation
Then the HTTP status code should be "200"
When using server "REMOTE"
And "Brian" accepts invitation
Then the HTTP status code should be "200"
@@ -0,0 +1,212 @@
@ocm
Feature: search federation users
As a user
I can find federation users after accepting an invitation to share resources
Background:
Given these users have been created with default attributes and without skeleton files:
| username |
| Alice |
| Carol |
And using server "REMOTE"
And user "Brian" has been created with default attributes and without skeleton files
Scenario: users search for federation users by display name
Given using server "LOCAL"
And "Alice" has created the federation share invitation
And using server "REMOTE"
And "Brian" has accepted invitation
When user "Brian" searches for user "ali" using Graph API
Then the HTTP status code should be "200"
And the JSON data of the response should match
"""
{
"type": "object",
"required": [
"value"
],
"properties": {
"value": {
"type": "array",
"minItems": 1,
"maxItems": 1,
"items": {
"type": "object",
"required": [
"displayName",
"id"
],
"properties": {
"displayName": {
"const": "Alice Hansen"
},
"id": {
"type": "string",
"pattern": "^%user_id_pattern%$"
}
}
}
}
}
}
"""
And using server "LOCAL"
When user "Alice" searches for user "bri" using Graph API
Then the HTTP status code should be "200"
And the JSON data of the response should match
"""
{
"type": "object",
"required": [
"value"
],
"properties": {
"value": {
"type": "array",
"minItems": 1,
"maxItems": 1,
"items": {
"type": "object",
"required": [
"displayName",
"id"
],
"properties": {
"displayName": {
"const": "Brian Murphy"
},
"id": {
"type": "string",
"pattern": "^%user_id_pattern%$"
}
}
}
}
}
}
"""
Scenario: sers search for federation users by email
Given using server "LOCAL"
And "Alice" has created the federation share invitation
And using server "REMOTE"
And "Brian" has accepted invitation
When user "Brian" searches for user "%22alice@example.org%22" using Graph API
Then the HTTP status code should be "200"
And the JSON data of the response should match
"""
{
"type": "object",
"required": [
"value"
],
"properties": {
"value": {
"type": "array",
"minItems": 1,
"maxItems": 1,
"items": {
"type": "object",
"required": [
"displayName",
"id"
],
"properties": {
"displayName": {
"const": "Alice Hansen"
},
"id": {
"type": "string",
"pattern": "^%user_id_pattern%$"
}
}
}
}
}
}
"""
And using server "LOCAL"
When user "Alice" searches for user "%22brian@example.org%22" using Graph API
Then the HTTP status code should be "200"
And the JSON data of the response should match
"""
{
"type": "object",
"required": [
"value"
],
"properties": {
"value": {
"type": "array",
"minItems": 1,
"maxItems": 1,
"items": {
"type": "object",
"required": [
"displayName",
"id"
],
"properties": {
"displayName": {
"const": "Brian Murphy"
},
"id": {
"type": "string",
"pattern": "^%user_id_pattern%$"
}
}
}
}
}
}
"""
Scenario: sers search for federation users without federated connection
Given using server "LOCAL"
And "Alice" has created the federation share invitation
And using server "REMOTE"
And "Brian" has accepted invitation
When user "Brian" searches for user "%22carol@example.org%22" using Graph API
Then the HTTP status code should be "200"
And the JSON data of the response should match
"""
{
"type": "object",
"required": [
"value"
],
"properties": {
"value": {
"type": "array",
"minItems": 0,
"maxItems": 0
}
}
}
"""
And using server "LOCAL"
When user "Carol" searches for user "bria" using Graph API
Then the HTTP status code should be "200"
And the JSON data of the response should match
"""
{
"type": "object",
"required": [
"value"
],
"properties": {
"value": {
"type": "array",
"minItems": 0,
"maxItems": 0
}
}
}
"""
And using server "REMOTE"
# TODO try to find federation users after deleting federated conection
+165
View File
@@ -0,0 +1,165 @@
@ocm
Feature: an user shares resources usin ScienceMesh application
As a user
I want to share resources between different ocis instances
Background:
Given user "Alice" has been created with default attributes and without skeleton files
And using server "REMOTE"
And user "Brian" has been created with default attributes and without skeleton files
Scenario: users shares folder to federation users after receiver accepted invitation
Given using server "LOCAL"
And "Alice" has created the federation share invitation
And using server "REMOTE"
And "Brian" has accepted invitation
And using server "LOCAL"
And user "Alice" has created folder "folderToShare"
When user "Alice" sends the following resource share invitation using the Graph API:
| resource | folderToShare |
| space | Personal |
| sharee | Brian |
| shareType | user |
| permissionsRole | Viewer |
Then the HTTP status code should be "200"
When using server "REMOTE"
And user "Brian" lists the shares shared with him using the Graph API
Then the HTTP status code should be "200"
And the JSON data of the response should match
"""
{
"type": "object",
"required": [
"value"
],
"properties": {
"value": {
"type": "array",
"minItems": 1,
"maxItems": 1,
"items": {
"type": "object",
"required": [
"@UI.Hidden",
"@client.synchronize",
"createdBy",
"name"
],
"properties": {
"@UI.Hidden":{
"type": "boolean",
"enum": [false]
},
"@client.synchronize":{
"type": "boolean",
"enum": [true]
},
"createdBy": {
"type": "object",
"required": [
"user"
],
"properties": {
"user": {
"type": "object",
"required": ["displayName", "id"],
"properties": {
"displayName": {
"type": "string",
"const": "Alice Hansen"
},
"id": {
"type": "string",
"pattern": "^%user_id_pattern%$"
}
}
}
}
},
"name": {
"const": "folderToShare"
}
}
}
}
}
}
"""
Scenario: users shares folder to federation users after accepting invitation
Given using server "LOCAL"
And "Alice" has created the federation share invitation
And using server "REMOTE"
And "Brian" has accepted invitation
And user "Brian" has created folder "folderToShare"
When user "Brian" sends the following resource share invitation using the Graph API:
| resource | folderToShare |
| space | Personal |
| sharee | Alice |
| shareType | user |
| permissionsRole | Viewer |
Then the HTTP status code should be "200"
When using server "LOCAL"
And user "Alice" lists the shares shared with her using the Graph API
Then the HTTP status code should be "200"
And the JSON data of the response should match
"""
{
"type": "object",
"required": [
"value"
],
"properties": {
"value": {
"type": "array",
"minItems": 1,
"maxItems": 1,
"items": {
"type": "object",
"required": [
"@UI.Hidden",
"@client.synchronize",
"createdBy",
"name"
],
"properties": {
"@UI.Hidden":{
"type": "boolean",
"enum": [false]
},
"@client.synchronize":{
"type": "boolean",
"enum": [true]
},
"createdBy": {
"type": "object",
"required": [
"user"
],
"properties": {
"user": {
"type": "object",
"required": ["displayName", "id"],
"properties": {
"displayName": {
"type": "string",
"const": "Brian Murphy"
},
"id": {
"type": "string",
"pattern": "^%user_id_pattern%$"
}
}
}
}
},
"name": {
"const": "folderToShare"
}
}
}
}
}
}
"""