mirror of https://github.com/OpenVidu/openvidu.git
openvidu-test-browsers: ignore alerts on browsers
parent
2551e131ad
commit
dfb9fcfa75
|
@ -25,6 +25,7 @@ import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
|
import org.openqa.selenium.UnexpectedAlertBehaviour;
|
||||||
import org.openqa.selenium.chrome.ChromeDriver;
|
import org.openqa.selenium.chrome.ChromeDriver;
|
||||||
import org.openqa.selenium.chrome.ChromeOptions;
|
import org.openqa.selenium.chrome.ChromeOptions;
|
||||||
import org.openqa.selenium.remote.RemoteWebDriver;
|
import org.openqa.selenium.remote.RemoteWebDriver;
|
||||||
|
@ -47,6 +48,7 @@ public class ChromeUser extends BrowserUser {
|
||||||
private ChromeUser(String userName, int timeOfWaitInSeconds, ChromeOptions options) {
|
private ChromeUser(String userName, int timeOfWaitInSeconds, ChromeOptions options) {
|
||||||
super(userName, timeOfWaitInSeconds);
|
super(userName, timeOfWaitInSeconds);
|
||||||
options.setAcceptInsecureCerts(true);
|
options.setAcceptInsecureCerts(true);
|
||||||
|
options.setUnhandledPromptBehaviour(UnexpectedAlertBehaviour.IGNORE);
|
||||||
|
|
||||||
options.addArguments("--disable-infobars");
|
options.addArguments("--disable-infobars");
|
||||||
|
|
||||||
|
|
|
@ -20,8 +20,10 @@ package io.openvidu.test.browsers;
|
||||||
import java.net.MalformedURLException;
|
import java.net.MalformedURLException;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
|
|
||||||
|
import org.openqa.selenium.UnexpectedAlertBehaviour;
|
||||||
import org.openqa.selenium.firefox.FirefoxDriver;
|
import org.openqa.selenium.firefox.FirefoxDriver;
|
||||||
import org.openqa.selenium.firefox.FirefoxProfile;
|
import org.openqa.selenium.firefox.FirefoxProfile;
|
||||||
|
import org.openqa.selenium.remote.CapabilityType;
|
||||||
import org.openqa.selenium.remote.DesiredCapabilities;
|
import org.openqa.selenium.remote.DesiredCapabilities;
|
||||||
import org.openqa.selenium.remote.RemoteWebDriver;
|
import org.openqa.selenium.remote.RemoteWebDriver;
|
||||||
|
|
||||||
|
@ -32,6 +34,7 @@ public class FirefoxUser extends BrowserUser {
|
||||||
|
|
||||||
DesiredCapabilities capabilities = DesiredCapabilities.firefox();
|
DesiredCapabilities capabilities = DesiredCapabilities.firefox();
|
||||||
capabilities.setAcceptInsecureCerts(true);
|
capabilities.setAcceptInsecureCerts(true);
|
||||||
|
capabilities.setCapability(CapabilityType.UNEXPECTED_ALERT_BEHAVIOUR, UnexpectedAlertBehaviour.IGNORE);
|
||||||
FirefoxProfile profile = new FirefoxProfile();
|
FirefoxProfile profile = new FirefoxProfile();
|
||||||
|
|
||||||
// This flag avoids granting the access to the camera
|
// This flag avoids granting the access to the camera
|
||||||
|
|
|
@ -4,8 +4,10 @@ import java.net.MalformedURLException;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
|
import org.openqa.selenium.UnexpectedAlertBehaviour;
|
||||||
import org.openqa.selenium.opera.OperaDriver;
|
import org.openqa.selenium.opera.OperaDriver;
|
||||||
import org.openqa.selenium.opera.OperaOptions;
|
import org.openqa.selenium.opera.OperaOptions;
|
||||||
|
import org.openqa.selenium.remote.CapabilityType;
|
||||||
import org.openqa.selenium.remote.DesiredCapabilities;
|
import org.openqa.selenium.remote.DesiredCapabilities;
|
||||||
import org.openqa.selenium.remote.RemoteWebDriver;
|
import org.openqa.selenium.remote.RemoteWebDriver;
|
||||||
|
|
||||||
|
@ -18,6 +20,7 @@ public class OperaUser extends BrowserUser {
|
||||||
options.setBinary("/usr/bin/opera");
|
options.setBinary("/usr/bin/opera");
|
||||||
DesiredCapabilities capabilities = DesiredCapabilities.operaBlink();
|
DesiredCapabilities capabilities = DesiredCapabilities.operaBlink();
|
||||||
capabilities.setAcceptInsecureCerts(true);
|
capabilities.setAcceptInsecureCerts(true);
|
||||||
|
capabilities.setCapability(CapabilityType.UNEXPECTED_ALERT_BEHAVIOUR, UnexpectedAlertBehaviour.IGNORE);
|
||||||
|
|
||||||
options.addArguments("--use-fake-ui-for-media-stream");
|
options.addArguments("--use-fake-ui-for-media-stream");
|
||||||
options.addArguments("--use-fake-device-for-media-stream");
|
options.addArguments("--use-fake-device-for-media-stream");
|
||||||
|
|
|
@ -57,24 +57,16 @@
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
<pluginManagement>
|
<plugins>
|
||||||
<plugins>
|
<plugin>
|
||||||
<plugin>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<artifactId>maven-surefire-plugin</artifactId>
|
||||||
<artifactId>maven-surefire-plugin</artifactId>
|
<version>${version.surefire.plugin}</version>
|
||||||
<version>${version.surefire.plugin}</version>
|
</plugin>
|
||||||
</plugin>
|
</plugins>
|
||||||
</plugins>
|
|
||||||
</pluginManagement>
|
|
||||||
</build>
|
</build>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
|
||||||
<groupId>org.junit.jupiter</groupId>
|
|
||||||
<artifactId>junit-jupiter-api</artifactId>
|
|
||||||
<version>${version.junit.jupiter}</version>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>io.github.bonigarcia</groupId>
|
<groupId>io.github.bonigarcia</groupId>
|
||||||
<artifactId>selenium-jupiter</artifactId>
|
<artifactId>selenium-jupiter</artifactId>
|
||||||
|
@ -88,7 +80,6 @@
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.seleniumhq.selenium</groupId>
|
<groupId>org.seleniumhq.selenium</groupId>
|
||||||
<artifactId>selenium-java</artifactId>
|
<artifactId>selenium-java</artifactId>
|
||||||
|
@ -127,7 +118,7 @@
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.junit.jupiter</groupId>
|
<groupId>org.junit.jupiter</groupId>
|
||||||
<artifactId>junit-jupiter-engine</artifactId>
|
<artifactId>junit-jupiter</artifactId>
|
||||||
<version>${version.junit.jupiter}</version>
|
<version>${version.junit.jupiter}</version>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
Loading…
Reference in New Issue