-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Java client bindings #23
Conversation
|
||
public EdgeOptions() { | ||
setCapability(CapabilityType.BROWSER_NAME, BrowserType.EDGE); | ||
setCapability(USE_CHROMIUM, true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there an API to set USE_CHROMIUM to false? Do we need a test case for USE_CHROMIUM setup?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Java bindings are Chromium-only unlike the other language bindings. Java users who want to test legacy Edge should continue to use the official Selenium bindings.
This is because of the way the Java EdgeDriver works in Selenium 4 Alpha. They don't have a single class with a useChromium boolean. They have separate EdgeHtmlDriver and EdgeDriver classes.
So USE_CHROMIUM is always hard-coded to true here.
} | ||
|
||
public EdgeOptions setHeadless(boolean headless) { | ||
args.remove("--headless"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we remove --disable-gpu when headless is false?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This matches the existing ChromeOptions behavior in Selenium 3. The goal is to provide matching behavior.
I checked if this bug is still present in the latest official Selenium so we can fix it there. It looks like the --disable-gpu option was removed in Selenium 4.0 Alpha 1 so this is no longer a problem: https://github.com/SeleniumHQ/selenium/blob/941dc9c6b2e2aa4f701c1b72be8de03d4b7e996a/py/CHANGES#L87
|
||
import static org.junit.jupiter.api.Assertions.*; | ||
|
||
class EdgeDriverTest { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add some test cases to verify that the right version of edge browser (either legacy edge or chromium edge) is started with the corresponding ms:edgeChromium setup?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See earlier comment. This EdgeDriver is Chromium-only. I only added minimal tests to verify that Edge Chromium is launched and that ms:edgeOptions is set to true.
23d2186
to
642f2e7
Compare
Adding client language bindings for Java. Sources are found in the java/ directory. The project contains EdgeDriver, EdgeDriverService, and EdgeOptions based on the existing Selenium 3 Chrome* classes.
Selenium 4's Java bindings use separate classes for Edge Legacy and Edge Chromium instead of a single class with a UseChromium switch. Since Selenium 3 already has a driver for Edge Legacy (EdgeHTML), this project simply adds an Edge Chromium driver. The driver that ships with this project is named EdgeDriver for forwards-compatibility with Selenium 4 and because this should hopefully become the default in the future.
TODO: Deploy this to the central Maven repository and/or make available as a downloadable .jar file.