diff --git a/openvidu-test-e2e/src/test/java/io/openvidu/test/e2e/OpenViduProTestAppE2eTest.java b/openvidu-test-e2e/src/test/java/io/openvidu/test/e2e/OpenViduProTestAppE2eTest.java index 6e17c694..36d3f1a5 100644 --- a/openvidu-test-e2e/src/test/java/io/openvidu/test/e2e/OpenViduProTestAppE2eTest.java +++ b/openvidu-test-e2e/src/test/java/io/openvidu/test/e2e/OpenViduProTestAppE2eTest.java @@ -314,7 +314,7 @@ public class OpenViduProTestAppE2eTest extends AbstractOpenViduTestappE2eTest { CustomWebhook.waitForEvent("participantLeft", 2).get("reason").getAsString()); for (int i = 0; i < 2; i++) { Assertions.assertEquals("recordingStoppedByServer", // reason is always "recordingStoppedByServer" in v2Compatibility - CustomWebhook.waitForEvent("recordingStatusChanged", 2).get("reason").getAsString()); + CustomWebhook.waitForEvent("recordingStatusChanged", 60).get("reason").getAsString()); } // broadcastStopped does not exist in the official OpenVidu docs and v2Compatibility does not trigger it // Assertions.assertEquals("lastParticipantLeft", @@ -342,6 +342,7 @@ public class OpenViduProTestAppE2eTest extends AbstractOpenViduTestappE2eTest { .filter(con -> con.getAsJsonObject().get("role").getAsString().equals("PUBLISHER")).findFirst() .get().getAsJsonObject().get("publishers").getAsJsonArray().get(0).getAsJsonObject() .get("streamId").getAsString(); + restClient.rest(HttpMethod.DELETE, "/openvidu/api/sessions/TestSession/stream/" + streamId, HttpURLConnection.HTTP_NO_CONTENT); // webrtcConnectionDestroyed event is only triggered when participant left in v2Compatibility @@ -380,7 +381,7 @@ public class OpenViduProTestAppE2eTest extends AbstractOpenViduTestappE2eTest { // webrtcConnectionDestroyed event is only triggered when participant left in v2Compatibility // for (int i = 0; i < 3; i++) { Assertions.assertEquals("unpublish", // reason is always "unpublish" in v2Compatibility - CustomWebhook.waitForEvent("webrtcConnectionDestroyed", 2).get("reason").getAsString()); + CustomWebhook.waitForEvent("webrtcConnectionDestroyed", 60).get("reason").getAsString()); // } Assertions.assertEquals("disconnect", // reason is always "disconnect" in v2Compatibility CustomWebhook.waitForEvent("participantLeft", 2).get("reason").getAsString()); @@ -3365,7 +3366,7 @@ public class OpenViduProTestAppE2eTest extends AbstractOpenViduTestappE2eTest { commandLine.executeCommand("docker cp broadcast-nginx:/tmp " + broadcastRecordingPath, 3); // Analyze most recent file (there can be more than one in the path) File[] files = new File(broadcastRecordingPath + "/tmp").listFiles(); - if(files == null || files.length == 0) { + if (files == null || files.length == 0) { log.info("RTMP screenshot could not be generated yet. Trying again"); Thread.sleep(1000); continue; @@ -3385,8 +3386,9 @@ public class OpenViduProTestAppE2eTest extends AbstractOpenViduTestappE2eTest { File screenshot = new File(broadcastRecordingPath + "/tmp/rtmp-screenshot.jpg"); if (screenshot.exists() && screenshot.isFile() && screenshot.length() > 0 && screenshot.canRead()) { // The check logic is not working properly - // Assertions.assertTrue(this.recordingUtils.thumbnailIsFine(screenshot, colorCheckFunction), - // "RTMP screenshot " + screenshot.getAbsolutePath() + " is not fine"); + // Assertions.assertTrue(this.recordingUtils.thumbnailIsFine(screenshot, + // colorCheckFunction), + // "RTMP screenshot " + screenshot.getAbsolutePath() + " is not fine"); break; } log.info("RTMP screenshot could not be generated yet. Trying again"); diff --git a/openvidu-test-e2e/src/test/java/io/openvidu/test/e2e/OpenViduTestAppE2eTest.java b/openvidu-test-e2e/src/test/java/io/openvidu/test/e2e/OpenViduTestAppE2eTest.java index f567a5c4..85d9d439 100644 --- a/openvidu-test-e2e/src/test/java/io/openvidu/test/e2e/OpenViduTestAppE2eTest.java +++ b/openvidu-test-e2e/src/test/java/io/openvidu/test/e2e/OpenViduTestAppE2eTest.java @@ -1718,6 +1718,8 @@ public class OpenViduTestAppE2eTest extends AbstractOpenViduTestappE2eTest { @Test @DisplayName("Record cross-browser audio-only and video-only") void audioOnlyVideoOnlyRecordTest() throws Exception { + + Thread.sleep(4000); isRecordingTest = true; OpenViduTestappUser user = setupBrowserAndConnectToOpenViduTestapp("chromeAlternateScreenShare"); @@ -1909,7 +1911,9 @@ public class OpenViduTestAppE2eTest extends AbstractOpenViduTestappE2eTest { // Check audio-only INDIVIDUAL recording recPath = recordingsPath + SESSION_NAME + "~2/"; recording = new OpenVidu(OPENVIDU_URL, OPENVIDU_SECRET).getRecording(SESSION_NAME + "~2"); - this.recordingUtils.checkIndividualRecording(recPath, recording, 2, "opus",null, true); + // As the recording is audio only and there is only one participant publishing its audio + // The zip file only has 1 file (audio file) + this.recordingUtils.checkIndividualRecording(recPath, recording, 1, "opus",null, true); user.getDriver().findElement(By.id("close-dialog-btn")).click(); Thread.sleep(500); @@ -3822,7 +3826,7 @@ public class OpenViduTestAppE2eTest extends AbstractOpenViduTestappE2eTest { // server requires additional time after stopping a recording before it can be deleted, // causing the beforeEach logic to be bypassed. // To ensure stability, we add a delay and perform manual cleanup: - Thread.sleep(2000); + Thread.sleep(5000); this.closeAllSessions(OV); this.deleteAllRecordings(OV); CustomWebhook.clean(); @@ -3962,7 +3966,7 @@ public class OpenViduTestAppE2eTest extends AbstractOpenViduTestappE2eTest { // CustomWebhook.waitForEvent("webrtcConnectionDestroyed", 2); CustomWebhook.waitForEvent("participantLeft", 2); CustomWebhook.waitForEvent("participantLeft", 2); - event = CustomWebhook.waitForEvent("recordingStatusChanged", 2); + event = CustomWebhook.waitForEvent("recordingStatusChanged", 60); OV.fetch(); List recs = OV.listRecordings();