You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

83 lines
5.2 KiB

  1. Feature: chat/one-to-one
  2. Background:
  3. Given user "participant1" exists
  4. Given user "participant2" exists
  5. Given user "participant3" exists
  6. Scenario: owner can send and receive chat messages to and from one-to-one room
  7. Given user "participant1" creates room "one-to-one room" (v4)
  8. | roomType | 1 |
  9. | invite | participant2 |
  10. When user "participant1" sends message "Message 1" to room "one-to-one room" with 201
  11. Then user "participant1" sees the following messages in room "one-to-one room" with 200
  12. | room | actorType | actorId | actorDisplayName | message | messageParameters |
  13. | one-to-one room | users | participant1 | participant1-displayname | Message 1 | [] |
  14. Scenario: invited user can send and receive chat messages to and from one-to-one room
  15. Given user "participant1" creates room "one-to-one room" (v4)
  16. | roomType | 1 |
  17. | invite | participant2 |
  18. When user "participant2" sends message "Message 1" to room "one-to-one room" with 201
  19. Then user "participant2" sees the following messages in room "one-to-one room" with 200
  20. | room | actorType | actorId | actorDisplayName | message | messageParameters |
  21. | one-to-one room | users | participant2 | participant2-displayname | Message 1 | [] |
  22. Scenario: not invited user can not send nor receive chat messages to nor from one-to-one room
  23. Given user "participant1" creates room "one-to-one room" (v4)
  24. | roomType | 1 |
  25. | invite | participant2 |
  26. When user "participant3" sends message "Message 1" to room "one-to-one room" with 404
  27. And user "participant1" sends message "Message 2" to room "one-to-one room" with 201
  28. Then user "participant3" sees the following messages in room "one-to-one room" with 404
  29. Scenario: guest can not send nor receive chat messages to nor from one-to-one room
  30. Given user "participant1" creates room "one-to-one room" (v4)
  31. | roomType | 1 |
  32. | invite | participant2 |
  33. And user "guest" joins call "one-to-one room" with 404 (v4)
  34. When user "guest" sends message "Message 1" to room "one-to-one room" with 404
  35. And user "participant1" sends message "Message 2" to room "one-to-one room" with 201
  36. Then user "guest" sees the following messages in room "one-to-one room" with 404
  37. Scenario: everyone in a one-to-one room can receive messages from everyone in that room
  38. Given user "participant1" creates room "one-to-one room" (v4)
  39. | roomType | 1 |
  40. | invite | participant2 |
  41. When user "participant1" sends message "Message 1" to room "one-to-one room" with 201
  42. And user "participant2" sends message "Message 2" to room "one-to-one room" with 201
  43. Then user "participant1" sees the following messages in room "one-to-one room" with 200
  44. | room | actorType | actorId | actorDisplayName | message | messageParameters |
  45. | one-to-one room | users | participant2 | participant2-displayname | Message 2 | [] |
  46. | one-to-one room | users | participant1 | participant1-displayname | Message 1 | [] |
  47. And user "participant2" sees the following messages in room "one-to-one room" with 200
  48. | room | actorType | actorId | actorDisplayName | message | messageParameters |
  49. | one-to-one room | users | participant2 | participant2-displayname | Message 2 | [] |
  50. | one-to-one room | users | participant1 | participant1-displayname | Message 1 | [] |
  51. Scenario: Sending a message into a one-to-one chat re-adds the participants
  52. Given user "participant1" creates room "one-to-one room" (v4)
  53. | roomType | 1 |
  54. | invite | participant2 |
  55. And user "participant1" is participant of room "one-to-one room" (v4)
  56. And user "participant2" is participant of room "one-to-one room" (v4)
  57. When user "participant1" removes themselves from room "one-to-one room" with 200 (v4)
  58. Then user "participant1" is not participant of room "one-to-one room" (v4)
  59. When user "participant2" sends message "Message" to room "one-to-one room" with 201
  60. Then user "participant1" is participant of room "one-to-one room" (v4)
  61. Then user "participant1" sees the following messages in room "one-to-one room" with 200
  62. | room | actorType | actorId | actorDisplayName | message | messageParameters |
  63. | one-to-one room | users | participant2 | participant2-displayname | Message | [] |
  64. Scenario: Return user status when get single conversation
  65. Given user "participant1" creates room "one-to-one room" (v4)
  66. | roomType | 1 |
  67. | invite | participant2 |
  68. When user "participant2" set status to "online" with 200 (v1)
  69. Then user "participant1" gets room "one-to-one room" with 200 (v4)
  70. | status | online |
  71. When user "participant2" set status to "offline" with 200 (v1)
  72. Then user "participant1" gets room "one-to-one room" with 200 (v4)
  73. | status | offline |
  74. Then user "participant2" set status to "away" with 200 (v1)
  75. Then user "participant1" gets room "one-to-one room" with 200 (v4)
  76. | status | away |