From 3a8a6024a132f0caeb058f883293adb069799e28 Mon Sep 17 00:00:00 2001 From: Vitor Mattos Date: Wed, 25 Jan 2023 12:24:35 -0300 Subject: Stop recording after end call Signed-off-by: Vitor Mattos --- .../features/bootstrap/FeatureContext.php | 3 ++ .../integration/features/callapi/recording.feature | 34 ++++++++++++++++++++++ 2 files changed, 37 insertions(+) (limited to 'tests') diff --git a/tests/integration/features/bootstrap/FeatureContext.php b/tests/integration/features/bootstrap/FeatureContext.php index 91893ae3b..39d7a05ca 100644 --- a/tests/integration/features/bootstrap/FeatureContext.php +++ b/tests/integration/features/bootstrap/FeatureContext.php @@ -421,6 +421,9 @@ class FeatureContext implements Context, SnippetAcceptingContext { if (isset($expectedRoom['messageExpiration'])) { $data['messageExpiration'] = (int) $room['messageExpiration']; } + if (isset($expectedRoom['callRecording'])) { + $data['callRecording'] = (int) $room['callRecording']; + } if (isset($expectedRoom['participants'])) { throw new \Exception('participants key needs to be checked via participants endpoint'); } diff --git a/tests/integration/features/callapi/recording.feature b/tests/integration/features/callapi/recording.feature index 5b4919723..330529b9c 100644 --- a/tests/integration/features/callapi/recording.feature +++ b/tests/integration/features/callapi/recording.feature @@ -124,3 +124,37 @@ Feature: callapi/recording And user "participant1" has the following notifications | app | object_type | object_id | subject | | spreed | chat | room1 | Recording for the call in room1 was uploaded. | + + Scenario: Stop recording automatically when end the call + When the following "spreed" app config is set + | signaling_dev | yes | + And user "participant1" creates room "room1" (v4) + | roomType | 2 | + | roomName | room1 | + And user "participant1" joins room "room1" with 200 (v4) + And user "participant1" joins call "room1" with 200 (v4) + And user "participant1" starts "audio" recording in room "room1" with 200 (v1) + And user "participant1" is participant of the following unordered rooms (v4) + | type | name | callRecording | + | 2 | room1 | 2 | + Then user "participant1" ends call "room1" with 200 (v4) + And user "participant1" is participant of the following unordered rooms (v4) + | type | name | callRecording | + | 2 | room1 | 0 | + + Scenario: Stop recording automatically when the last participant go out + When the following "spreed" app config is set + | signaling_dev | yes | + And user "participant1" creates room "room1" (v4) + | roomType | 2 | + | roomName | room1 | + And user "participant1" joins room "room1" with 200 (v4) + And user "participant1" joins call "room1" with 200 (v4) + And user "participant1" starts "audio" recording in room "room1" with 200 (v1) + And user "participant1" is participant of the following unordered rooms (v4) + | type | name | callRecording | + | 2 | room1 | 2 | + Then user "participant1" leaves room "room1" with 200 (v4) + And user "participant1" is participant of the following unordered rooms (v4) + | type | name | callRecording | + | 2 | room1 | 0 | -- cgit v1.2.3 From 1f877eb892c4e1fe4c16e80ff3262fc07bb86567 Mon Sep 17 00:00:00 2001 From: Vitor Mattos Date: Thu, 26 Jan 2023 18:55:17 -0300 Subject: Check callRecording status in all tests https://github.com/nextcloud/spreed/pull/8602#discussion_r1086822459 Signed-off-by: Vitor Mattos --- .../integration/features/callapi/recording.feature | 45 ++++++++++++++++++++++ 1 file changed, 45 insertions(+) (limited to 'tests') diff --git a/tests/integration/features/callapi/recording.feature b/tests/integration/features/callapi/recording.feature index 330529b9c..abdad9af4 100644 --- a/tests/integration/features/callapi/recording.feature +++ b/tests/integration/features/callapi/recording.feature @@ -17,6 +17,9 @@ Feature: callapi/recording | room1 | users | participant1 | participant1-displayname | recording_started | | room1 | users | participant1 | participant1-displayname | call_started | | room1 | users | participant1 | participant1-displayname | conversation_created | + And user "participant1" is participant of the following unordered rooms (v4) + | type | name | callRecording | + | 2 | room1 | 1 | When user "participant1" stops recording in room "room1" with 200 (v1) Then user "participant1" sees the following system messages in room "room1" with 200 (v1) | room | actorType | actorId | actorDisplayName | systemMessage | @@ -24,6 +27,9 @@ Feature: callapi/recording | room1 | users | participant1 | participant1-displayname | recording_started | | room1 | users | participant1 | participant1-displayname | call_started | | room1 | users | participant1 | participant1-displayname | conversation_created | + And user "participant1" is participant of the following unordered rooms (v4) + | type | name | callRecording | + | 2 | room1 | 0 | Scenario: Start and stop audio recording When the following "spreed" app config is set @@ -39,6 +45,9 @@ Feature: callapi/recording | room1 | users | participant1 | participant1-displayname | audio_recording_started | | room1 | users | participant1 | participant1-displayname | call_started | | room1 | users | participant1 | participant1-displayname | conversation_created | + And user "participant1" is participant of the following unordered rooms (v4) + | type | name | callRecording | + | 2 | room1 | 2 | When user "participant1" stops recording in room "room1" with 200 (v1) Then user "participant1" sees the following system messages in room "room1" with 200 (v1) | room | actorType | actorId | actorDisplayName | systemMessage | @@ -46,6 +55,9 @@ Feature: callapi/recording | room1 | users | participant1 | participant1-displayname | audio_recording_started | | room1 | users | participant1 | participant1-displayname | call_started | | room1 | users | participant1 | participant1-displayname | conversation_created | + And user "participant1" is participant of the following unordered rooms (v4) + | type | name | callRecording | + | 2 | room1 | 0 | Scenario: Get error when start|stop recording and already did this Given the following "spreed" app config is set @@ -58,13 +70,25 @@ Feature: callapi/recording When user "participant1" starts "audio" recording in room "room1" with 200 (v1) Then user "participant1" starts "audio" recording in room "room1" with 400 (v1) And the response error matches with "recording" + And user "participant1" is participant of the following unordered rooms (v4) + | type | name | callRecording | + | 2 | room1 | 2 | When user "participant1" stops recording in room "room1" with 200 (v1) Then user "participant1" stops recording in room "room1" with 200 (v1) + And user "participant1" is participant of the following unordered rooms (v4) + | type | name | callRecording | + | 2 | room1 | 0 | When user "participant1" starts "video" recording in room "room1" with 200 (v1) Then user "participant1" starts "video" recording in room "room1" with 400 (v1) And the response error matches with "recording" + And user "participant1" is participant of the following unordered rooms (v4) + | type | name | callRecording | + | 2 | room1 | 1 | When user "participant1" stops recording in room "room1" with 200 (v1) Then user "participant1" stops recording in room "room1" with 200 (v1) + And user "participant1" is participant of the following unordered rooms (v4) + | type | name | callRecording | + | 2 | room1 | 0 | Scenario: Get error when try to start recording with invalid status When the following "spreed" app config is set @@ -76,6 +100,9 @@ Feature: callapi/recording And user "participant1" joins call "room1" with 200 (v4) Then user "participant1" starts "invalid" recording in room "room1" with 400 (v1) And the response error matches with "status" + And user "participant1" is participant of the following unordered rooms (v4) + | type | name | callRecording | + | 2 | room1 | 0 | Scenario: Manager try without success to start recording when signaling is internal When the following "spreed" app config is set @@ -87,8 +114,14 @@ Feature: callapi/recording And user "participant1" joins call "room1" with 200 (v4) Then user "participant1" starts "video" recording in room "room1" with 400 (v1) And the response error matches with "config" + And user "participant1" is participant of the following unordered rooms (v4) + | type | name | callRecording | + | 2 | room1 | 0 | And user "participant1" starts "audio" recording in room "room1" with 400 (v1) And the response error matches with "config" + And user "participant1" is participant of the following unordered rooms (v4) + | type | name | callRecording | + | 2 | room1 | 0 | Scenario: Get error when non moderator/owner try to start recording Given the following "spreed" app config is set @@ -103,6 +136,9 @@ Feature: callapi/recording And user "participant2" joins call "room1" with 200 (v4) Then user "participant2" starts "video" recording in room "room1" with 403 (v1) And user "participant2" starts "audio" recording in room "room1" with 403 (v1) + And user "participant1" is participant of the following unordered rooms (v4) + | type | name | callRecording | + | 2 | room1 | 0 | Scenario: Get error when try to start recording and no call started Given the following "spreed" app config is set @@ -112,8 +148,14 @@ Feature: callapi/recording | roomName | room1 | Then user "participant1" starts "video" recording in room "room1" with 400 (v1) And the response error matches with "call" + And user "participant1" is participant of the following unordered rooms (v4) + | type | name | callRecording | + | 2 | room1 | 0 | Then user "participant1" starts "audio" recording in room "room1" with 400 (v1) And the response error matches with "call" + And user "participant1" is participant of the following unordered rooms (v4) + | type | name | callRecording | + | 2 | room1 | 0 | Scenario: Store recording Given user "participant1" creates room "room1" (v4) @@ -124,6 +166,9 @@ Feature: callapi/recording And user "participant1" has the following notifications | app | object_type | object_id | subject | | spreed | chat | room1 | Recording for the call in room1 was uploaded. | + And user "participant1" is participant of the following unordered rooms (v4) + | type | name | callRecording | + | 2 | room1 | 0 | Scenario: Stop recording automatically when end the call When the following "spreed" app config is set -- cgit v1.2.3