From 528372e6f61f2e83792960eecc46a5b2280b3fbc Mon Sep 17 00:00:00 2001 From: pabloFuente Date: Thu, 1 Oct 2020 21:03:23 +0200 Subject: [PATCH] openvidu-test-e2e: customLayoutRecordTest parameterized with EXTERNAL_CUSTOM_LAYOUT_URL --- openvidu-test-e2e/jenkins/Jenkinsfile | 4 ++-- .../io/openvidu/test/e2e/OpenViduTestAppE2eTest.java | 9 ++++++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/openvidu-test-e2e/jenkins/Jenkinsfile b/openvidu-test-e2e/jenkins/Jenkinsfile index 055ee1d5..a8299ae0 100644 --- a/openvidu-test-e2e/jenkins/Jenkinsfile +++ b/openvidu-test-e2e/jenkins/Jenkinsfile @@ -10,7 +10,7 @@ node('container') { docker.image('selenium/standalone-firefox:latest').withRun('-p 6667:4444 --name firefox --shm-size=1g') { d -> def mycontainer = docker.image('openvidu/openvidu-test-e2e:$DISTRO') mycontainer.pull() - mycontainer.inside("--name e2e -p 4200:4200 -p 4443:4443 -u root -e MY_UID=0 -v /var/run/docker.sock:/var/run/docker.sock:rw -v /dev/shm:/dev/shm -v /opt/openvidu:/opt/openvidu --privileged") { + mycontainer.inside("--name e2e -p 4200:4200 -p 4443:4443 -p 5555:5555 -u root -e MY_UID=0 -v /var/run/docker.sock:/var/run/docker.sock:rw -v /dev/shm:/dev/shm -v /opt/openvidu:/opt/openvidu --privileged") { stage('Preparation') { sh 'rm -rf ~/.m2 || true' sh 'rm -rf openvidu || true' @@ -104,7 +104,7 @@ node('container') { } stage ('OpenVidu E2E tests') { try { - sh 'cd openvidu/openvidu-test-e2e && sudo mvn --batch-mode -DAPP_URL=https://172.17.0.1:4200/ -DOPENVIDU_URL=https://172.17.0.1:4443/ -DREMOTE_URL_CHROME=http://172.17.0.1:6666/wd/hub/ -DREMOTE_URL_FIREFOX=http://172.17.0.1:6667/wd/hub/ test' + sh 'cd openvidu/openvidu-test-e2e && sudo mvn --batch-mode -DAPP_URL=https://172.17.0.1:4200/ -DOPENVIDU_URL=https://172.17.0.1:4443/ -DREMOTE_URL_CHROME=http://172.17.0.1:6666/wd/hub/ -DREMOTE_URL_FIREFOX=http://172.17.0.1:6667/wd/hub/ -DEXTERNAL_CUSTOM_LAYOUT_URL=http://172.17.0.1:5555?sessionId=CUSTOM_LAYOUT_SESSION&secret=MY_SECRET test' } finally { junit 'openvidu/openvidu-test-e2e/**/target/surefire-reports/TEST-*.xml' 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 d2a2514c..d07ba5f5 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 @@ -123,6 +123,7 @@ public class OpenViduTestAppE2eTest { static String OPENVIDU_SECRET = "MY_SECRET"; static String OPENVIDU_URL = "https://localhost:4443/"; static String APP_URL = "http://localhost:4200/"; + static String EXTERNAL_CUSTOM_LAYOUT_URL = "http://localhost:5555?sessionId=CUSTOM_LAYOUT_SESSION&secret=MY_SECRET"; static Exception ex = null; private final Object lock = new Object(); @@ -157,6 +158,12 @@ public class OpenViduTestAppE2eTest { } log.info("Using URL {} to connect to openvidu-testapp", APP_URL); + String externalCustomLayoutUrl = System.getProperty("EXTERNAL_CUSTOM_LAYOUT_URL"); + if (externalCustomLayoutUrl != null) { + EXTERNAL_CUSTOM_LAYOUT_URL = externalCustomLayoutUrl; + } + log.info("Using URL {} to connect to external custom layout", EXTERNAL_CUSTOM_LAYOUT_URL); + String openviduUrl = System.getProperty("OPENVIDU_URL"); if (openviduUrl != null) { OPENVIDU_URL = openviduUrl; @@ -1833,7 +1840,7 @@ public class OpenViduTestAppE2eTest { Thread.sleep(1000); tokeInput = user.getDriver().findElement(By.id("default-custom-layout-input")); tokeInput.clear(); - tokeInput.sendKeys("http://localhost:5555?sessionId=CUSTOM_LAYOUT_SESSION&secret=MY_SECRET"); + tokeInput.sendKeys(EXTERNAL_CUSTOM_LAYOUT_URL); user.getDriver().findElement(By.id("save-btn")).click(); Thread.sleep(1000);