mirror of https://github.com/OpenVidu/openvidu.git
openvidu-test-e2e: Chrome Android emulator test
parent
ca246d2d37
commit
a68e831d29
|
@ -481,6 +481,30 @@ public class OpenViduTestAppE2eTest {
|
|||
gracefullyLeaveParticipants(2);
|
||||
}
|
||||
|
||||
@Test
|
||||
@DisplayName("One2One Chrome Android")
|
||||
void oneToOneChromeAndroid() throws Exception {
|
||||
|
||||
setupBrowser("chromeAndroid");
|
||||
|
||||
log.info("One2One Chrome Android");
|
||||
|
||||
user.getDriver().findElement(By.id("auto-join-checkbox")).click();
|
||||
user.getDriver().findElement(By.id("one2one-btn")).click();
|
||||
|
||||
user.getEventManager().waitUntilEventReaches("connectionCreated", 4);
|
||||
user.getEventManager().waitUntilEventReaches("accessAllowed", 2);
|
||||
user.getEventManager().waitUntilEventReaches("streamCreated", 4);
|
||||
user.getEventManager().waitUntilEventReaches("streamPlaying", 4);
|
||||
|
||||
final int numberOfVideos = user.getDriver().findElements(By.tagName("video")).size();
|
||||
Assert.assertEquals("Expected 4 videos but found " + numberOfVideos, 4, numberOfVideos);
|
||||
Assert.assertTrue("Videos were expected to have audio and video tracks", user.getEventManager()
|
||||
.assertMediaTracks(user.getDriver().findElements(By.tagName("video")), true, true));
|
||||
|
||||
gracefullyLeaveParticipants(2);
|
||||
}
|
||||
|
||||
@Test
|
||||
@DisplayName("Cross-Browser test")
|
||||
void crossBrowserTest() throws Exception {
|
||||
|
|
|
@ -34,19 +34,18 @@ public class ChromeAndroidUser extends BrowserUser {
|
|||
super(userName, timeOfWaitInSeconds);
|
||||
|
||||
Map<String, String> mobileEmulation = new HashMap<>();
|
||||
mobileEmulation.put("deviceName", "Nexus 5");
|
||||
mobileEmulation.put("deviceName", "Pixel 2");
|
||||
|
||||
ChromeOptions options = new ChromeOptions();
|
||||
options.setExperimentalOption("mobileEmulation", mobileEmulation);
|
||||
ChromeOptions chromeOptions = new ChromeOptions();
|
||||
chromeOptions.setExperimentalOption("mobileEmulation", mobileEmulation);
|
||||
|
||||
DesiredCapabilities capabilities = DesiredCapabilities.chrome();
|
||||
capabilities.setAcceptInsecureCerts(true);
|
||||
|
||||
// This flag avoids to grant the user media
|
||||
options.addArguments("--use-fake-ui-for-media-stream");
|
||||
chromeOptions.addArguments("--use-fake-ui-for-media-stream");
|
||||
// This flag fakes user media with synthetic video
|
||||
options.addArguments("--use-fake-device-for-media-stream");
|
||||
capabilities.setCapability(ChromeOptions.CAPABILITY, options);
|
||||
chromeOptions.addArguments("--use-fake-device-for-media-stream");
|
||||
|
||||
String REMOTE_URL = System.getProperty("REMOTE_URL_CHROME");
|
||||
if (REMOTE_URL != null) {
|
||||
|
@ -58,7 +57,7 @@ public class ChromeAndroidUser extends BrowserUser {
|
|||
}
|
||||
} else {
|
||||
log.info("Using local web driver");
|
||||
this.driver = new ChromeDriver(capabilities);
|
||||
this.driver = new ChromeDriver(chromeOptions);
|
||||
}
|
||||
|
||||
this.driver.manage().timeouts().setScriptTimeout(this.timeOfWaitInSeconds, TimeUnit.SECONDS);
|
||||
|
|
Loading…
Reference in New Issue