From a214308fe9fcd196fb18722239c0414e64a32c5a Mon Sep 17 00:00:00 2001 From: Deyan Zhekov Date: Fri, 25 Apr 2025 10:01:26 +0300 Subject: [PATCH] Extend notification tests for User Light role in notification.feature Remove whitespace Using user-role in Examples Extend scenario to check also User Light role Extend scenario for Personal space folder to also check User Light role Add user-role as parameter when testing share removed Add user-role as parameter when testing share remove for a resource Add user-role as example's parameter in spaceNotification.feature Updated more scenarios in spaceNotification.feature Use as a parameter for scenarios in notificationSetting.feature Fix for failing pipeline job Use as a parameter for scenarios in notificationSetting.feature Refactoring Use as a parameter for scenarios in notificationSetting.feature Use as a parameter for scenarios in notificationSetting.feature Update scenarios' title --- .../apiNotification/notification.feature | 78 +++++++++----- .../apiNotification/spaceNotification.feature | 49 ++++++--- .../apiSettings/notificationSetting.feature | 102 +++++++++++++----- 3 files changed, 162 insertions(+), 67 deletions(-) diff --git a/tests/acceptance/features/apiNotification/notification.feature b/tests/acceptance/features/apiNotification/notification.feature index ce46abe8f95..23745557da6 100644 --- a/tests/acceptance/features/apiNotification/notification.feature +++ b/tests/acceptance/features/apiNotification/notification.feature @@ -13,9 +13,10 @@ Feature: Notification And user "Alice" has uploaded file with content "other data" to "/textfile1.txt" And user "Alice" has created folder "my_data" - @email + @issue-10937 @email Scenario Outline: user gets in-app and mail notifications of resource sharing - Given user "Alice" has sent the following resource share invitation: + Given the administrator has assigned the role "" to user "Brian" using the Graph API + And user "Alice" has sent the following resource share invitation: | resource | | | space | Personal | | sharee | Brian | @@ -85,13 +86,16 @@ Feature: Notification Click here to view it: %base_url%/files/shares/with-me """ Examples: - | resource | - | textfile1.txt | - | my_data | - - - Scenario Outline: get a notification about a file share in various languages - Given user "Brian" has switched the system language to "" using the API + | user-role | resource | + | User | textfile1.txt | + | User | my_data | + | User Light | textfile1.txt | + | User Light | my_data | + + @issue-10937 @email + Scenario Outline: user gets a notification about a file share in various languages + Given the administrator has assigned the role "" to user "Brian" using the Graph API + And user "Brian" has switched the system language to "" using the API And user "Alice" has sent the following resource share invitation: | resource | textfile1.txt | | space | Personal | @@ -118,11 +122,15 @@ Feature: Notification } """ 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 | + | user-role | language | subject | message | api | + | User | de | Neue Freigabe | Alice Hansen hat textfile1.txt mit Ihnen geteilt | Graph | + | User | de | Neue Freigabe | Alice Hansen hat textfile1.txt mit Ihnen geteilt | settings | + | User | es | Recurso compartido | Alice Hansen compartió textfile1.txt contigo | Graph | + | User | es | Recurso compartido | Alice Hansen compartió textfile1.txt contigo | settings | + | User Light | de | Neue Freigabe | Alice Hansen hat textfile1.txt mit Ihnen geteilt | Graph | + | User Light | de | Neue Freigabe | Alice Hansen hat textfile1.txt mit Ihnen geteilt | settings | + | User Light | es | Recurso compartido | Alice Hansen compartió textfile1.txt contigo | Graph | + | User Light | es | Recurso compartido | Alice Hansen compartió textfile1.txt contigo | settings | @env-config Scenario: get a notification about a file share in default languages @@ -171,9 +179,10 @@ Feature: Notification | textfile1.txt | | my_data | - @issue-10966 @email - Scenario: check share expired in-app and mail notifications for Personal space file + @issue-10937 @issue-10966 @email + Scenario Outline: check share expired in-app and mail notifications for Personal space file Given using SharingNG + And the administrator has assigned the role "" to user "Brian" using the Graph API And user "Alice" has uploaded file with content "hello world" to "testfile.txt" And user "Alice" has sent the following resource share invitation: | resource | testfile.txt | @@ -195,10 +204,15 @@ Feature: Notification Even though this share has been revoked you still might have access through other shares and/or space memberships. """ + Examples: + | user-role | + | User | + | User Light | - @issue-10966 @email - Scenario: check share expired in-app and mail notifications for Personal space folder + @issue-10937 @issue-10966 @email + Scenario Outline: check share expired in-app and mail notifications for Personal space folder Given using SharingNG + And the administrator has assigned the role "" to user "Brian" using the Graph API And user "Alice" has created folder "folderToShare" And user "Alice" has sent the following resource share invitation: | resource | folderToShare | @@ -220,10 +234,15 @@ Feature: Notification Even though this share has been revoked you still might have access through other shares and/or space memberships. """ + Examples: + | user-role | + | User | + | User Light | - @issue-10904 @email + @issue-10904 @issue-10937 @email Scenario Outline: user gets an in-app and mail notifications of unsharing resource - Given user "Alice" has sent the following resource share invitation: + Given the administrator has assigned the role "" to user "Brian" using the Graph API + And user "Alice" has sent the following resource share invitation: | resource | | | space | Personal | | sharee | Brian | @@ -243,17 +262,20 @@ Feature: Notification Even though this share has been revoked you still might have access through other shares and/or space memberships. """ Examples: - | resource | - | textfile1.txt | - | my_data | + | user-role | resource | + | User | textfile1.txt | + | User | my_data | + | User Light | textfile1.txt | + | User Light | my_data | - @issue-10904 @email + @issue-10904 @issue-10937 @email Scenario Outline: user gets in-app and mail notifications when a resource is unshared (Project Space) Given using spaces DAV path And the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API And user "Alice" has created a space "shared-space" with the default quota using the Graph API And user "Alice" has created a folder "SHARED-FOLDER" in space "shared-space" And user "Alice" has uploaded a file inside space "shared-space" with content "Sample data" to "file-to-share.txt" + And the administrator has assigned the role "" to user "Brian" using the Graph API And user "Alice" has sent the following resource share invitation: | resource | | | space | shared-space | @@ -274,9 +296,11 @@ Feature: Notification Even though this share has been revoked you still might have access through other shares and/or space memberships. """ Examples: - | resource | - | file-to-share.txt | - | SHARED-FOLDER | + | user-role | resource | + | User | file-to-share.txt | + | User | SHARED-FOLDER | + | User Light | file-to-share.txt | + | User Light | SHARED-FOLDER | @issue-9530 @email Scenario: user gets an in-app and mail notifications when someone with comma in display name shares a file diff --git a/tests/acceptance/features/apiNotification/spaceNotification.feature b/tests/acceptance/features/apiNotification/spaceNotification.feature index 33861f655df..9b5aa837c5d 100644 --- a/tests/acceptance/features/apiNotification/spaceNotification.feature +++ b/tests/acceptance/features/apiNotification/spaceNotification.feature @@ -18,8 +18,9 @@ Feature: Notification | shareType | user | | permissionsRole | Space Editor | - @email - Scenario: user gets in-app and mail notifications of space shared + @issue-10937 @email + Scenario Outline: user gets in-app and mail notifications of space shared + And the administrator has assigned the role "" to user "Brian" 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 "Space shared" and the message-details should match @@ -83,9 +84,14 @@ Feature: Notification Click here to view it: %base_url%/f/%space_id% """ + Examples: + | user-role | + | User | + | User Light | - @email - Scenario: gets in-app and mail notification of space unshared + @issue-10937 @email + Scenario Outline: gets in-app and mail notification of space unshared + Given the administrator has assigned the role "" to user "Brian" using the Graph API When user "Alice" removes the access of user "Brian" from space "notification checking" using root endpoint of the Graph API Then the HTTP status code should be "204" And user "Brian" should get a notification with subject "Removed from Space" and message: @@ -101,10 +107,15 @@ Feature: Notification Click here to check it: %base_url%/f/%space_id% """ + Examples: + | user-role | + | User | + | User Light | - - Scenario: user gets in-app notification of space disabled (note: no mail notification) - Given user "Alice" has disabled a space "notification checking" + @issue-10937 + Scenario Outline: user gets in-app notification of "Space disabled" event (note: no mail notification) + Given the administrator has assigned the role "" to user "Brian" using the Graph API + 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 @@ -161,6 +172,10 @@ Feature: Notification } } """ + Examples: + | user-role | + | User | + | User Light | Scenario Outline: get in-app notification about a space share in various languages @@ -191,15 +206,20 @@ Feature: Notification Then the HTTP status code should be "200" And the notifications should be empty - @email - Scenario: user doesn't get any notification after being removed from space(note: no mail notification) - Given user "Alice" has removed the access of user "Brian" from space "notification checking" + @issue-10937 @email + Scenario Outline: user doesn't get any notification after being removed from space (note: no mail notification) + Given the administrator has assigned the role "" to user "Brian" using the Graph API + And 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 And user "Brian" should have "2" emails But user "Brian" should not have a notification related to space "notification checking" with subject "Space disabled" + Examples: + | user-role | + | User | + | User Light | @email Scenario: group members get in-app and email notifications when someone shares a project space with the group @@ -275,8 +295,9 @@ Feature: Notification Zum Ansehen hier klicken: %base_url%/f/%space_id% """ - @issue-10882 @email - Scenario: user gets in-app and email notifications when space membership expires + @issue-10937 @issue-10882 @email + Scenario Outline: user gets in-app and email notifications when space membership expires + Given the administrator has assigned the role "" to user "Brian" using the Graph API When user "Alice" has expired the membership of user "Brian" from space "notification checking" Then the HTTP status code should be "200" And user "Brian" should get a notification with subject "Membership expired" and message: @@ -290,3 +311,7 @@ Feature: Notification Even though this membership has expired you still might have access through other shares and/or space memberships """ + Examples: + | user-role | + | User | + | User Light | diff --git a/tests/acceptance/features/apiSettings/notificationSetting.feature b/tests/acceptance/features/apiSettings/notificationSetting.feature index 8b59b082df7..99b61aa3fe4 100644 --- a/tests/acceptance/features/apiSettings/notificationSetting.feature +++ b/tests/acceptance/features/apiSettings/notificationSetting.feature @@ -64,8 +64,9 @@ Feature: Notification Settings | permissionsRole | Viewer | And user "Brian" should have "0" emails - @email - Scenario: disable mail and in-app notification for "Share Received" event + @issue-10937 @email + Scenario Outline: disable mail and in-app notification for "Share Received" event + Given the administrator has assigned the role "" to user "Brian" using the Graph API When user "Brian" disables notification for the following event using the settings API: | event | Share Received | | notificationTypes | mail,in-app | @@ -153,10 +154,15 @@ Feature: Notification Settings When user "Brian" lists all notifications Then the HTTP status code should be "200" And the notifications should be empty + Examples: + | user-role | + | User | + | User Light | - @email - Scenario: disable mail and in-app notification for "Share Removed" event - Given user "Alice" has sent the following resource share invitation: + @issue-10937 @email + Scenario Outline: disable mail and in-app notification for "Share Removed" event + Given the administrator has assigned the role "" to user "Brian" using the Graph API + And user "Alice" has sent the following resource share invitation: | resource | lorem.txt | | space | Personal | | sharee | Brian | @@ -245,13 +251,18 @@ Feature: Notification Settings | message | | Alice Hansen shared lorem.txt with you | But user "Brian" should not have a notification related to resource "lorem.txt" with subject "Resource unshared" + Examples: + | user-role | + | User | + | User Light | - @email - Scenario: disable mail and in-app notification for "Share Removed" event (Project space) + @issue-10937 @email + Scenario Outline: disable mail and in-app notification for "Share Removed" event (Project space) Given using spaces DAV path And the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API And user "Alice" has created a space "newSpace" with the default quota using the Graph API And user "Alice" has uploaded a file inside space "newSpace" with content "some content" to "insideSpace.txt" + And the administrator has assigned the role "" to user "Brian" using the Graph API And user "Alice" has sent the following resource share invitation: | resource | insideSpace.txt | | space | newSpace | @@ -341,11 +352,16 @@ Feature: Notification Settings | message | | Alice Hansen shared insideSpace.txt with you | But user "Brian" should not have a notification related to resource "insideSpace.txt" with subject "Resource unshared" + Examples: + | user-role | + | User | + | User Light | - - Scenario: disable in-app notification for "Space disabled" event + @issue-10937 + Scenario Outline: disable in-app notification for "Space disabled" event (note: no mail notification) 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 the administrator has assigned the role "" to user "Brian" using the Graph API And user "Alice" has sent the following space share invitation: | space | new-space | | sharee | Brian | @@ -437,9 +453,13 @@ Feature: Notification Settings | message | | Alice Hansen added you to Space new-space | But user "Brian" should not have a notification related to space "new-space" with subject "Space disabled" + Examples: + | user-role | + | User | + | User Light | @issue-10864 @email - Scenario: disable email notification for user light + Scenario: disable email notification for User Light mode Given the administrator has assigned the role "User Light" to user "Brian" using the Graph API When user "Brian" disables email notification using the settings API Then the HTTP status code should be "201" @@ -495,11 +515,12 @@ Feature: Notification Settings | Alice Hansen shared lorem.txt with you | And user "Brian" should have "0" emails - @email - Scenario: disable mail and in-app notification for "Added as space member" event + @issue-10937 @email + Scenario Outline: disable mail and in-app notification for "Added as space member" event Given using spaces DAV path And the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API And user "Alice" has created a space "newSpace" with the default quota using the Graph API + And the administrator has assigned the role "" to user "Brian" using the Graph API When user "Brian" disables notification for the following event using the settings API: | event | Added As Space Member | | notificationTypes | mail,in-app | @@ -586,6 +607,10 @@ Feature: Notification Settings Then the HTTP status code should be "200" And the notifications should be empty And user "Brian" should have "0" emails + Examples: + | user-role | + | User | + | User Light | @email Scenario: no email should be received when email sending interval is set to never @@ -644,11 +669,12 @@ Feature: Notification Settings | Alice Hansen shared lorem.txt with you | And user "Brian" should have "0" emails - @email - Scenario: disable mail and in-app notification for "Removed as space member" event + @issue-10937 @email + Scenario Outline: disable mail and in-app notification for "Removed as space member" event Given using spaces DAV path And the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API And user "Alice" has created a space "newSpace" with the default quota using the Graph API + And the administrator has assigned the role "" to user "Brian" using the Graph API And user "Alice" has sent the following space share invitation: | space | newSpace | | sharee | Brian | @@ -745,11 +771,16 @@ Feature: Notification Settings Click here to view it: %base_url%/f/%space_id% """ + Examples: + | user-role | + | User | + | User Light | - @email - Scenario: disable mail and in-app notification for "Space Membership Expired" event + @issue-10937 @email + Scenario Outline: disable mail and in-app notification for "Space Membership Expired" event Given using spaces DAV path And the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API + And the administrator has assigned the role "" to user "Brian" using the Graph API And user "Alice" has created a space "newSpace" with the default quota using the Graph API And user "Alice" has sent the following space share invitation: | space | newSpace | @@ -848,11 +879,16 @@ Feature: Notification Settings Click here to view it: %base_url%/f/%space_id% """ + Examples: + | user-role | + | User | + | User Light | - - Scenario: disable share expired in-app and mail notification + @issue-10937 @email + Scenario Outline: disable mail and in-app notification for "Share Expired" event Given using SharingNG And user "Alice" has uploaded file with content "hello world" to "testfile.txt" + And the administrator has assigned the role "" to user "Brian" using the Graph API When user "Brian" disables notification for the following event using the settings API: | event | Share Expired | | notificationTypes | mail,in-app | @@ -932,10 +968,15 @@ Feature: Notification Settings } } """ + Examples: + | user-role | + | User | + | User Light | - @email - Scenario Outline: no in-app and mail notification should appear when Share Expired notification is disabled (Personal space) + @issue-10937 @email + Scenario Outline: no in-app and mail notification should appear when "Share Expired" event is disabled (Personal space) Given using SharingNG + And the administrator has assigned the role "" to user "Brian" using the Graph API And user "Alice" has created folder "my_data" And user "Alice" has uploaded file with content "hello world" to "lorem.txt" And user "Brian" has disabled notification for the following event using the settings API: @@ -963,15 +1004,18 @@ Feature: Notification Settings | Alice Hansen shared with you | But user "Brian" should not have a notification related to space "Alice Hansen" with subject "Share expired" Examples: - | resource | - | lorem.txt | - | my_data | + | resource | user-role | + | lorem.txt | User | + | lorem.txt | User Light | + | my_data | User | + | my_data | User Light | - @email - Scenario Outline: no in-app and mail notification should appear when Share Expired notification is disabled (Project space) + @issue-10937 @email + Scenario Outline: no in-app and mail notification should appear when "Share Expired" event is disabled (Project space) Given using spaces DAV path And using SharingNG And the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API + And the administrator has assigned the role "" to user "Brian" using the Graph API And user "Alice" has created a space "NewSpace" with the default quota using the Graph API And user "Alice" has created a folder "uploadFolder" in space "NewSpace" And user "Alice" has uploaded a file inside space "NewSpace" with content "share space items" to "lorem.txt" @@ -1000,6 +1044,8 @@ Feature: Notification Settings | Alice Hansen shared with you | But user "Brian" should not have a notification related to space "NewSpace" with subject "Share expired" Examples: - | resource | - | lorem.txt | - | uploadFolder | + | resource | user-role | + | lorem.txt | User | + | lorem.txt | User Light | + | uploadFolder | User | + | uploadFolder | User Light |