com.codeborne.selenide.Browser Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of selenide-core Show documentation
Show all versions of selenide-core Show documentation
Selenide = concise API for Selenium WebDriver
package com.codeborne.selenide;
import javax.annotation.CheckReturnValue;
import javax.annotation.ParametersAreNonnullByDefault;
import static com.codeborne.selenide.Browsers.CHROME;
import static com.codeborne.selenide.Browsers.EDGE;
import static com.codeborne.selenide.Browsers.FIREFOX;
import static com.codeborne.selenide.Browsers.IE;
import static com.codeborne.selenide.Browsers.INTERNET_EXPLORER;
import static com.codeborne.selenide.Browsers.SAFARI;
@ParametersAreNonnullByDefault
public class Browser {
public final String name;
public final boolean headless;
public Browser(String name, boolean headless) {
this.name = name;
this.headless = headless;
}
@CheckReturnValue
public boolean isHeadless() {
return headless;
}
@CheckReturnValue
public boolean isChrome() {
return CHROME.equalsIgnoreCase(name);
}
@CheckReturnValue
public boolean isChromium() {
return isChrome() || isEdge();
}
@CheckReturnValue
public boolean isFirefox() {
return FIREFOX.equalsIgnoreCase(name);
}
@CheckReturnValue
public boolean isIE() {
return INTERNET_EXPLORER.equalsIgnoreCase(name) || IE.equalsIgnoreCase(name);
}
@CheckReturnValue
public boolean isEdge() {
return EDGE.equalsIgnoreCase(name);
}
@CheckReturnValue
public boolean isSafari() {
return SAFARI.equalsIgnoreCase(name);
}
@CheckReturnValue
public boolean supportsInsecureCerts() {
return !isIE() && !isSafari();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy