-
Notifications
You must be signed in to change notification settings - Fork 51
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
ARQ-2037 Added a support of additional browser capabilities for Chrome #65
Conversation
With this, it should be possible to set all possible chrome options into a chromeDriver through arquillian.xml file. All the options you can find here: https://sites.google.com/a/chromium.org/chromedriver/capabilities All the options are set into ChromeOptions class: https://seleniumhq.github.io/selenium/docs/api/java/org/openqa/selenium/chrome/ChromeOptions.html which means that the parameter names tightly depend on names of the set/add methods. It is expected that the name of a parameter consist of: "chrome" + (name of set/add method of ChromeOption class without first three chars) whole string in camelcase. eg for option args there should be: <property name="chromeArguments">--your-cool --arguments</property> If the value can be an array or list of strings/files, then specify all of them in one string separated by space. (This is also applied for extensions as well as for encoded extensions.) In the case of experimental options it is a little bit different. As there is expected a set of dictionaries, the most suitable way is using JSON format - eg: <property name="chromeExperimentalOption">{"perfLoggingPrefs": { "traceCategories": ",blink.console,disabled-by-default-devtools.timeline,benchmark" }, "prefs": {"download.default_directory": "/usr/local/path/to/download/directory"} }</property> (can be in multiline format ) If you are still struglling with passing required options through arquillian.xml, you can use a parameter chromePrintOptions with a value "true": <property name="chromePrintOptions">true</property> This ensures that Drone prints whole content of ChromeOptions in a JSON format on a standard output.
5d4975b
to
eea6f37
Compare
This is a fix for #64 |
Review status: 0 of 7 files reviewed at latest revision, 9 unresolved discussions. drone-webdriver/src/main/java/org/jboss/arquillian/drone/webdriver/factory/CapabilitiesMapper.java, line 173 [r1] (raw file):
This method is really cluttered and confusing. Wouldn't it be better to not use nesting/ternary operators? I.e.:
drone-webdriver/src/main/java/org/jboss/arquillian/drone/webdriver/factory/ChromeDriverFactory.java, line 116 [r1] (raw file):
Shouldn't some logger be used instead of writing directly to out? drone-webdriver/src/main/java/org/jboss/arquillian/drone/webdriver/factory/ChromeDriverFactory.java, line 120 [r1] (raw file):
Who is throwing the drone-webdriver/src/main/java/org/jboss/arquillian/drone/webdriver/utils/StringUtils.java, line 58 [r1] (raw file):
This whole method looks like it was taken from some disassembled Java code. drone-webdriver/src/main/java/org/jboss/arquillian/drone/webdriver/utils/StringUtils.java, line 60 [r1] (raw file):
More descriptive variable names would help in this method. drone-webdriver/src/main/java/org/jboss/arquillian/drone/webdriver/utils/StringUtils.java, line 60 [r1] (raw file):
Correct me if I'm wrong, but doesn't this split by every whitespace, removing the need to do drone-webdriver/src/main/java/org/jboss/arquillian/drone/webdriver/utils/StringUtils.java, line 63 [r1] (raw file):
Why not iterate using drone-webdriver/src/main/java/org/jboss/arquillian/drone/webdriver/utils/StringUtils.java, line 65 [r1] (raw file):
I'm not sure about the performance of drone-webdriver/src/main/java/org/jboss/arquillian/drone/webdriver/utils/StringUtils.java, line 70 [r1] (raw file):
Isn't this trim unnecessary? Comments from Reviewable |
Review status: 0 of 7 files reviewed at latest revision, 9 unresolved discussions. drone-webdriver/src/main/java/org/jboss/arquillian/drone/webdriver/factory/ChromeDriverFactory.java, line 120 [r1] (raw file):
|
@TadeasKriz thanks a lot for your review and sorry for my stupidity that I forgot to replace the confusing copy-pasted methods. |
Landed in a1d3e46 |
Thanks @MatousJobanek for implementing this support! |
With this commit, it should be possible to set all possible chrome options into
a chromeDriver through arquillian.xml file. All the options you can find
here: https://sites.google.com/a/chromium.org/chromedriver/capabilities
All the options are set into ChromeOptions class:
https://seleniumhq.github.io/selenium/docs/api/java/org/openqa/selenium/chrome/ChromeOptions.html
which means that the parameter names tightly depend on names of the set/add
methods.
It is expected that the name of a parameter consist of:
"chrome" + (name of set/add method of ChromeOption class without first three chars)
whole string in camelcase.
eg for option args there should be:
<property name="chromeArguments">--your-cool --arguments</property>
If the value can be an array or list of strings/files, then specify all of
them in one string separated by space. (This is also applied for
extensions as well as for encoded extensions.)
In the case of experimental options it is a little bit different. As there
is expected a set of dictionaries, the most suitable way is using JSON
format - eg:
<property name="chromeExperimentalOption">{"perfLoggingPrefs": { "traceCategories": ",blink.console,disabled-by-default-devtools.timeline,benchmark" }, "prefs": {"download.default_directory": "/usr/local/path/to/download/directory"} }</property>
(can be in multiline format )
If you are still struglling with passing required options through
arquillian.xml, you can use a parameter chromePrintOptions with a value
true
:<property name="chromePrintOptions">true</property>
This ensures that Drone prints whole content of ChromeOptions in a JSON
format on a standard output.
This change is