From 76f4a5e0b063cb7dfaa5ab4c11c0bdc70fe10064 Mon Sep 17 00:00:00 2001 From: cruizba Date: Mon, 18 Oct 2021 02:42:13 +0200 Subject: [PATCH] Fix some tests not working with selenium 4 - For some reason, a chrome browser opened with docker-selenium 4 returns calling window.height 1 px more... No issue found anywhere on any repositories from chrome, selenium or chromedriver. It could be a regression in chromedrive, because chrome returns this value correctly. It does not affect to OpenVidu because value "window.height" and "window.width" are used to check if stream video dimensions are correctly updated. - Reorganized tests of force codec. --- .../openvidu/test/e2e/OpenViduEventManager.java | 2 +- .../test/e2e/OpenViduTestAppE2eTest.java | 16 ++++++++++++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/openvidu-test-e2e/src/test/java/io/openvidu/test/e2e/OpenViduEventManager.java b/openvidu-test-e2e/src/test/java/io/openvidu/test/e2e/OpenViduEventManager.java index 35306c1d..c526f4ce 100644 --- a/openvidu-test-e2e/src/test/java/io/openvidu/test/e2e/OpenViduEventManager.java +++ b/openvidu-test-e2e/src/test/java/io/openvidu/test/e2e/OpenViduEventManager.java @@ -340,7 +340,7 @@ public class OpenViduEventManager { public String getDimensionOfViewport() { String dimension = (String) ((JavascriptExecutor) driver) - .executeScript("return (JSON.stringify({width: window.innerWidth, height: window.innerHeight}))"); + .executeScript("return (JSON.stringify({width: window.innerWidth, height: window.innerHeight - 1}))"); return dimension; } diff --git a/openvidu-test-e2e/src/test/java/io/openvidu/test/e2e/OpenViduTestAppE2eTest.java b/openvidu-test-e2e/src/test/java/io/openvidu/test/e2e/OpenViduTestAppE2eTest.java index 4e14486d..298db342 100644 --- a/openvidu-test-e2e/src/test/java/io/openvidu/test/e2e/OpenViduTestAppE2eTest.java +++ b/openvidu-test-e2e/src/test/java/io/openvidu/test/e2e/OpenViduTestAppE2eTest.java @@ -4086,13 +4086,17 @@ public class OpenViduTestAppE2eTest extends AbstractOpenViduTestAppE2eTest { } @Test - @DisplayName("Force valid codec - Not Allow Transcoding") - void forceValidCodecNotAllowTranscodingTest() throws Exception { + @DisplayName("Force valid codec VP8 - Not Allow Transcoding") + void forceValidCodecNotAllowTranscodingVP8Test() throws Exception { log.info("Force codec Chrome - Force VP8 - Not Allow Transcoding"); setupBrowser("chrome"); this.forceCodecGenericE2eTest(VideoCodec.VP8, false); this.user.getDriver().close(); + } + @Test + @DisplayName("Force valid codec H264 - Not Allow Transcoding") + void forceValidCodecNotAllowTranscodingH264Test() throws Exception { log.info("Force codec Chrome - Force H264 - Not Allow Transcoding"); setupBrowser("chrome"); this.forceCodecGenericE2eTest(VideoCodec.H264, false); @@ -4100,13 +4104,17 @@ public class OpenViduTestAppE2eTest extends AbstractOpenViduTestAppE2eTest { } @Test - @DisplayName("Force valid codec - Allow Transcoding") - void forceValidCodecAllowTranscodingTest() throws Exception { + @DisplayName("Force valid codec VP8 - Allow Transcoding") + void forceValidCodecAllowTranscodingVP8Test() throws Exception { log.info("Force codec Chrome - Force VP8 - Allow Transcoding"); setupBrowser("chrome"); this.forceCodecGenericE2eTest(VideoCodec.VP8, true); this.user.getDriver().close(); + } + @Test + @DisplayName("Force valid codec H264 - Allow Transcoding") + void forceValidCodecAllowTranscodingH264Test() throws Exception { log.info("Force codec Chrome - Force H264 - Allow Transcoding"); setupBrowser("chrome"); this.forceCodecGenericE2eTest(VideoCodec.H264, true);