Initial QSfera import

This commit is contained in:
Курнат Андрей
2026-06-07 10:20:04 +03:00
commit 2315f25754
16485 changed files with 4826827 additions and 0 deletions
@@ -0,0 +1,39 @@
Feature: Delete notification
As a user
I want to delete notifications
So that I can filter notifications
Background:
Given these users have been created with default attributes:
| username |
| Alice |
| Brian |
And user "Alice" has uploaded file with content "other data" to "/textfile1.txt"
And user "Alice" has created folder "my_data"
And user "Alice" has sent the following resource share invitation:
| resource | my_data |
| space | Personal |
| sharee | Brian |
| shareType | user |
| permissionsRole | Viewer |
And user "Alice" has sent the following resource share invitation:
| resource | textfile1.txt |
| space | Personal |
| sharee | Brian |
| shareType | user |
| permissionsRole | Viewer |
Scenario: delete a notification
When user "Brian" deletes a notification related to resource "my_data" with subject "Resource shared"
Then the HTTP status code should be "200"
And user "Brian" should get a notification with subject "Resource shared" and message:
| message |
| Alice Hansen shared textfile1.txt with you |
But user "Brian" should not get a notification related to resource "my_data" with subject "Resource shared"
Scenario: delete all notifications
When user "Brian" deletes all notifications
Then the HTTP status code should be "200"
And user "Brian" should not have any notification
@@ -0,0 +1,236 @@
Feature: Deprovisioning notification
As a user admin
I want to inform users about shutting down and deprovisioning the instance
So they can download and save their data in time
Background:
Given these users have been created with default attributes:
| username |
| Alice |
Scenario: administrator creates a deprovisioning notification about shutting down the instance
When the administrator creates a deprovisioning notification
And user "Alice" lists all notifications
Then the HTTP status code of responses on each endpoint should be "200, 200" respectively
And the JSON response should contain a notification message with the subject "Instance will be shut down and deprovisioned" and the message-details should match
"""
{
"type": "object",
"required": [
"app",
"datetime",
"message",
"messageRich",
"messageRichParameters",
"notification_id",
"object_id",
"object_type",
"subject",
"subjectRich",
"user"
],
"properties": {
"app": {
"type": "string",
"enum": [
"userlog"
]
},
"message": {
"type": "string",
"enum": [
"Attention! The instance will be shut down and deprovisioned on 2043-07-04T11:23:12Z. Download all your data before that date as no access past that date is possible."
]
},
"messageRich": {
"type": "string",
"enum": [
"Attention! The instance will be shut down and deprovisioned on {date}. Download all your data before that date as no access past that date is possible."
]
},
"messageRichParameters": {
"type": "object"
},
"notification_id": {
"type": "string",
"enum": [
"deprovision"
]
},
"object_id": {
"type": "string"
},
"object_type": {
"type": "string",
"enum": [
"resource"
]
},
"subject": {
"type": "string",
"enum": [
"Instance will be shut down and deprovisioned"
]
},
"subjectRich": {
"type": "string",
"enum": [
"Instance will be shut down and deprovisioned"
]
},
"user": {
"type": "string"
}
}
}
"""
Scenario Outline: non-admin user tries to create a deprovisioning notification
Given the administrator has assigned the role "<user-role>" to user "Alice" using the Graph API
When user "Alice" tries to create a deprovisioning notification
Then the HTTP status code should be "404"
And user "Alice" should not have any notification
Examples:
| user-role |
| Space Admin |
| User |
| User Light |
@issue-183
Scenario Outline: get a deprovisioning notification in various languages
Given the administrator has created a deprovisioning notification
And user "Alice" has switched the system language to "<language>" using the Graph API
When user "Alice" lists all notifications
Then the HTTP status code should be "200"
And the JSON response should contain a notification message with the subject "<subject>" and the message-details should match
"""
{
"type": "object",
"required": [
"message"
],
"properties": {
"message": {
"type": "string",
"enum": [
"<message>"
]
}
}
}
"""
Examples:
| language | subject | message |
| de | Instanz wird heruntergefahren und außer Betrieb genommen werden. | Achtung! Diese Instanz wird am 2043-07-04T11:23:12Z heruntergefahren und außer Betrieb genommen werden. Laden Sie Ihre Daten vor diesem Tag herunter, da Sie danach nicht mehr darauf zugreifen können. |
| es | La instancia se cerrará y se desaprovisionará | ¡Atención! La instancia se cerrará y se desaprovisionará el 2043-07-04T11:23:12Z. Descarga todos tus datos antes de esa fecha, puesto que el acceso pasada la fecha no será posible. |
Scenario: deprovisioning notification reappears again even after being marked as read
Given the administrator has created a deprovisioning notification
And user "Alice" has deleted all notifications
When user "Alice" lists all notifications
Then the HTTP status code should be "200"
And the JSON response should contain a notification message with the subject "Instance will be shut down and deprovisioned" and the message-details should match
"""
{
"type": "object",
"required": [
"message"
],
"properties": {
"message": {
"type": "string",
"enum": [
"Attention! The instance will be shut down and deprovisioned on 2043-07-04T11:23:12Z. Download all your data before that date as no access past that date is possible."
]
}
}
}
"""
Scenario: administrator deletes the deprovisioning notification
Given the administrator has created a deprovisioning notification
When the administrator deletes the deprovisioning notification
Then the HTTP status code should be "200"
And user "Alice" should not have any notification
Scenario Outline: non-admin user tries to delete the deprovisioning notification
Given the administrator has assigned the role "<user-role>" to user "Alice" using the Graph API
When user "Alice" tries to delete the deprovisioning notification
Then the HTTP status code should be "404"
And user "Alice" should not have any notification
Examples:
| user-role |
| Space Admin |
| User |
| User Light |
Scenario Outline: administrator creates a deprovisioning notification with different date formats
When the administrator creates a deprovisioning notification for date "<deprovision-date>" of format "<deprovision-date-format>"
And user "Alice" lists all notifications
Then the HTTP status code of responses on each endpoint should be "200, 200" respectively
And the JSON response should contain a notification message with the subject "Instance will be shut down and deprovisioned" and the message-details should match
"""
{
"type": "object",
"required": [
"message"
],
"properties": {
"message": {
"type": "string",
"enum": [
"Attention! The instance will be shut down and deprovisioned on <deprovision-date>. Download all your data before that date as no access past that date is possible."
]
}
}
}
"""
Examples:
| deprovision-date | deprovision-date-format |
| 2030-04-09T15:04:05.999999999+07:00 | 2006-01-02T15:04:05.999999999Z07:00 |
| 5:15PM | 3:04PM |
# with date format like `Jan _2 15:04:05`, `_` gets replaced with a space in the response.
| Jan 8 23:04:05 | Jan _2 15:04:05 |
| Jan 12 15:04:05.000000000 | Jan _2 15:04:05.000000000 |
| 2023-01-02 15:04:05 | 2006-01-02 15:04:05 |
| 2023-01-02 | 2006-01-02 |
| 18:24:55 | 15:04:05 |
Scenario Outline: administrator change a deprovisioning notification with different date formats
Given the administrator has created a deprovisioning notification
When the administrator creates a deprovisioning notification for date "<deprovision-date>" of format "<deprovision-date-format>"
And user "Alice" lists all notifications
Then the HTTP status code of responses on each endpoint should be "200, 200" respectively
And the JSON response should contain a notification message with the subject "Instance will be shut down and deprovisioned" and the message-details should match
"""
{
"type": "object",
"required": [
"message"
],
"properties": {
"message": {
"type": "string",
"enum": [
"Attention! The instance will be shut down and deprovisioned on <deprovision-date>. Download all your data before that date as no access past that date is possible."
]
}
}
}
"""
Examples:
| deprovision-date | deprovision-date-format |
| 01/02 03:04:05PM '23 -0700 | 01/02 03:04:05PM '06 -0700 |
| Mon Jan 2 15:04:05 UTC 2023 | Mon Jan _2 15:04:05 UTC 2006 |
| Mon Jan 02 15:04:05 -0700 2023 | Mon Jan 02 15:04:05 -0700 2006 |
| 02 Jan 23 15:04 -0700 | 02 Jan 06 15:04 -0700 |
| Monday, 02-Jan-23 15:04:05 UTC | Monday, 02-Jan-06 15:04:05 UTC |
| Mon, 02 Jan 2023 15:04:05 -0700 | Mon, 02 Jan 2006 15:04:05 -0700 |
| 2023-01-02T15:04:05+07:00 | 2006-01-02T15:04:05Z07:00 |
@@ -0,0 +1,259 @@
@email
Feature: Email notification
As a user
I want to get email notification of events related to me
So that I can stay updated about the events
Background:
Given these users have been created with default attributes:
| username |
| Alice |
| Brian |
Scenario: user gets an email notification when someone shares a project space
Given the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API
And user "Alice" has created a space "new-space" with the default quota using the Graph API
When user "Alice" sends the following space share invitation using root endpoint of the Graph API:
| space | new-space |
| sharee | Brian |
| shareType | user |
| permissionsRole | Space Editor |
Then the HTTP status code should be "200"
And user "Brian" should have received the following email from user "Alice" about the share of project space "new-space"
"""
Hello Brian Murphy,
%displayname% has invited you to join "new-space".
Click here to view it: %base_url%/f/%space_id%
"""
Scenario: user gets an email notification when someone shares a file
Given user "Alice" has uploaded file with content "sample text" to "lorem.txt"
When user "Alice" sends the following resource share invitation using the Graph API:
| resource | lorem.txt |
| space | Personal |
| sharee | Brian |
| shareType | user |
| permissionsRole | Viewer |
Then the HTTP status code should be "200"
And user "Brian" should have received the following email from user "Alice"
"""
Hello Brian Murphy
%displayname% has shared "lorem.txt" with you.
Click here to view it: %base_url%/files/shares/with-me
"""
Scenario: group members get an email notification when someone shares a project space with the group
Given the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API
And user "Carol" has been created with default attributes
And group "group1" has been created
And user "Brian" has been added to group "group1"
And user "Carol" has been added to group "group1"
And user "Alice" has created a space "new-space" with the default quota using the Graph API
Then the HTTP status code should be "200"
When user "Alice" sends the following space share invitation using root endpoint of the Graph API:
| space | new-space |
| sharee | group1 |
| shareType | group |
| permissionsRole | Space Viewer |
Then the HTTP status code should be "200"
And user "Brian" should have received the following email from user "Alice" about the share of project space "new-space"
"""
Hello Brian Murphy,
%displayname% has invited you to join "new-space".
Click here to view it: %base_url%/f/%space_id%
"""
And user "Carol" should have received the following email from user "Alice" about the share of project space "new-space"
"""
Hello Carol King,
%displayname% has invited you to join "new-space".
Click here to view it: %base_url%/f/%space_id%
"""
@issue-183
Scenario: group members get an email notification in their respective languages when someone shares a folder with the group
Given user "Carol" has been created with default attributes
And group "group1" has been created
And user "Brian" has been added to group "group1"
And user "Carol" has been added to group "group1"
# And user "Brian" has switched the system language to "es" using the Graph API
And user "Carol" has switched the system language to "de" using the Graph API
And user "Alice" has created folder "/HelloWorld"
When user "Alice" sends the following resource share invitation using the Graph API:
| resource | HelloWorld |
| space | Personal |
| sharee | group1 |
| shareType | group |
| permissionsRole | Viewer |
Then the HTTP status code should be "200"
# And user "Brian" should have received the following email from user "Alice"
# """
# Hola Brian Murphy
# %displayname% ha compartido "HelloWorld" contigo.
# Click aquí para verlo: %base_url%/files/shares/with-me
# """
And user "Carol" should have received the following email from user "Alice"
"""
Hallo Carol King
%displayname% hat "HelloWorld" mit Ihnen geteilt.
Zum Ansehen hier klicken: %base_url%/files/shares/with-me
"""
@issue-183
Scenario: group members get an email notification in their respective languages when someone shares a file with the group
Given user "Carol" has been created with default attributes
And group "group1" has been created
And user "Brian" has been added to group "group1"
And user "Carol" has been added to group "group1"
# And user "Brian" has switched the system language to "es" using the Graph API
And user "Carol" has switched the system language to "de" using the Graph API
And user "Alice" has uploaded file with content "hello world" to "text.txt"
When user "Alice" sends the following resource share invitation using the Graph API:
| resource | text.txt |
| space | Personal |
| sharee | group1 |
| shareType | group |
| permissionsRole | Viewer |
Then the HTTP status code should be "200"
# And user "Brian" should have received the following email from user "Alice"
# """
# Hola Brian Murphy
# %displayname% ha compartido "text.txt" contigo.
# Click aquí para verlo: %base_url%/files/shares/with-me
# """
And user "Carol" should have received the following email from user "Alice"
"""
Hallo Carol King
%displayname% hat "text.txt" mit Ihnen geteilt.
Zum Ansehen hier klicken: %base_url%/files/shares/with-me
"""
@issue-183
Scenario: group members get an email notification in their respective languages when someone shares a space with the group
Given the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API
And user "Carol" has been created with default attributes
And group "group1" has been created
And user "Brian" has been added to group "group1"
And user "Carol" has been added to group "group1"
# And user "Brian" has switched the system language to "es" using the Graph API
And user "Carol" has switched the system language to "de" using the Graph API
And user "Alice" has created a space "new-space" with the default quota using the Graph API
And user "Alice" sends the following space share invitation using root endpoint of the Graph API:
| space | new-space |
| sharee | group1 |
| shareType | group |
| permissionsRole | Space Viewer |
Then the HTTP status code should be "200"
# And user "Brian" should have received the following email from user "Alice" about the share of project space "new-space"
# """
# Hola Brian Murphy,
# Alice Hansen te ha invitado a unirte a "new-space".
# Click aquí para verlo: %base_url%/f/%space_id%
# """
And user "Carol" should have received the following email from user "Alice" about the share of project space "new-space"
"""
Hallo Carol King,
Alice Hansen hat Sie eingeladen, dem Space "new-space" beizutreten.
Zum Ansehen hier klicken: %base_url%/f/%space_id%
"""
Scenario: user gets an email notification when space admin unshares a space
Given the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API
And user "Alice" has created a space "new-space" with the default quota using the Graph API
And user "Alice" has sent the following space share invitation:
| space | new-space |
| sharee | Brian |
| shareType | user |
| permissionsRole | Space Viewer |
When user "Alice" unshares a space "new-space" to user "Brian"
Then the HTTP status code should be "200"
And user "Brian" should have received the following email from user "Alice" about the share of project space "new-space"
"""
Hello Brian Murphy,
%displayname% has removed you from "new-space".
You might still have access through your other groups or direct membership.
Click here to check it: %base_url%/f/%space_id%
"""
@env-config
Scenario: group members get an email notification in default language when someone shares a file with the group
Given the config "OC_DEFAULT_LANGUAGE" has been set to "de"
And user "Carol" has been created with default attributes
And group "group1" has been created
And user "Brian" has been added to group "group1"
And user "Carol" has been added to group "group1"
And user "Alice" has uploaded file with content "hello world" to "text.txt"
When user "Alice" sends the following resource share invitation using the Graph API:
| resource | text.txt |
| space | Personal |
| sharee | group1 |
| shareType | group |
| permissionsRole | Viewer |
Then the HTTP status code should be "200"
And user "Brian" should have received the following email from user "Alice"
"""
Hallo Brian Murphy
%displayname% hat "text.txt" mit Ihnen geteilt.
Zum Ansehen hier klicken: %base_url%/files/shares/with-me
"""
And user "Carol" should have received the following email from user "Alice"
"""
Hallo Carol King
%displayname% hat "text.txt" mit Ihnen geteilt.
Zum Ansehen hier klicken: %base_url%/files/shares/with-me
"""
@issue-9530
Scenario: user gets an email notification when someone with comma in display name shares a file
Given the administrator has assigned the role "Admin" to user "Brian" using the Graph API
And the user "Brian" has created a new user with the following attributes:
| userName | Carol |
| displayName | Carol, King |
| email | carol@example.com |
| password | 1234 |
And user "Carol" has uploaded file with content "sample text" to "lorem.txt"
When user "Carol" sends the following resource share invitation using the Graph API:
| resource | lorem.txt |
| space | Personal |
| sharee | Brian |
| shareType | user |
| permissionsRole | Viewer |
Then the HTTP status code should be "200"
And user "Brian" should have received the following email from user "Carol"
"""
Hello Brian Murphy
Carol, King has shared "lorem.txt" with you.
Click here to view it: %base_url%/files/shares/with-me
"""
@@ -0,0 +1,332 @@
Feature: Notification
As a user
I want to be notified of various events
So that I can stay updated about the information
Background:
Given these users have been created with default attributes:
| username |
| Alice |
| Brian |
| Carol |
And user "Alice" has uploaded file with content "other data" to "/textfile1.txt"
And user "Alice" has created folder "my_data"
Scenario Outline: user gets a notification of resource sharing
Given user "Alice" has sent the following resource share invitation:
| resource | <resource> |
| space | Personal |
| sharee | Brian |
| shareType | user |
| permissionsRole | Viewer |
When user "Brian" lists all notifications
Then the HTTP status code should be "200"
And the JSON response should contain a notification message with the subject "Resource shared" and the message-details should match
"""
{
"type": "object",
"required": [
"app",
"datetime",
"message",
"messageRich",
"messageRichParameters",
"notification_id",
"object_id",
"object_type",
"subject",
"subjectRich",
"user"
],
"properties": {
"app": {
"type": "string",
"enum": ["userlog"]
},
"message": {
"type": "string",
"enum": ["Alice Hansen shared <resource> with you"]
},
"messageRich": {
"type": "string",
"enum": ["{user} shared {resource} with you"]
},
"messageRichParameters": {
"type": "object",
"required": [
"resource",
"user"
],
"properties": {
"resource": {
"type": "object",
"required": [
"id",
"name"
],
"properties": {
"id": {
"type": "string",
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}\\$[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}![a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
},
"name": {
"type": "string",
"enum": ["<resource>"]
}
}
},
"user": {
"type": "object",
"required": [
"displayname",
"id",
"name"
],
"properties": {
"displayname": {
"type": "string",
"enum": ["Alice Hansen"]
},
"id": {
"type": "string",
"pattern": "^%user_id_pattern%$"
},
"name": {
"type": "string",
"enum": ["Alice"]
}
}
}
}
},
"notification_id": {
"type": "string"
},
"object_id": {
"type": "string"
},
"object_type": {
"type": "string",
"enum": ["share"]
},
"subject": {
"type": "string",
"enum": ["Resource shared"]
},
"subjectRich": {
"type": "string",
"enum": ["Resource shared"]
},
"user": {
"type": "string",
"enum": ["Alice"]
}
}
}
"""
Examples:
| resource |
| textfile1.txt |
| my_data |
Scenario Outline: user gets a notification of unsharing resource
Given user "Alice" has sent the following resource share invitation:
| resource | <resource> |
| space | Personal |
| sharee | Brian |
| shareType | user |
| permissionsRole | Viewer |
And user "Alice" has removed the access of user "Brian" from resource "<resource>" of space "Personal"
When user "Brian" lists all notifications
Then the HTTP status code should be "200"
And the JSON response should contain a notification message with the subject "Resource unshared" and the message-details should match
"""
{
"type": "object",
"required": [
"app",
"datetime",
"message",
"messageRich",
"messageRichParameters",
"notification_id",
"object_id",
"object_type",
"subject",
"subjectRich",
"user"
],
"properties": {
"app": {
"type": "string",
"enum": ["userlog"]
},
"message": {
"type": "string",
"enum": ["Alice Hansen unshared <resource> with you"]
},
"messageRich": {
"type": "string",
"enum": ["{user} unshared {resource} with you"]
},
"messageRichParameters": {
"type": "object",
"required": [
"resource",
"user"
],
"properties": {
"resource": {
"type": "object",
"required": [
"id",
"name"
],
"properties": {
"id": {
"type": "string",
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}\\$[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}![a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
},
"name": {
"type": "string",
"enum": ["<resource>"]
}
}
},
"user": {
"type": "object",
"required": [
"displayname",
"id",
"name"
],
"properties": {
"displayname": {
"type": "string",
"enum": ["Alice Hansen"]
},
"id": {
"type": "string",
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
},
"name": {
"type": "string",
"enum": ["Alice"]
}
}
}
}
},
"notification_id": {
"type": "string"
},
"object_id": {
"type": "string"
},
"object_type": {
"type": "string",
"enum": ["share"]
},
"subject": {
"type": "string",
"enum": ["Resource unshared"]
},
"subjectRich": {
"type": "string",
"enum": ["Resource unshared"]
},
"user": {
"type": "string",
"enum": ["Alice"]
}
}
}
"""
Examples:
| resource |
| textfile1.txt |
| my_data |
@issue-183
Scenario Outline: get a notification about a file share in various languages
Given user "Brian" has switched the system language to "<language>" using the <api> API
And user "Alice" has sent the following resource share invitation:
| resource | textfile1.txt |
| space | Personal |
| sharee | Brian |
| shareType | user |
| permissionsRole | Viewer |
When user "Brian" lists all notifications
Then the HTTP status code should be "200"
And the JSON response should contain a notification message with the subject "<subject>" and the message-details should match
"""
{
"type": "object",
"required": [
"message"
],
"properties": {
"message": {
"type": "string",
"enum": [
"<message>"
]
}
}
}
"""
Examples:
| language | subject | message | api |
| de | Neue Freigabe | Alice Hansen hat textfile1.txt mit Ihnen geteilt | Graph |
| de | Neue Freigabe | Alice Hansen hat textfile1.txt mit Ihnen geteilt | settings |
| es | Recurso compartido | Alice Hansen compartió textfile1.txt contigo | Graph |
| es | Recurso compartido | Alice Hansen compartió textfile1.txt contigo | settings |
@env-config
Scenario: get a notification about a file share in default languages
Given the config "OC_DEFAULT_LANGUAGE" has been set to "de"
And user "Alice" has sent the following resource share invitation:
| resource | textfile1.txt |
| space | Personal |
| sharee | Brian |
| shareType | user |
| permissionsRole | Viewer |
When user "Brian" lists all notifications
Then the HTTP status code should be "200"
And the JSON response should contain a notification message with the subject "Neue Freigabe" and the message-details should match
"""
{
"type": "object",
"required": [
"message"
],
"properties": {
"message": {
"type": "string",
"enum": [
"Alice Hansen hat textfile1.txt mit Ihnen geteilt"
]
}
}
}
"""
Scenario Outline: notifications related to a resource get deleted when the resource is deleted
Given user "Alice" has sent the following resource share invitation:
| resource | <resource> |
| space | Personal |
| sharee | Brian |
| shareType | user |
| permissionsRole | Viewer |
And user "Alice" has removed the access of user "Brian" from resource "<resource>" of space "Personal"
And user "Alice" has deleted entity "/<resource>"
When user "Brian" lists all notifications
Then the HTTP status code should be "200"
And the notifications should be empty
Examples:
| resource |
| textfile1.txt |
| my_data |
@@ -0,0 +1,15 @@
Feature: service health check
Scenario: check service health
When a user requests these URLs with "GET" and no authentication
| endpoint | service |
| http://%base_url_hostname%:9174/healthz | notification |
Then the HTTP status code of responses on all endpoints should be "200"
Scenario: check service readiness
When a user requests these URLs with "GET" and no authentication
| endpoint | service |
| http://%base_url_hostname%:9174/readyz | notification |
Then the HTTP status code of responses on all endpoints should be "200"
@@ -0,0 +1,452 @@
Feature: Notification
As a user
I want to be notified of actions related to space
So that I can stay updated about the spaces
Background:
Given these users have been created with default attributes:
| username |
| Alice |
| Brian |
| Carol |
And the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API
And user "Alice" has created a space "notification checking" with the default quota using the Graph API
And user "Alice" has sent the following space share invitation:
| space | notification checking |
| sharee | Brian |
| shareType | user |
| permissionsRole | Space Editor |
Scenario: get a notification of space shared
When user "Brian" lists all notifications
Then the HTTP status code should be "200"
And the JSON response should contain a notification message with the subject "Space shared" and the message-details should match
"""
{
"type": "object",
"required": [
"app",
"datetime",
"message",
"messageRich",
"messageRichParameters",
"notification_id",
"object_id",
"object_type",
"subject",
"subjectRich",
"user"
],
"properties": {
"app": {
"type": "string",
"enum": [
"userlog"
]
},
"message": {
"type": "string",
"enum": [
"Alice Hansen added you to Space notification checking"
]
},
"messageRich": {
"type": "string",
"enum": [
"{user} added you to Space {space}"
]
},
"messageRichParameters": {
"type": "object",
"required": [
"space",
"user"
],
"properties": {
"space": {
"type": "object",
"required": [
"id",
"name"
],
"properties": {
"id": {
"type": "string",
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}\\$[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}![a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
},
"name": {
"type": "string",
"enum": [
"notification checking"
]
}
}
},
"user": {
"type": "object",
"required": [
"displayname",
"id",
"name"
],
"properties": {
"displayname": {
"type": "string",
"enum": [
"Alice Hansen"
]
},
"id": {
"type": "string",
"pattern": "^%user_id_pattern%$"
},
"name": {
"type": "string",
"enum": [
"Alice"
]
}
}
}
}
},
"notification_id": {
"type": "string"
},
"object_id": {
"type": "string",
"pattern": "^%space_id_pattern%$"
},
"object_type": {
"type": "string",
"enum": [
"storagespace"
]
},
"subject": {
"type": "string",
"enum": [
"Space shared"
]
},
"subjectRich": {
"type": "string",
"enum": [
"Space shared"
]
},
"user": {
"type": "string",
"enum": [
"Alice"
]
}
}
}
"""
Scenario: get a notification of space unshared
Given user "Alice" has removed the access of user "Brian" from space "notification checking"
When user "Brian" lists all notifications
Then the HTTP status code should be "200"
And the JSON response should contain a notification message with the subject "Removed from Space" and the message-details should match
"""
{
"type": "object",
"required": [
"app",
"datetime",
"message",
"messageRich",
"messageRichParameters",
"notification_id",
"object_id",
"object_type",
"subject",
"subjectRich",
"user"
],
"properties": {
"app": {
"type": "string",
"enum": [
"userlog"
]
},
"message": {
"type": "string",
"enum": [
"Alice Hansen removed you from Space notification checking"
]
},
"messageRich": {
"type": "string",
"enum": [
"{user} removed you from Space {space}"
]
},
"messageRichParameters": {
"type": "object",
"required": [
"space",
"user"
],
"properties": {
"space": {
"type": "object",
"required": [
"id",
"name"
],
"properties": {
"id": {
"type": "string",
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}\\$[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}![a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
},
"name": {
"type": "string",
"enum": [
"notification checking"
]
}
}
},
"user": {
"type": "object",
"required": [
"displayname",
"id",
"name"
],
"properties": {
"displayname": {
"type": "string",
"enum": [
"Alice Hansen"
]
},
"id": {
"type": "string",
"pattern": "^%user_id_pattern%$"
},
"name": {
"type": "string",
"enum": [
"Alice"
]
}
}
}
}
},
"notification_id": {
"type": "string"
},
"object_id": {
"type": "string",
"pattern": "^%space_id_pattern%$"
},
"object_type": {
"type": "string",
"enum": [
"storagespace"
]
},
"subject": {
"type": "string",
"enum": [
"Removed from Space"
]
},
"subjectRich": {
"type": "string",
"enum": [
"Removed from Space"
]
},
"user": {
"type": "string",
"enum": [
"Alice"
]
}
}
}
"""
Scenario: get a notification of space disabled
Given user "Alice" has disabled a space "notification checking"
When user "Brian" lists all notifications
Then the HTTP status code should be "200"
And there should be "2" notifications
And the JSON response should contain a notification message with the subject "Space disabled" and the message-details should match
"""
{
"type": "object",
"required": [
"app",
"datetime",
"message",
"messageRich",
"messageRichParameters",
"notification_id",
"object_id",
"object_type",
"subject",
"subjectRich",
"user"
],
"properties": {
"app": {
"type": "string",
"enum": [
"userlog"
]
},
"message": {
"type": "string",
"enum": [
"Alice Hansen disabled Space notification checking"
]
},
"messageRich": {
"type": "string",
"enum": [
"{user} disabled Space {space}"
]
},
"messageRichParameters": {
"type": "object",
"required": [
"space",
"user"
],
"properties": {
"space": {
"type": "object",
"required": [
"id",
"name"
],
"properties": {
"id": {
"type": "string",
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}\\$[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}![a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
},
"name": {
"type": "string",
"enum": [
"notification checking"
]
}
}
},
"user": {
"type": "object",
"required": [
"displayname",
"id",
"name"
],
"properties": {
"displayname": {
"type": "string",
"enum": [
"Alice Hansen"
]
},
"id": {
"type": "string",
"pattern": "^%user_id_pattern%$"
},
"name": {
"type": "string",
"enum": [
"Alice"
]
}
}
}
}
},
"notification_id": {
"type": "string"
},
"object_id": {
"type": "string",
"pattern": "^%space_id_pattern%$"
},
"object_type": {
"type": "string",
"enum": [
"storagespace"
]
},
"subject": {
"type": "string",
"enum": [
"Space disabled"
]
},
"subjectRich": {
"type": "string",
"enum": [
"Space disabled"
]
},
"user": {
"type": "string",
"enum": [
"Alice"
]
}
}
}
"""
@issue-183
Scenario Outline: get a notification about a space share in various languages
Given user "Brian" has switched the system language to "<language>" using the Graph API
When user "Brian" lists all notifications
Then the HTTP status code should be "200"
And the JSON response should contain a notification message with the subject "<subject>" and the message-details should match
"""
{
"type": "object",
"required": [
"message"
],
"properties": {
"message": {
"type": "string",
"enum": [
"<message>"
]
}
}
}
"""
Examples:
| language | subject | message |
| de | Space freigegeben | Alice Hansen hat Sie zu Space notification checking hinzugefügt |
| es | Space compartido | Alice Hansen te añadió al Space notification checking |
Scenario: all notification related to space get deleted when the sharer deletes that resource
Given user "Alice" has removed the access of user "Brian" from space "notification checking"
And user "Alice" has disabled a space "notification checking"
And user "Alice" has deleted a space "notification checking"
When user "Brian" lists all notifications
Then the HTTP status code should be "200"
And the notifications should be empty
Scenario: user doesn't get any notification after being removed from space
Given user "Alice" has removed the access of user "Brian" from space "notification checking"
And user "Alice" has disabled a space "notification checking"
When user "Brian" lists all notifications
Then the HTTP status code should be "200"
And there should be "2" notifications