Skip to content

Commit

Permalink
[plugin-web-app] Deprecate browser properties requiring upper-case in…
Browse files Browse the repository at this point in the history
… names (#4149)
  • Loading branch information
valfirst authored Jul 19, 2023
1 parent c236818 commit a8f0e98
Show file tree
Hide file tree
Showing 13 changed files with 103 additions and 89 deletions.
8 changes: 4 additions & 4 deletions docs/modules/plugins/pages/plugin-web-app.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ a|The command line (CLI) arguments to use when starting browser.

`<browser-name>` is one of the browsers supporting CLI arguments:

* https://peter.sh/experiments/chromium-command-line-switches/[`CHROME`]
* https://www-archive.mozilla.org/docs/command-line-args/[`FIREFOX`],
* https://docs.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/general-info/hh826025(v=vs.85)?redirectedfrom=MSDN/[`IEXPLORE`].
* https://peter.sh/experiments/chromium-command-line-switches/[`chrome`]
* https://www-archive.mozilla.org/docs/command-line-args/[`firefox`],
* https://docs.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/general-info/hh826025(v=vs.85)?redirectedfrom=MSDN/[`iexplore`].

|`web-application.sticky-header-size-percentage`
|header size as a viewport size percent
Expand All @@ -67,7 +67,7 @@ Here is an example how to configure third-party cookies behaviour.
.Add the following property to allow all cookies
[source,properties]
----
web.driver.CHROME.experimental-options={"prefs": {"profile": {"cookie_controls_mode": 0}}}
web.driver.chrome.experimental-options={"prefs": {"profile": {"cookie_controls_mode": 0}}}
----
The allowed values for the preference from the example are:

Expand Down
6 changes: 3 additions & 3 deletions docs/modules/plugins/partials/plugin-web-app-profiles.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ Chrome allows to emulate view on mobile devices using https://developer.chrome.c
+
[source, properties]
----
web.driver.CHROME.mobile-emulation.device-name=DEVICE_NAME
web.driver.chrome.mobile-emulation.device-name=DEVICE_NAME
----
Available for emulation devices you can find in the https://developer.chrome.com/docs/devtools/device-mode/#device[Dimensions list] in chrome.

Expand All @@ -149,8 +149,8 @@ In case you need to use https://developer.chrome.com/docs/devtools/device-mode/#
+
[source, properties]
----
web.driver.CHROME.mobile-emulation.width=1440
web.driver.CHROME.mobile-emulation.height=900
web.driver.chrome.mobile-emulation.width=1440
web.driver.chrome.mobile-emulation.height=900
----

=== Docker
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2019-2020 the original author or authors.
* Copyright 2019-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -31,7 +31,7 @@ public ApplicationSteps(IWebDriverProvider webDriverProvider)
/**
* Starts Electron application by creation of chrome driver session;
* Please mind that you should pass path to an executable via property:
* <br> <b>web.driver.CHROME.binary-path</b>
* <br> <b>web.driver.chrome.binary-path</b>
*/
@Given("I start electron application")
public void startApplication()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ selenium.screenshot.strategy=SIMPLE

electron-app.command-line-arguments=

web.driver.CHROME.binary-path=${electron-app.binary-path}
web.driver.chrome.binary-path=${electron-app.binary-path}
system.wdm.chromeDriverVersion=${electron-app.chromium-version}
web.driver.CHROME.command-line-arguments=${electron-app.command-line-arguments}
web.driver.crhome.command-line-arguments=${electron-app.command-line-arguments}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2019-2022 the original author or authors.
* Copyright 2019-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -183,8 +183,9 @@ private void checkCommandLineArgumentsSupported(WebDriverType webDriverType)

private Optional<String> getPropertyValue(String propertyKey, WebDriverType webDriverType)
{
return Optional
.ofNullable(getPropertyParser().getPropertyValue("web.driver." + webDriverType + "." + propertyKey));
return Optional.ofNullable(
getPropertyParser().getPropertyValue("web.driver.%s.%s", webDriverType.toString().toLowerCase(),
propertyKey));
}

public void setWebDriverType(WebDriverType webDriverType)
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
web\.driver\.edge_chromium.driver-executable-path=web.driver.edge.driver-executable-path
web\\.driver\\.edge_chromium.driver-executable-path=web.driver.edge.driver-executable-path

web\\.driver\\.CHROME\\.(.+)=web.driver.chrome.$1
web\\.driver\\.EDGE\\.(.+)=web.driver.edge.$1
web\\.driver\\.FIREFOX\\.(.+)=web.driver.firefox.$1
web\\.driver\\.IEXPLORE\\.(.+)=web.driver.iexplore.$1
web\\.driver\\.OPERA\\.(.+)=web.driver.opera.$1
web\\.driver\\.SAFARI\\.(.+)=web.driver.safari.$1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
bdd.all-meta-filters=groovy: layout && layout.toString().tokenize(' ').contains('chrome_phone') && !skip && (${bdd.meta-filters})

web.driver.CHROME.experimental-options={"mobileEmulation": {"deviceName": "${web.driver.CHROME.mobile-emulation.device-name}"}}
web.driver.CHROME.mobile-emulation.device-name=iPhone 8
web.driver.chrome.experimental-options={"mobileEmulation": {"deviceName": "${web.driver.chrome.mobile-emulation.device-name}"}}
web.driver.chrome.mobile-emulation.device-name=iPhone 8
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
bdd.all-meta-filters=groovy: layout && layout.toString().tokenize(' ').contains('chrome_responsive') && !skip && (${bdd.meta-filters})

web.driver.CHROME.experimental-options={"mobileEmulation": {"deviceMetrics": \
web.driver.chrome.experimental-options={"mobileEmulation": {"deviceMetrics": \
{\
"width":${web.driver.CHROME.mobile-emulation.width},\
"height": ${web.driver.CHROME.mobile-emulation.height},\
"width":${web.driver.chrome.mobile-emulation.width},\
"height": ${web.driver.chrome.mobile-emulation.height},\
"pixelRatio": 2.0\
},\
"userAgent": "Mozilla/5.0 (Linux; Android 4.2.1; en-us; Nexus 5 Build/JOP40D) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.166 Mobile Safari/535.19"}}
web.driver.CHROME.mobile-emulation.width=408
web.driver.CHROME.mobile-emulation.height=887
web.driver.chrome.mobile-emulation.width=408
web.driver.chrome.mobile-emulation.height=887
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
bdd.all-meta-filters=groovy: layout && layout.toString().tokenize(' ').contains('chrome_tablet') && !skip && (${bdd.meta-filters})

web.driver.CHROME.experimental-options={"mobileEmulation": {"deviceName": "${web.driver.CHROME.mobile-emulation.device-name}"}}
web.driver.CHROME.mobile-emulation.device-name=iPad
web.driver.chrome.experimental-options={"mobileEmulation": {"deviceName": "${web.driver.chrome.mobile-emulation.device-name}"}}
web.driver.chrome.mobile-emulation.device-name=iPad
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ selenium.browser=opera

selenium.grid.screen-resolution=1920x1080

web.driver.OPERA.binary-path=
web.driver.opera.binary-path=
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ selenium.screenshot.strategy=VIEWPORT_PASTING
selenium.screenshot.full-page=false
selenium.screenshot.highlighter=MONOCHROME

#web.driver.[WEB-DRIVER-TYPE].driver-executable-path=/path/to/driver/executable
#web.driver.[WEB-DRIVER-TYPE].binary-path=/path/to/custom/browser
# [WEB-DRIVER-TYPE] is one of the supported web driver types. For example:
#web.driver.CHROME.driver-executable-path=/path/to/chromedriver.exe
#web.driver.CHROME.binary-path=/path/to/custom/chrome
#web.driver.[web-driver-type].driver-executable-path=/path/to/driver/executable
#web.driver.[web-driver-type].binary-path=/path/to/custom/browser
# [web-driver-type] is one of the supported web driver types. For example:
#web.driver.chrome.driver-executable-path=/path/to/chromedriver.exe
#web.driver.chrome.binary-path=/path/to/custom/chrome
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
selenium.browser=chrome
web.driver.CHROME.command-line-arguments=--headless --hide-scrollbars
web.driver.chrome.command-line-arguments=--headless --hide-scrollbars
Loading

0 comments on commit a8f0e98

Please sign in to comment.