diff options
author | Joas Schilling <coding@schilljs.com> | 2022-04-05 16:25:19 +0200 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2022-04-06 14:16:27 +0200 |
commit | ded792aad5760d94f75be7198e02777c532863fb (patch) | |
tree | 52d7b4b2005e70c55bf46a7222085ec141aa71bd /tests | |
parent | d8489cb4030d31e68e52476f00ad32c73bc216d0 (diff) |
Add notification testing for chat messages
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/integration/features/chat/notifications.feature | 216 |
1 files changed, 216 insertions, 0 deletions
diff --git a/tests/integration/features/chat/notifications.feature b/tests/integration/features/chat/notifications.feature new file mode 100644 index 000000000..467e42175 --- /dev/null +++ b/tests/integration/features/chat/notifications.feature @@ -0,0 +1,216 @@ +Feature: chat/notifications + + Background: + Given user "participant1" exists + Given user "participant2" exists + + Scenario: Normal message when recipient is online in the one-to-one + When user "participant1" creates room "one-to-one room" (v4) + | roomType | 1 | + | invite | participant2 | + Given user "participant2" joins room "one-to-one room" with 200 (v4) + When user "participant1" sends message "Message 1" to room "one-to-one room" with 201 + Then user "participant2" has the following notifications + | app | object_type | object_id | subject | + + Scenario: Normal message when recipient is offline in the one-to-one + When user "participant1" creates room "one-to-one room" (v4) + | roomType | 1 | + | invite | participant2 | + # Join and leave to clear the invite notification + Given user "participant2" joins room "one-to-one room" with 200 (v4) + Given user "participant2" leaves room "one-to-one room" with 200 (v4) + When user "participant1" sends message "Message 1" to room "one-to-one room" with 201 + Then user "participant2" has the following notifications + | app | object_type | object_id | subject | + | spreed | chat | one-to-one room/Message 1 | participant1-displayname sent you a private message | + + Scenario: Normal message when recipient disabled notifications in the one-to-one + When user "participant1" creates room "one-to-one room" (v4) + | roomType | 1 | + | invite | participant2 | + # Join and leave to clear the invite notification + Given user "participant2" joins room "one-to-one room" with 200 (v4) + Given user "participant2" leaves room "one-to-one room" with 200 (v4) + And user "participant2" sets notifications to disabled for room "one-to-one room" (v4) + When user "participant1" sends message "Message 1" to room "one-to-one room" with 201 + Then user "participant2" has the following notifications + | app | object_type | object_id | subject | + + Scenario: Mention when recipient is online in the one-to-one + When user "participant1" creates room "one-to-one room" (v4) + | roomType | 1 | + | invite | participant2 | + Given user "participant2" joins room "one-to-one room" with 200 (v4) + When user "participant1" sends message "Hi @participant2 bye" to room "one-to-one room" with 201 + Then user "participant2" has the following notifications + | app | object_type | object_id | subject | + | spreed | chat | one-to-one room/Hi @participant2 bye | participant1-displayname mentioned you in a private conversation | + + Scenario: Mention when recipient is offline in the one-to-one + When user "participant1" creates room "one-to-one room" (v4) + | roomType | 1 | + | invite | participant2 | + # Join and leave to clear the invite notification + Given user "participant2" joins room "one-to-one room" with 200 (v4) + Given user "participant2" leaves room "one-to-one room" with 200 (v4) + When user "participant1" sends message "Hi @participant2 bye" to room "one-to-one room" with 201 + Then user "participant2" has the following notifications + | app | object_type | object_id | subject | + | spreed | chat | one-to-one room/Hi @participant2 bye | participant1-displayname mentioned you in a private conversation | + + Scenario: Mention when recipient disabled notifications in the one-to-one + When user "participant1" creates room "one-to-one room" (v4) + | roomType | 1 | + | invite | participant2 | + # Join and leave to clear the invite notification + Given user "participant2" joins room "one-to-one room" with 200 (v4) + Given user "participant2" leaves room "one-to-one room" with 200 (v4) + And user "participant2" sets notifications to disabled for room "one-to-one room" (v4) + When user "participant1" sends message "Hi @participant2 bye" to room "one-to-one room" with 201 + Then user "participant2" has the following notifications + | app | object_type | object_id | subject | + + Scenario: At-all when recipient is online in the one-to-one + When user "participant1" creates room "one-to-one room" (v4) + | roomType | 1 | + | invite | participant2 | + Given user "participant2" joins room "one-to-one room" with 200 (v4) + When user "participant1" sends message "Hi @all bye" to room "one-to-one room" with 201 + Then user "participant2" has the following notifications + | app | object_type | object_id | subject | + | spreed | chat | one-to-one room/Hi @all bye | participant1-displayname mentioned you in a private conversation | + + Scenario: At-all when recipient is offline in the one-to-one + When user "participant1" creates room "one-to-one room" (v4) + | roomType | 1 | + | invite | participant2 | + # Join and leave to clear the invite notification + Given user "participant2" joins room "one-to-one room" with 200 (v4) + Given user "participant2" leaves room "one-to-one room" with 200 (v4) + When user "participant1" sends message "Hi @all bye" to room "one-to-one room" with 201 + Then user "participant2" has the following notifications + | app | object_type | object_id | subject | + | spreed | chat | one-to-one room/Hi @all bye | participant1-displayname mentioned you in a private conversation | + + Scenario: At-all when recipient disabled notifications in the one-to-one + When user "participant1" creates room "one-to-one room" (v4) + | roomType | 1 | + | invite | participant2 | + # Join and leave to clear the invite notification + Given user "participant2" joins room "one-to-one room" with 200 (v4) + Given user "participant2" leaves room "one-to-one room" with 200 (v4) + And user "participant2" sets notifications to disabled for room "one-to-one room" (v4) + When user "participant1" sends message "Hi @all bye" to room "one-to-one room" with 201 + Then user "participant2" has the following notifications + | app | object_type | object_id | subject | + + Scenario: Normal message when recipient is online in the group room + When user "participant1" creates room "room" (v4) + | roomType | 2 | + | roomName | room | + And user "participant1" adds user "participant2" to room "room" with 200 (v4) + Given user "participant2" joins room "room" with 200 (v4) + When user "participant1" sends message "Message 1" to room "room" with 201 + Then user "participant2" has the following notifications + | app | object_type | object_id | subject | + + Scenario: Normal message when recipient is offline in the group room + When user "participant1" creates room "room" (v4) + | roomType | 2 | + | roomName | room | + And user "participant1" adds user "participant2" to room "room" with 200 (v4) + # Join and leave to clear the invite notification + Given user "participant2" joins room "room" with 200 (v4) + Given user "participant2" leaves room "room" with 200 (v4) + When user "participant1" sends message "Message 1" to room "room" with 201 + Then user "participant2" has the following notifications + | app | object_type | object_id | subject | + + Scenario: Normal message when recipient with all notifications in the group room + When user "participant1" creates room "room" (v4) + | roomType | 2 | + | roomName | room | + And user "participant1" adds user "participant2" to room "room" with 200 (v4) + # Join and leave to clear the invite notification + Given user "participant2" joins room "room" with 200 (v4) + Given user "participant2" leaves room "room" with 200 (v4) + And user "participant2" sets notifications to all for room "room" (v4) + When user "participant1" sends message "Message 1" to room "room" with 201 + Then user "participant2" has the following notifications + | app | object_type | object_id | subject | + | spreed | chat | room/Message 1 | participant1-displayname sent a message in conversation room | + + Scenario: Mention when recipient is online in the group room + When user "participant1" creates room "room" (v4) + | roomType | 2 | + | roomName | room | + And user "participant1" adds user "participant2" to room "room" with 200 (v4) + Given user "participant2" joins room "room" with 200 (v4) + When user "participant1" sends message "Hi @participant2 bye" to room "room" with 201 + Then user "participant2" has the following notifications + | app | object_type | object_id | subject | + | spreed | chat | room/Hi @participant2 bye | participant1-displayname mentioned you in conversation room | + + Scenario: Mention when recipient is offline in the group room + When user "participant1" creates room "room" (v4) + | roomType | 2 | + | roomName | room | + And user "participant1" adds user "participant2" to room "room" with 200 (v4) + # Join and leave to clear the invite notification + Given user "participant2" joins room "room" with 200 (v4) + Given user "participant2" leaves room "room" with 200 (v4) + When user "participant1" sends message "Hi @participant2 bye" to room "room" with 201 + Then user "participant2" has the following notifications + | app | object_type | object_id | subject | + | spreed | chat | room/Hi @participant2 bye | participant1-displayname mentioned you in conversation room | + + Scenario: Mention when recipient with disabled notifications in the group room + When user "participant1" creates room "room" (v4) + | roomType | 2 | + | roomName | room | + And user "participant1" adds user "participant2" to room "room" with 200 (v4) + # Join and leave to clear the invite notification + Given user "participant2" joins room "room" with 200 (v4) + Given user "participant2" leaves room "room" with 200 (v4) + And user "participant2" sets notifications to disabled for room "room" (v4) + When user "participant1" sends message "Hi @participant2 bye" to room "room" with 201 + Then user "participant2" has the following notifications + | app | object_type | object_id | subject | + + Scenario: At-all when recipient is online in the group room + When user "participant1" creates room "room" (v4) + | roomType | 2 | + | roomName | room | + And user "participant1" adds user "participant2" to room "room" with 200 (v4) + Given user "participant2" joins room "room" with 200 (v4) + When user "participant1" sends message "Hi @all bye" to room "room" with 201 + Then user "participant2" has the following notifications + | app | object_type | object_id | subject | + | spreed | chat | room/Hi @all bye | participant1-displayname mentioned you in conversation room | + + Scenario: At-all when recipient is offline in the group room + When user "participant1" creates room "room" (v4) + | roomType | 2 | + | roomName | room | + And user "participant1" adds user "participant2" to room "room" with 200 (v4) + # Join and leave to clear the invite notification + Given user "participant2" joins room "room" with 200 (v4) + Given user "participant2" leaves room "room" with 200 (v4) + When user "participant1" sends message "Hi @all bye" to room "room" with 201 + Then user "participant2" has the following notifications + | app | object_type | object_id | subject | + | spreed | chat | room/Hi @all bye | participant1-displayname mentioned you in conversation room | + + Scenario: At-all when recipient with disabled notifications in the group room + When user "participant1" creates room "room" (v4) + | roomType | 2 | + | roomName | room | + And user "participant1" adds user "participant2" to room "room" with 200 (v4) + # Join and leave to clear the invite notification + Given user "participant2" joins room "room" with 200 (v4) + Given user "participant2" leaves room "room" with 200 (v4) + And user "participant2" sets notifications to disabled for room "room" (v4) + When user "participant1" sends message "Hi @all bye" to room "room" with 201 + Then user "participant2" has the following notifications + | app | object_type | object_id | subject | |