openvidu-test-e2e: check number of files in ZIP individual recordings

pull/203/head
pabloFuente 2019-02-05 15:09:41 +01:00
parent b4af36399a
commit 110508383d
1 changed files with 8 additions and 5 deletions

View File

@ -1213,7 +1213,7 @@ public class OpenViduTestAppE2eTest {
String recPath = recordingsPath + sessionName + "/"; String recPath = recordingsPath + sessionName + "/";
Recording recording = new OpenVidu(OPENVIDU_URL, OPENVIDU_SECRET).getRecording(sessionName); Recording recording = new OpenVidu(OPENVIDU_URL, OPENVIDU_SECRET).getRecording(sessionName);
this.checkIndividualRecording(recPath, recording, "opus", "vp8"); this.checkIndividualRecording(recPath, recording, 1, "opus", "vp8");
// Try to get the stopped recording // Try to get the stopped recording
user.getDriver().findElement(By.id("get-recording-btn")).click(); user.getDriver().findElement(By.id("get-recording-btn")).click();
@ -1447,12 +1447,12 @@ public class OpenViduTestAppE2eTest {
// Check video-only INDIVIDUAL recording // Check video-only INDIVIDUAL recording
recPath = recordingsPath + SESSION_NAME + "-2/"; recPath = recordingsPath + SESSION_NAME + "-2/";
recording = new OpenVidu(OPENVIDU_URL, OPENVIDU_SECRET).getRecording(SESSION_NAME + "-2"); recording = new OpenVidu(OPENVIDU_URL, OPENVIDU_SECRET).getRecording(SESSION_NAME + "-2");
this.checkIndividualRecording(recPath, recording, "opus", "vp8"); this.checkIndividualRecording(recPath, recording, 3, "opus", "vp8");
// Check audio-only INDIVIDUAL recording // Check audio-only INDIVIDUAL recording
recPath = recordingsPath + SESSION_NAME + "-3/"; recPath = recordingsPath + SESSION_NAME + "-3/";
recording = new OpenVidu(OPENVIDU_URL, OPENVIDU_SECRET).getRecording(SESSION_NAME + "-3"); recording = new OpenVidu(OPENVIDU_URL, OPENVIDU_SECRET).getRecording(SESSION_NAME + "-3");
this.checkIndividualRecording(recPath, recording, "opus", "vp8"); this.checkIndividualRecording(recPath, recording, 2, "opus", "vp8");
user.getDriver().findElement(By.id("close-dialog-btn")).click(); user.getDriver().findElement(By.id("close-dialog-btn")).click();
Thread.sleep(500); Thread.sleep(500);
@ -1896,8 +1896,8 @@ public class OpenViduTestAppE2eTest {
return isFine; return isFine;
} }
private void checkIndividualRecording(String recPath, Recording recording, String audioDecoder, private void checkIndividualRecording(String recPath, Recording recording, int numberOfVideoFiles,
String videoDecoder) { String audioDecoder, String videoDecoder) {
// Should be only 2 files: zip and metadata // Should be only 2 files: zip and metadata
File folder = new File(recPath); File folder = new File(recPath);
@ -1911,6 +1911,9 @@ public class OpenViduTestAppE2eTest {
List<File> unzippedWebmFiles = new Unzipper().unzipFile(recPath, recording.getName() + ".zip"); List<File> unzippedWebmFiles = new Unzipper().unzipFile(recPath, recording.getName() + ".zip");
log.info("Expected {} video files and ZIP file has {}", numberOfVideoFiles, unzippedWebmFiles.size());
Assert.assertEquals(numberOfVideoFiles, unzippedWebmFiles.size());
File jsonSyncFile = new File(recPath + recording.getName() + ".json"); File jsonSyncFile = new File(recPath + recording.getName() + ".json");
Assert.assertTrue(jsonSyncFile.exists() && jsonSyncFile.length() > 0); Assert.assertTrue(jsonSyncFile.exists() && jsonSyncFile.length() > 0);
JsonObject jsonSyncMetadata; JsonObject jsonSyncMetadata;