Skip to content
This repository has been archived by the owner on Sep 3, 2024. It is now read-only.

Commit

Permalink
Merge pull request #406 from sbtqa/fix-browser-version
Browse files Browse the repository at this point in the history
Fix webdriver version
  • Loading branch information
clicman authored Apr 2, 2024
2 parents d8c2ee1 + e172562 commit b3a5526
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 12 deletions.
2 changes: 1 addition & 1 deletion page-factory-doc/src/main/asciidoc/web_properties.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ webdriver.browser.size = 1920x1080
webdriver.browser.path = src/test/resources/webdrivers/chromedriver.exe
| Не задано

| webdriver.version
| webdriver.browser.version
| Версия драйвера. Если указан этот параметр, то будет выполнена попытка автоматически найти соответствующую версию
| Не задано

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ screenshot.strategy=driver

webdriver.browser.name=Chrome
webdriver.starting.url=http://localhost:8181
webdriver.browser.version = 123.0.6312.86

# Run in headless mode
webdriver.chrome.capability.options.args=headless,disable-gpu,no-sandbox,remote-allow-origins=*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ webdriver.nexus.url = http://your.nexus.repo.with.drivers.com/
webdriver.os.arch

#optional. Forces to download this driver version if it is available. LATEST by default
webdriver.version = 2.35
webdriver.browser.version = 2.35

#optional. The number of start attempts webdriver. 3 by default
webdriver.create.attempts = 3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,20 @@
import ru.sbtqa.tag.pagefactory.web.properties.WebConfiguration;
import io.github.bonigarcia.wdm.WebDriverManager;


public class WebDriverManagerConfigurator {

private static final Logger LOG = LoggerFactory.getLogger(WebDriverManagerConfigurator.class);
private static final WebConfiguration PROPERTIES = WebConfiguration.create();

private WebDriverManagerConfigurator() {}
private WebDriverManagerConfigurator() {
}

public static void configureDriver(WebDriverManager webDriverManager, String browserType) {
System.setProperty("wdm." + browserType.toLowerCase() + "Version", PROPERTIES.getBrowserVersion());

if (!PROPERTIES.getDriversPath().isEmpty()) {
System.setProperty("webdriver." + browserType.toLowerCase() + ".driver", new File(PROPERTIES.getDriversPath()).getAbsolutePath());
System.setProperty("webdriver." + browserType.toLowerCase() + ".driver",
new File(PROPERTIES.getDriversPath()).getAbsolutePath());
} else {
LOG.warn("The value of property 'webdriver.drivers.path' is not specified."
+ " Trying to automatically download and setup driver.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public interface WebConfiguration extends Configuration {
@DefaultValue("")
String getDriversPath();

@Key("webdriver.version")
@Key("webdriver.browser.version")
@DefaultValue("")
String getWebDriverVersion();

Expand All @@ -57,7 +57,6 @@ public interface WebConfiguration extends Configuration {
@DefaultValue("")
String getProxy();


@Key("aspects.highlight.enabled")
@DefaultValue("false")
boolean isHighlightEnabled();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ screenshot.strategy = driver
webdriver.browser.name = Chrome
webdriver.starting.url = http://localhost:8181

webdriver.browser.version = 123.0.6312.86
# Run in headless mode
webdriver.chrome.capability.options.args=headless,disable-gpu,no-sandbox,remote-allow-origins=*
webdriver.edge.capability.options.args=headless,disable-gpu,no-sandbox,remote-allow-origins=*
Expand All @@ -13,7 +14,8 @@ webdriver.firefox.capability.options.args=headless
#webdriver.browser.size=1920x1080

aspects.highlight.enabled = true

video.enabled = false
video.path = /Users/sidochenko/Downloads
data.type = json
data.folder = src/test/resources/data/
data.initial.collection = Data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ webdriver.nexus.url = http://your.nexus.repo.with.drivers.com/
webdriver.os.arch

#optional. Forces to download this driver version if it is available. LATEST by default
webdriver.version = 2.35
webdriver.browser.version = 2.35

#optional. The number of start attempts webdriver. 3 by default
webdriver.create.attempts = 3
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
</scm>

<properties>
<selenium.version>4.8.1</selenium.version>
<selenium.version>4.11.0</selenium.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
Expand All @@ -64,7 +64,7 @@
<surefire.version>2.22.1</surefire.version>
<tag.version.qautils>1.9.1</tag.version.qautils>
<tag.version.videorecorder>1.1.2</tag.version.videorecorder>
<webdrivermanager.version>5.5.2</webdrivermanager.version>
<webdrivermanager.version>5.7.0</webdrivermanager.version>
<tag.version.datajack>5.2.3</tag.version.datajack>
<allure.version>2.13.0</allure.version>
<netty.version>4.1.87.Final</netty.version>
Expand Down
2 changes: 1 addition & 1 deletion tests/test-web-app/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>3.0.0</version>
<version>3.4.0</version>
<configuration>
<webXml>web/WEB-INF/web.xml</webXml>
<webResources>
Expand Down

0 comments on commit b3a5526

Please sign in to comment.