Add integration tests for preventing access to some APIs in the lobby

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
This commit is contained in:
Daniel Calviño Sánchez 2019-08-26 19:25:44 +02:00
Родитель 6b6f42dde3
Коммит ea48d5ade2
1 изменённых файлов: 139 добавлений и 0 удалений

Просмотреть файл

@ -68,3 +68,142 @@ Feature: conversation/lobby
| roomName | room |
When user "participant2" sets lobby state for room "room" to "moderators only" with 404
And user "participant2" sets lobby state for room "room" to "all participants" with 404
Scenario: participants can join the room when the lobby is active
Given user "participant1" creates room "room"
| roomType | 3 |
| roomName | room |
And user "participant1" adds "participant2" to room "room" with 200
And user "participant1" promotes "participant2" in room "room" with 200
And user "participant1" adds "participant3" to room "room" with 200
When user "participant1" sets lobby state for room "room" to "moderators only" with 200
Then user "participant1" joins room "room" with 200
And user "participant2" joins room "room" with 200
And user "participant3" joins room "room" with 200
And user "participant4" joins room "room" with 200
And user "guest" joins room "room" with 200
And user "participant1" promotes "guest" in room "room" with 200
And user "guest2" joins room "room" with 200
Scenario: participants can join a password protected room when the lobby is active
Given user "participant1" creates room "room"
| roomType | 3 |
| roomName | room |
And user "participant1" sets password "foobar" for room "room" with 200
And user "participant1" adds "participant2" to room "room" with 200
And user "participant1" promotes "participant2" in room "room" with 200
And user "participant1" adds "participant3" to room "room" with 200
When user "participant1" sets lobby state for room "room" to "moderators only" with 200
Then user "participant1" joins room "room" with 200
And user "participant2" joins room "room" with 200
And user "participant3" joins room "room" with 200
And user "participant4" joins room "room" with 200
| password | foobar |
And user "guest" joins room "room" with 200
| password | foobar |
And user "participant1" promotes "guest" in room "room" with 200
And user "guest2" joins room "room" with 200
| password | foobar |
Scenario: lobby prevents chats for non moderators
Given user "participant1" creates room "room"
| roomType | 3 |
| roomName | room |
And user "participant1" adds "participant2" to room "room" with 200
And user "participant1" promotes "participant2" in room "room" with 200
And user "participant1" adds "participant3" to room "room" with 200
And user "participant1" joins room "room" with 200
And user "participant2" joins room "room" with 200
And user "participant3" joins room "room" with 200
And user "participant4" joins room "room" with 200
And user "guest" joins room "room" with 200
And user "participant1" promotes "guest" in room "room" with 200
And user "guest2" joins room "room" with 200
When user "participant1" sets lobby state for room "room" to "moderators only" with 200
Then user "participant1" sends message "Message 1" to room "room" with 201
And user "participant2" sends message "Message 2" to room "room" with 201
And user "participant3" sends message "Message 3" to room "room" with 403
And user "participant4" sends message "Message 4" to room "room" with 403
And user "guest" sends message "Message 5" to room "room" with 201
And user "guest2" sends message "Message 6" to room "room" with 403
And user "participant1" sees the following messages in room "room" with 200
| room | actorType | actorId | actorDisplayName | message | messageParameters |
| room | guests | guest | | Message 5 | [] |
| room | users | participant2 | participant2-displayname | Message 2 | [] |
| room | users | participant1 | participant1-displayname | Message 1 | [] |
And user "participant2" sees the following messages in room "room" with 200
| room | actorType | actorId | actorDisplayName | message | messageParameters |
| room | guests | guest | | Message 5 | [] |
| room | users | participant2 | participant2-displayname | Message 2 | [] |
| room | users | participant1 | participant1-displayname | Message 1 | [] |
And user "participant3" sees the following messages in room "room" with 403
And user "participant4" sees the following messages in room "room" with 403
And user "guest" sees the following messages in room "room" with 200
| room | actorType | actorId | actorDisplayName | message | messageParameters |
| room | guests | guest | | Message 5 | [] |
| room | users | participant2 | participant2-displayname | Message 2 | [] |
| room | users | participant1 | participant1-displayname | Message 1 | [] |
And user "guest2" sees the following messages in room "room" with 403
Scenario: lobby prevents calls for non moderators
Given user "participant1" creates room "room"
| roomType | 3 |
| roomName | room |
And user "participant1" adds "participant2" to room "room" with 200
And user "participant1" promotes "participant2" in room "room" with 200
And user "participant1" adds "participant3" to room "room" with 200
And user "participant1" joins room "room" with 200
And user "participant2" joins room "room" with 200
And user "participant3" joins room "room" with 200
And user "participant4" joins room "room" with 200
And user "guest" joins room "room" with 200
And user "participant1" promotes "guest" in room "room" with 200
And user "guest2" joins room "room" with 200
When user "participant1" sets lobby state for room "room" to "moderators only" with 200
Then user "participant1" joins call "room" with 200
And user "participant2" joins call "room" with 200
And user "participant3" joins call "room" with 403
And user "participant4" joins call "room" with 403
And user "guest" joins call "room" with 200
And user "guest2" joins call "room" with 403
And user "participant1" sees 3 peers in call "room" with 200
And user "participant2" sees 3 peers in call "room" with 200
And user "participant3" sees 0 peers in call "room" with 403
And user "participant4" sees 0 peers in call "room" with 403
And user "guest" sees 3 peers in call "room" with 200
And user "guest2" sees 0 peers in call "room" with 403
And user "participant1" leaves call "room" with 200
And user "participant2" leaves call "room" with 200
And user "guest" leaves call "room" with 200
Scenario: lobby prevents some room actions for non moderators
Given user "participant1" creates room "room"
| roomType | 3 |
| roomName | room |
And user "participant1" adds "participant2" to room "room" with 200
And user "participant1" promotes "participant2" in room "room" with 200
And user "participant1" adds "participant3" to room "room" with 200
And user "participant1" joins room "room" with 200
And user "participant2" joins room "room" with 200
And user "participant3" joins room "room" with 200
And user "participant4" joins room "room" with 200
And user "guest" joins room "room" with 200
And user "participant1" promotes "guest" in room "room" with 200
And user "guest2" joins room "room" with 200
When user "participant1" sets lobby state for room "room" to "moderators only" with 200
Then user "participant1" leaves room "room" with 200
And user "participant2" leaves room "room" with 200
And user "participant3" leaves room "room" with 200
And user "participant4" leaves room "room" with 200
And user "guest" leaves room "room" with 200
And user "guest2" leaves room "room" with 200
And user "participant1" joins room "room" with 200
And user "participant2" joins room "room" with 200
And user "participant3" joins room "room" with 200
And user "participant4" joins room "room" with 200
And user "guest" joins room "room" with 200
And user "guest2" joins room "room" with 200
And user "participant2" removes themselves from room "room" with 200
And user "participant3" removes themselves from room "room" with 200