openvidu-test-e2e: fix publisher height check with new tab sharing infobat

pull/375/head
pabloFuente 2019-09-16 11:22:34 +02:00
parent d3b552e940
commit 743ea311a3
2 changed files with 7 additions and 4 deletions

View File

@ -51,6 +51,7 @@ public class ChromeUser extends BrowserUser {
options.setUnhandledPromptBehaviour(UnexpectedAlertBehaviour.IGNORE);
options.addArguments("--disable-infobars");
options.setExperimentalOption("excludeSwitches", new String[]{"enable-automation"});
Map<String, Object> prefs = new HashMap<String, Object>();
prefs.put("profile.default_content_setting_values.media_stream_mic", 1);

View File

@ -997,7 +997,7 @@ public class OpenViduTestAppE2eTest {
JSONObject obj = (JSONObject) new JSONParser().parse(widthAndHeight);
expectedWidthHeight[0] = (long) obj.get("width");
expectedWidthHeight[1] = (long) obj.get("height");
expectedWidthHeight[1] = (long) obj.get("height") + 49; // + 49 because of new "Sharing tab" infobar
System.out.println("New viewport dimension: " + obj.toJSONString());
@ -2124,8 +2124,9 @@ public class OpenViduTestAppE2eTest {
String widthAndHeight = user.getEventManager().getDimensionOfViewport();
JSONObject obj = (JSONObject) new JSONParser().parse(widthAndHeight);
Assert.assertEquals("{\"width\":" + (long) obj.get("width") + ",\"height\":" + ((long) obj.get("height")) + "}",
pub.getVideoDimensions());
Assert.assertEquals(
"{\"width\":" + (long) obj.get("width") + ",\"height\":" + (((long) obj.get("height")) + 49) + "}",
pub.getVideoDimensions()); // + 49 because of new "Sharing tab" infobar
Assert.assertEquals(new Integer(30), pub.getFrameRate());
Assert.assertEquals("SCREEN", pub.getTypeOfVideo());
Assert.assertTrue(pub.hasVideo());
@ -2587,7 +2588,8 @@ public class OpenViduTestAppE2eTest {
body = "{'session':'CUSTOM_SESSION_ID','to':['" + connectionId + "'],'type':'server2','data':'SERVER EVENT!'}";
restClient.rest(HttpMethod.POST, "/api/signal", body, HttpStatus.SC_OK);
user.getEventManager().waitUntilEventReaches("signal:server2", 1);
Assert.assertEquals("", 1, user.getDriver().findElements(By.xpath("//*[text()='server - signal:server2 - SERVER EVENT!']")).size());
Assert.assertEquals("", 1, user.getDriver()
.findElements(By.xpath("//*[text()='server - signal:server2 - SERVER EVENT!']")).size());
/** DELETE /api/sessions/<SESSION_ID>/connection/<CONNECTION_ID> **/
restClient.rest(HttpMethod.DELETE, "/api/sessions/NOT_EXISTS/connection/NOT_EXISTS", HttpStatus.SC_BAD_REQUEST);