mirror of https://github.com/OpenVidu/openvidu.git
openvidu-test-e2e: Chrome initialization fix
parent
6145a49423
commit
b3eb140150
|
@ -176,7 +176,7 @@ public class OpenViduTestAppE2eTest {
|
|||
|
||||
switch (browser) {
|
||||
case "chrome":
|
||||
this.user = new ChromeUser("TestUser", 50);
|
||||
this.user = new ChromeUser("TestUser", 50, false);
|
||||
break;
|
||||
case "firefox":
|
||||
this.user = new FirefoxUser("TestUser", 50);
|
||||
|
@ -191,10 +191,10 @@ public class OpenViduTestAppE2eTest {
|
|||
this.user = new ChromeUser("TestUser", 50, "OpenVidu TestApp", false);
|
||||
break;
|
||||
case "chromeAsRoot":
|
||||
this.user = new ChromeUser("TestUser", 50, "Entire screen", true);
|
||||
this.user = new ChromeUser("TestUser", 50, true);
|
||||
break;
|
||||
default:
|
||||
this.user = new ChromeUser("TestUser", 50);
|
||||
this.user = new ChromeUser("TestUser", 50, false);
|
||||
}
|
||||
|
||||
user.getDriver().get(APP_URL);
|
||||
|
|
|
@ -30,8 +30,8 @@ import org.openqa.selenium.remote.RemoteWebDriver;
|
|||
|
||||
public class ChromeUser extends BrowserUser {
|
||||
|
||||
public ChromeUser(String userName, int timeOfWaitInSeconds) {
|
||||
this(userName, timeOfWaitInSeconds, generateDefaultScreenChromeOptions());
|
||||
public ChromeUser(String userName, int timeOfWaitInSeconds, boolean runningAsRoot) {
|
||||
this(userName, timeOfWaitInSeconds, generateDefaultScreenChromeOptions(runningAsRoot));
|
||||
}
|
||||
|
||||
public ChromeUser(String userName, int timeOfWaitInSeconds, String screenToCapture, boolean runningAsRoot) {
|
||||
|
@ -68,7 +68,7 @@ public class ChromeUser extends BrowserUser {
|
|||
this.configureDriver();
|
||||
}
|
||||
|
||||
private static ChromeOptions generateDefaultScreenChromeOptions() {
|
||||
private static ChromeOptions generateDefaultScreenChromeOptions(boolean runningAsRoot) {
|
||||
ChromeOptions options = new ChromeOptions();
|
||||
// This flag avoids to grant the user media
|
||||
options.addArguments("--use-fake-ui-for-media-stream");
|
||||
|
@ -77,6 +77,10 @@ public class ChromeUser extends BrowserUser {
|
|||
// This flag selects the entire screen as video source when screen sharing
|
||||
options.addArguments("--auto-select-desktop-capture-source=Entire screen");
|
||||
|
||||
if (runningAsRoot) {
|
||||
options.addArguments("--no-sandbox");
|
||||
}
|
||||
|
||||
return options;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue