mirror of https://github.com/OpenVidu/openvidu.git
openvidu-test-e2e: only firefox test (one2one video+audio session)
parent
52c43c4d85
commit
da0974701d
|
@ -96,10 +96,18 @@ public class OpenViduTestAppE2eTest {
|
|||
log.info("Using secret {} to connect to openvidu-server", OPENVIDU_SECRET);
|
||||
}
|
||||
|
||||
@BeforeEach
|
||||
void setup() {
|
||||
void setupBrowser(String browser) {
|
||||
|
||||
this.user = new ChromeUser("TestUser", 100);
|
||||
switch (browser) {
|
||||
case "chrome":
|
||||
this.user = new ChromeUser("TestUser", 50);
|
||||
break;
|
||||
case "firefox":
|
||||
this.user = new FirefoxUser("TestUser", 50);
|
||||
break;
|
||||
default:
|
||||
this.user = new ChromeUser("TestUser", 50);
|
||||
}
|
||||
|
||||
user.getDriver().get(APP_URL);
|
||||
|
||||
|
@ -119,10 +127,46 @@ public class OpenViduTestAppE2eTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@DisplayName("One2One [Video + Audio]")
|
||||
void oneToOneVideoAudioSession() throws Exception {
|
||||
@DisplayName("One2One Chrome [Video + Audio]")
|
||||
void oneToOneVideoAudioSessionChrome() throws Exception {
|
||||
|
||||
log.info("One2One [Video + Audio]");
|
||||
setupBrowser("chrome");
|
||||
|
||||
log.info("One2One Chrome [Video + Audio]");
|
||||
|
||||
user.getDriver().findElement(By.id("auto-join-checkbox")).click();
|
||||
user.getDriver().findElement(By.id("one2one-btn")).click();
|
||||
|
||||
user.getEventManager().waitUntilNumberOfEvent("videoPlaying", 4);
|
||||
|
||||
try {
|
||||
System.out.println(getBase64Screenshot(user));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
Assert.assertTrue(user.getEventManager().assertMediaTracks(user.getDriver().findElements(By.tagName("video")),
|
||||
true, true));
|
||||
|
||||
user.getDriver().findElement(By.id("remove-user-btn")).click();
|
||||
|
||||
user.getEventManager().waitUntilNumberOfEvent("streamDestroyed", 1);
|
||||
user.getEventManager().waitUntilNumberOfEvent("sessionDisconnected", 1);
|
||||
|
||||
user.getDriver().findElement(By.id("remove-user-btn")).click();
|
||||
|
||||
user.getEventManager().waitUntilNumberOfEvent("sessionDisconnected", 2);
|
||||
|
||||
user.dispose();
|
||||
}
|
||||
|
||||
@Test
|
||||
@DisplayName("One2One Firefox [Video + Audio]")
|
||||
void oneToOneVideoAudioSessionFirefox() throws Exception {
|
||||
|
||||
setupBrowser("firefox");
|
||||
|
||||
log.info("One2One Firefox [Video + Audio]");
|
||||
|
||||
user.getDriver().findElement(By.id("auto-join-checkbox")).click();
|
||||
user.getDriver().findElement(By.id("one2one-btn")).click();
|
||||
|
@ -154,6 +198,8 @@ public class OpenViduTestAppE2eTest {
|
|||
@DisplayName("One2One [Audio]")
|
||||
void oneToOneAudioSession() throws Exception {
|
||||
|
||||
setupBrowser("chrome");
|
||||
|
||||
log.info("One2One [Audio]");
|
||||
|
||||
user.getDriver().findElement(By.id("one2one-btn")).click();
|
||||
|
@ -197,6 +243,8 @@ public class OpenViduTestAppE2eTest {
|
|||
@DisplayName("One2One [Video]")
|
||||
void oneToOneVideoSession() throws Exception {
|
||||
|
||||
setupBrowser("chrome");
|
||||
|
||||
log.info("One2One [Video]");
|
||||
|
||||
user.getDriver().findElement(By.id("one2one-btn")).click();
|
||||
|
@ -240,6 +288,8 @@ public class OpenViduTestAppE2eTest {
|
|||
@DisplayName("One2Many [Video + Audio]")
|
||||
void oneToManyVideoAudioSession() throws Exception {
|
||||
|
||||
setupBrowser("chrome");
|
||||
|
||||
log.info("One2Many [Video + Audio]");
|
||||
|
||||
user.getDriver().findElement(By.id("auto-join-checkbox")).click();
|
||||
|
@ -264,6 +314,8 @@ public class OpenViduTestAppE2eTest {
|
|||
@DisplayName("Unique user remote subscription [Video + Audio]")
|
||||
void oneRemoteSubscription() throws Exception {
|
||||
|
||||
setupBrowser("chrome");
|
||||
|
||||
log.info("Unique user remote subscription [Video + Audio]");
|
||||
|
||||
user.getDriver().findElement(By.id("add-user-btn")).click();
|
||||
|
@ -293,6 +345,8 @@ public class OpenViduTestAppE2eTest {
|
|||
@DisplayName("Unique user remote subscription [ScreenShare + Audio]")
|
||||
void oneRemoteSubscriptionScreen() throws Exception {
|
||||
|
||||
setupBrowser("chrome");
|
||||
|
||||
log.info("Unique user remote subscription [ScreenShare + Audio]");
|
||||
|
||||
user.getDriver().findElement(By.id("add-user-btn")).click();
|
||||
|
@ -323,6 +377,8 @@ public class OpenViduTestAppE2eTest {
|
|||
@DisplayName("Many2Many [Video + Audio]")
|
||||
void manyToManyVideoAudioSession() throws Exception {
|
||||
|
||||
setupBrowser("chrome");
|
||||
|
||||
log.info("Many2Many [Video + Audio]");
|
||||
|
||||
WebElement addUser = user.getDriver().findElement(By.id("add-user-btn"));
|
||||
|
@ -367,10 +423,11 @@ public class OpenViduTestAppE2eTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
|
||||
@DisplayName("Secure Test")
|
||||
void secureTest() throws Exception {
|
||||
|
||||
setupBrowser("chrome");
|
||||
|
||||
log.info("Secure Test");
|
||||
|
||||
WebElement addUser = user.getDriver().findElement(By.id("add-user-btn"));
|
||||
|
@ -435,10 +492,11 @@ public class OpenViduTestAppE2eTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
|
||||
@DisplayName("Cross-Browser test")
|
||||
void crossBrowserTest() throws Exception {
|
||||
|
||||
setupBrowser("chrome");
|
||||
|
||||
log.info("Cross-Browser test");
|
||||
|
||||
Thread.UncaughtExceptionHandler h = new Thread.UncaughtExceptionHandler() {
|
||||
|
|
Loading…
Reference in New Issue