Skip to content

Commit

Permalink
Updated to Selenium 4.27.0
Browse files Browse the repository at this point in the history
  • Loading branch information
wakaleo committed Jan 3, 2025
1 parent 12bd130 commit aacf54d
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 39 deletions.
14 changes: 7 additions & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
<cucumber.version>7.20.1</cucumber.version>
<cucumber.tag-expressions.version>6.1.1</cucumber.tag-expressions.version>
<gson.version>2.11.0</gson.version>
<junit5.version>5.11.1</junit5.version>
<junit5.version>5.11.4</junit5.version>
<mockito.version>3.3.3</mockito.version>
<assertj.version>3.26.3</assertj.version>
<opentest.version>1.3.0</opentest.version>
Expand All @@ -65,8 +65,8 @@
<commons.net.version>3.11.1</commons.net.version>
<commons.codec.version>1.17.1</commons.codec.version>
<freemarker.version>2.3.33</freemarker.version>
<selenium.version>4.26.0</selenium.version>
<htmlunit.driver.version>4.25.0</htmlunit.driver.version>
<selenium.version>4.27.0</selenium.version>
<htmlunit.driver.version>4.27.0</htmlunit.driver.version>
<jsonassert.version>1.5.1</jsonassert.version>
<jsoup.version>1.15.4</jsoup.version>
<joda-time.version>2.13.0</joda-time.version>
Expand All @@ -77,7 +77,7 @@
<awaitility.version>4.2.2</awaitility.version>
<appium.version>9.3.0</appium.version>
<fluentlenium.version>0.10.2</fluentlenium.version>
<htmlunit.version>4.5.0</htmlunit.version>
<htmlunit.version>4.7.0</htmlunit.version>
<filters.version>2.0.235</filters.version>
<ngwebdriver.version>1.2</ngwebdriver.version>
<spring.version>6.1.14</spring.version>
Expand All @@ -101,7 +101,7 @@
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-handler</artifactId>
<version>4.1.114.Final</version>
<version>4.1.116.Final</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents.client5</groupId>
Expand Down Expand Up @@ -476,7 +476,7 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.13.0</version>
<configuration>
<!-- put your configurations here -->
<release>11</release>
</configuration>
</plugin>
<plugin>
Expand Down Expand Up @@ -667,7 +667,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-report-plugin</artifactId>
<version>3.5.1</version>
<version>3.5.2</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down
5 changes: 2 additions & 3 deletions serenity-appium/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,9 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.2</version>
<version>3.13.0</version>
<configuration>
<source>11</source>
<target>11</target>
<release>11</release>
</configuration>
</plugin>
<plugin>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,19 @@ public void deselectByIndex(int index) {
public void deselectByVisibleText(String text) {
select().deselectByVisibleText(text);
}

@Override
public void deSelectByContainsVisibleText(String text) {
select().deSelectByContainsVisibleText(text);
}

@Override
public void selectByContainsVisibleText(String text) {
select().selectByContainsVisibleText(text);
}

public void byContainsVisibleText(String text) {
selectByContainsVisibleText(text);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public interface WebElementFacade extends WebElement, WrapsElement, WebElementSt

<T extends WebElementFacade> T then(By bySelector);

@Deprecated
String getAttribute(String name);

ListOfWebElementFacades thenFindAll(By... selector);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
import org.openqa.selenium.firefox.FirefoxOptions;
import org.openqa.selenium.firefox.GeckoDriverService;

import java.time.Duration;
import java.util.HashMap;
import java.util.Map;

public class FirefoxDriverProvider extends DownloadableDriverProvider implements DriverProvider {

private final DriverCapabilityRecord driverProperties;
Expand All @@ -28,41 +32,38 @@ public FirefoxDriverProvider(FixtureProviderService fixtureProviderService) {

@Override
public WebDriver newInstance(String options, EnvironmentVariables environmentVariables) {
// If webdriver calls are suspended no need to create a new driver
if (StepEventBus.getParallelEventBus().webdriverCallsAreSuspended()) {
return new WebDriverStub();
}
// Download the driver using WebDriverManager if required
// downloadDriverIfRequired("firefox", environmentVariables);
//
// Update the binary path if necessary
//

UpdateDriverEnvironmentProperty.forDriverProperty(GeckoDriverService.GECKO_DRIVER_EXE_PROPERTY);
//
// Load the FirefoxDriver capabilities from the serenity.conf file
//
FirefoxOptions firefoxOptions = W3CCapabilities.definedIn(environmentVariables).withPrefix("webdriver.capabilities").firefoxOptions();

FirefoxOptions firefoxOptions = W3CCapabilities.definedIn(environmentVariables)
.withPrefix("webdriver.capabilities")
.firefoxOptions();

// Set BiBi Firefox preferences
firefoxOptions.addPreference("remote.active-protocols", 1);
firefoxOptions.addPreference("devtools.chrome.enabled", false);
firefoxOptions.addPreference("devtools.debugger.remote-enabled", true);

// Configure base capabilities
firefoxOptions.setCapability("webSocketUrl", true);
firefoxOptions.setCapability("moz:debuggerAddress", true);

FirefoxOptionsEnhancer.enhanceOptions(firefoxOptions).using(environmentVariables);
//
// Add any arguments passed from the test itself
//

firefoxOptions.addArguments(argumentsIn(options));
if (ThucydidesSystemProperty.HEADLESS_MODE.booleanFrom(environmentVariables)) {
firefoxOptions.addArguments("-headless");
}
//
// Check for extended classes to add extra ChromeOptions configuration
//
final FirefoxOptions enhancedOptions = EnhanceCapabilitiesWithFixtures.using(fixtureProviderService).into(firefoxOptions);
//
// Record browser and platform
//

final FirefoxOptions enhancedOptions = EnhanceCapabilitiesWithFixtures.using(fixtureProviderService)
.into(firefoxOptions);

TestContext.forTheCurrentTest().recordBrowserConfiguration(enhancedOptions);
TestContext.forTheCurrentTest().recordCurrentPlatform();

//
// Record the driver capabilities for reporting
//
driverProperties.registerCapabilities("firefox", capabilitiesToProperties(enhancedOptions));

return new FirefoxDriver(enhancedOptions);
Expand Down
5 changes: 2 additions & 3 deletions serenity-cucumber-smoke-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,9 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<version>3.13.0</version>
<configuration>
<source>16</source>
<target>16</target>
<release>17</release>
</configuration>
</plugin>
<plugin>
Expand Down
5 changes: 2 additions & 3 deletions serenity-smoketests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,9 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.11.0</version>
<version>3.13.0</version>
<configuration>
<source>11</source>
<target>11</target>
<release>11</release>
<compilerArgs>
<arg>-parameters</arg>
</compilerArgs>
Expand Down

0 comments on commit aacf54d

Please sign in to comment.