mirror of https://github.com/OpenVidu/openvidu.git
openvidu-test-e2e: improved quick start record test
parent
b9d28d11cd
commit
eb7fb81995
|
@ -1246,95 +1246,110 @@ public class OpenViduTestAppE2eTest {
|
||||||
|
|
||||||
log.info("Remote composed quick start record");
|
log.info("Remote composed quick start record");
|
||||||
|
|
||||||
final String sessionName = "COMPOSED_QUICK_START_RECORDED_SESSION";
|
CountDownLatch initLatch = new CountDownLatch(1);
|
||||||
|
io.openvidu.test.browsers.utils.CustomWebhook.main(new String[0], initLatch);
|
||||||
|
|
||||||
// 1. MANUAL mode and recording explicitly stopped
|
try {
|
||||||
|
|
||||||
user.getDriver().findElement(By.id("add-user-btn")).click();
|
if (!initLatch.await(30, TimeUnit.SECONDS)) {
|
||||||
user.getDriver().findElement(By.id("session-name-input-0")).clear();
|
Assert.fail("Timeout waiting for webhook springboot app to start");
|
||||||
user.getDriver().findElement(By.id("session-name-input-0")).sendKeys(sessionName);
|
CustomWebhook.shutDown();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
user.getDriver().findElement(By.id("session-settings-btn-0")).click();
|
final String sessionName = "COMPOSED_QUICK_START_RECORDED_SESSION";
|
||||||
Thread.sleep(1000);
|
|
||||||
user.getDriver().findElement(By.id("output-mode-select")).click();
|
|
||||||
Thread.sleep(500);
|
|
||||||
user.getDriver().findElement(By.id("option-COMPOSED_QUICK_START")).click();
|
|
||||||
Thread.sleep(500);
|
|
||||||
user.getDriver().findElement(By.id("save-btn")).click();
|
|
||||||
Thread.sleep(1000);
|
|
||||||
|
|
||||||
// Join the subscriber user to the session
|
// 1. MANUAL mode and recording explicitly stopped
|
||||||
user.getDriver().findElement(By.cssSelector("#openvidu-instance-0 .publish-checkbox")).click();
|
|
||||||
user.getDriver().findElement(By.className("join-btn")).click();
|
|
||||||
user.getEventManager().waitUntilEventReaches("connectionCreated", 1);
|
|
||||||
|
|
||||||
// Check the recording container is up and running but no ongoing recordings
|
user.getDriver().findElement(By.id("add-user-btn")).click();
|
||||||
checkDockerContainerRunning(RECORDING_IMAGE, 1);
|
user.getDriver().findElement(By.id("session-name-input-0")).clear();
|
||||||
Assert.assertEquals("Wrong number of recordings found", 0, OV.listRecordings().size());
|
user.getDriver().findElement(By.id("session-name-input-0")).sendKeys(sessionName);
|
||||||
|
|
||||||
// Join the publisher user to the session
|
user.getDriver().findElement(By.id("session-settings-btn-0")).click();
|
||||||
user.getDriver().findElement(By.id("add-user-btn")).click();
|
Thread.sleep(1000);
|
||||||
user.getDriver().findElement(By.id("session-name-input-1")).clear();
|
user.getDriver().findElement(By.id("output-mode-select")).click();
|
||||||
user.getDriver().findElement(By.id("session-name-input-1")).sendKeys(sessionName);
|
Thread.sleep(500);
|
||||||
user.getDriver().findElement(By.cssSelector("#openvidu-instance-1 .join-btn")).click();
|
user.getDriver().findElement(By.id("option-COMPOSED_QUICK_START")).click();
|
||||||
|
Thread.sleep(500);
|
||||||
|
user.getDriver().findElement(By.id("save-btn")).click();
|
||||||
|
Thread.sleep(1000);
|
||||||
|
|
||||||
user.getEventManager().waitUntilEventReaches("connectionCreated", 4);
|
// Join the subscriber user to the session
|
||||||
user.getEventManager().waitUntilEventReaches("accessAllowed", 1);
|
user.getDriver().findElement(By.cssSelector("#openvidu-instance-0 .publish-checkbox")).click();
|
||||||
user.getEventManager().waitUntilEventReaches("streamCreated", 2);
|
user.getDriver().findElement(By.className("join-btn")).click();
|
||||||
user.getEventManager().waitUntilEventReaches("streamPlaying", 2);
|
user.getEventManager().waitUntilEventReaches("connectionCreated", 1);
|
||||||
|
|
||||||
// Start recording
|
// Check the recording container is up and running but no ongoing recordings
|
||||||
OV.fetch();
|
checkDockerContainerRunning(RECORDING_IMAGE, 1);
|
||||||
String recId = OV.startRecording(sessionName).getId();
|
Assert.assertEquals("Wrong number of recordings found", 0, OV.listRecordings().size());
|
||||||
user.getEventManager().waitUntilEventReaches("recordingStarted", 2);
|
|
||||||
checkDockerContainerRunning("openvidu/openvidu-recording", 1);
|
|
||||||
|
|
||||||
Thread.sleep(1000);
|
// Join the publisher user to the session
|
||||||
|
user.getDriver().findElement(By.id("add-user-btn")).click();
|
||||||
|
user.getDriver().findElement(By.id("session-name-input-1")).clear();
|
||||||
|
user.getDriver().findElement(By.id("session-name-input-1")).sendKeys(sessionName);
|
||||||
|
user.getDriver().findElement(By.cssSelector("#openvidu-instance-1 .join-btn")).click();
|
||||||
|
|
||||||
Assert.assertEquals("Wrong number of recordings found", 1, OV.listRecordings().size());
|
user.getEventManager().waitUntilEventReaches("connectionCreated", 4);
|
||||||
OV.stopRecording(recId);
|
user.getEventManager().waitUntilEventReaches("accessAllowed", 1);
|
||||||
user.getEventManager().waitUntilEventReaches("recordingStopped", 2);
|
user.getEventManager().waitUntilEventReaches("streamCreated", 2);
|
||||||
checkDockerContainerRunning("openvidu/openvidu-recording", 1);
|
user.getEventManager().waitUntilEventReaches("streamPlaying", 2);
|
||||||
|
|
||||||
Assert.assertEquals("Wrong number of sessions", 1, OV.getActiveSessions().size());
|
// Start recording
|
||||||
Session session = OV.getActiveSessions().get(0);
|
OV.fetch();
|
||||||
session.close();
|
String recId = OV.startRecording(sessionName).getId();
|
||||||
|
user.getEventManager().waitUntilEventReaches("recordingStarted", 2);
|
||||||
|
CustomWebhook.waitForEvent("recordingStatusChanged", 1);
|
||||||
|
checkDockerContainerRunning("openvidu/openvidu-recording", 1);
|
||||||
|
|
||||||
checkDockerContainerRunning("openvidu/openvidu-recording", 0);
|
Thread.sleep(2000);
|
||||||
|
|
||||||
// 2. ALWAYS mode and recording stopped by session close up
|
Assert.assertEquals("Wrong number of recordings found", 1, OV.listRecordings().size());
|
||||||
user.getDriver().findElement(By.id("remove-all-users-btn")).click();
|
OV.stopRecording(recId);
|
||||||
user.getDriver().findElement(By.id("add-user-btn")).click();
|
user.getEventManager().waitUntilEventReaches("recordingStopped", 2);
|
||||||
user.getDriver().findElement(By.id("session-name-input-0")).clear();
|
checkDockerContainerRunning("openvidu/openvidu-recording", 1);
|
||||||
user.getDriver().findElement(By.id("session-name-input-0")).sendKeys(sessionName);
|
|
||||||
|
|
||||||
user.getDriver().findElement(By.id("session-settings-btn-0")).click();
|
Assert.assertEquals("Wrong number of sessions", 1, OV.getActiveSessions().size());
|
||||||
Thread.sleep(1000);
|
Session session = OV.getActiveSessions().get(0);
|
||||||
user.getDriver().findElement(By.id("recording-mode-select")).click();
|
session.close();
|
||||||
Thread.sleep(500);
|
|
||||||
user.getDriver().findElement(By.id("option-ALWAYS")).click();
|
|
||||||
Thread.sleep(500);
|
|
||||||
user.getDriver().findElement(By.id("output-mode-select")).click();
|
|
||||||
Thread.sleep(500);
|
|
||||||
user.getDriver().findElement(By.id("option-COMPOSED_QUICK_START")).click();
|
|
||||||
Thread.sleep(500);
|
|
||||||
user.getDriver().findElement(By.id("save-btn")).click();
|
|
||||||
Thread.sleep(1000);
|
|
||||||
|
|
||||||
user.getDriver().findElement(By.className("join-btn")).click();
|
checkDockerContainerRunning("openvidu/openvidu-recording", 0);
|
||||||
user.getEventManager().waitUntilEventReaches("connectionCreated", 5);
|
|
||||||
user.getEventManager().waitUntilEventReaches("accessAllowed", 2);
|
|
||||||
user.getEventManager().waitUntilEventReaches("streamCreated", 3);
|
|
||||||
user.getEventManager().waitUntilEventReaches("streamPlaying", 3);
|
|
||||||
user.getEventManager().waitUntilEventReaches("recordingStarted", 3);
|
|
||||||
|
|
||||||
checkDockerContainerRunning("openvidu/openvidu-recording", 1);
|
// 2. ALWAYS mode and recording stopped by session close up
|
||||||
|
user.getDriver().findElement(By.id("remove-all-users-btn")).click();
|
||||||
|
user.getDriver().findElement(By.id("add-user-btn")).click();
|
||||||
|
user.getDriver().findElement(By.id("session-name-input-0")).clear();
|
||||||
|
user.getDriver().findElement(By.id("session-name-input-0")).sendKeys(sessionName);
|
||||||
|
|
||||||
OV.fetch();
|
user.getDriver().findElement(By.id("session-settings-btn-0")).click();
|
||||||
session = OV.getActiveSessions().get(0);
|
Thread.sleep(1000);
|
||||||
session.close();
|
user.getDriver().findElement(By.id("recording-mode-select")).click();
|
||||||
|
Thread.sleep(500);
|
||||||
|
user.getDriver().findElement(By.id("option-ALWAYS")).click();
|
||||||
|
Thread.sleep(500);
|
||||||
|
user.getDriver().findElement(By.id("output-mode-select")).click();
|
||||||
|
Thread.sleep(500);
|
||||||
|
user.getDriver().findElement(By.id("option-COMPOSED_QUICK_START")).click();
|
||||||
|
Thread.sleep(500);
|
||||||
|
user.getDriver().findElement(By.id("save-btn")).click();
|
||||||
|
Thread.sleep(1000);
|
||||||
|
|
||||||
checkDockerContainerRunning("openvidu/openvidu-recording", 0);
|
user.getDriver().findElement(By.className("join-btn")).click();
|
||||||
|
user.getEventManager().waitUntilEventReaches("connectionCreated", 5);
|
||||||
|
user.getEventManager().waitUntilEventReaches("accessAllowed", 2);
|
||||||
|
user.getEventManager().waitUntilEventReaches("streamCreated", 3);
|
||||||
|
user.getEventManager().waitUntilEventReaches("streamPlaying", 3);
|
||||||
|
user.getEventManager().waitUntilEventReaches("recordingStarted", 3);
|
||||||
|
CustomWebhook.waitForEvent("recordingStatusChanged", 1);
|
||||||
|
checkDockerContainerRunning("openvidu/openvidu-recording", 1);
|
||||||
|
|
||||||
|
OV.fetch();
|
||||||
|
session = OV.getActiveSessions().get(0);
|
||||||
|
session.close();
|
||||||
|
|
||||||
|
checkDockerContainerRunning("openvidu/openvidu-recording", 0);
|
||||||
|
} finally {
|
||||||
|
CustomWebhook.shutDown();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
Loading…
Reference in New Issue