Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
<dependency>
<groupId>com.github.aquality-automation</groupId>
<artifactId>aquality-selenium-core</artifactId>
<version>4.12.0</version>
<version>4.13.0</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
Expand All @@ -80,7 +80,7 @@
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.20.1</version>
<version>2.21.2</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
Expand All @@ -97,7 +97,7 @@
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>7.11.0</version>
<version>7.12.0</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand All @@ -107,7 +107,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.14.0</version>
<version>3.15.0</version>
<configuration>
<source>11</source>
<target>11</target>
Expand All @@ -116,7 +116,7 @@
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.13</version>
<version>0.8.14</version>
<executions>
<execution>
<id>pre-unit-test</id>
Expand Down Expand Up @@ -144,7 +144,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.5.3</version>
<version>3.5.5</version>
<configuration>
<argLine>${surefireArgLine} -Dfile.encoding=UTF-8</argLine>
<reuseForks>false</reuseForks>
Expand All @@ -156,7 +156,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.7.1</version>
<version>3.8.0</version>
<executions>
<execution>
<goals>
Expand All @@ -174,7 +174,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.3.1</version>
<version>3.4.0</version>
<executions>
<execution>
<id>attach-sources</id>
Expand All @@ -187,7 +187,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.11.2</version>
<version>3.12.0</version>
<configuration>
<source>11</source>
</configuration>
Expand Down Expand Up @@ -223,7 +223,7 @@
<plugin>
<groupId>org.sonatype.central</groupId>
<artifactId>central-publishing-maven-plugin</artifactId>
<version>0.8.0</version>
<version>0.10.0</version>
<extensions>true</extensions>
<configuration>
<publishingServerId>central</publishingServerId>
Expand All @@ -234,7 +234,7 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
<version>2.18.0</version>
<version>2.21.0</version>
</plugin>
</plugins>
</build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
import org.openqa.selenium.devtools.DevTools;
import org.openqa.selenium.devtools.Event;
import org.openqa.selenium.devtools.HasDevTools;
import org.openqa.selenium.devtools.v144.performance.Performance;
import org.openqa.selenium.devtools.v144.performance.model.Metric;
import org.openqa.selenium.devtools.v145.performance.Performance;
import org.openqa.selenium.devtools.v145.performance.model.Metric;

import java.util.List;
import java.util.Map;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

import org.apache.commons.lang3.StringUtils;
import org.openqa.selenium.devtools.Command;
import org.openqa.selenium.devtools.v144.dom.model.RGBA;
import org.openqa.selenium.devtools.v144.emulation.Emulation;
import org.openqa.selenium.devtools.v144.emulation.model.MediaFeature;
import org.openqa.selenium.devtools.v144.emulation.model.ScreenOrientation;
import org.openqa.selenium.devtools.v145.dom.model.RGBA;
import org.openqa.selenium.devtools.v145.emulation.Emulation;
import org.openqa.selenium.devtools.v145.emulation.model.MediaFeature;
import org.openqa.selenium.devtools.v145.emulation.model.ScreenOrientation;

import java.util.Collections;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
import org.openqa.selenium.devtools.idealized.Javascript;
import org.openqa.selenium.devtools.idealized.ScriptId;
import org.openqa.selenium.devtools.idealized.target.model.SessionID;
import org.openqa.selenium.devtools.v144.page.Page;
import org.openqa.selenium.devtools.v144.page.model.ScriptIdentifier;
import org.openqa.selenium.devtools.v144.runtime.Runtime;
import org.openqa.selenium.devtools.v145.page.Page;
import org.openqa.selenium.devtools.v145.page.model.ScriptIdentifier;
import org.openqa.selenium.devtools.v145.runtime.Runtime;
import org.openqa.selenium.logging.EventType;
import org.openqa.selenium.logging.HasLogEvents;
import org.openqa.selenium.remote.Augmenter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import org.openqa.selenium.UsernameAndPassword;
import org.openqa.selenium.devtools.NetworkInterceptor;
import org.openqa.selenium.devtools.idealized.Network;
import org.openqa.selenium.devtools.v144.network.model.*;
import org.openqa.selenium.devtools.v145.network.model.*;
import org.openqa.selenium.remote.http.*;

import java.net.URI;
Expand All @@ -22,11 +22,11 @@

import static aquality.selenium.browser.AqualityServices.getBrowser;
import static aquality.selenium.logging.LocalizedLoggerUtility.logByLevel;
import static org.openqa.selenium.devtools.v144.network.Network.*;
import static org.openqa.selenium.devtools.v145.network.Network.*;

/**
* DevTools commands for version-independent network interception.
* For more information, see {@link org.openqa.selenium.devtools.v144.network.Network} and {@link Network}.
* For more information, see {@link org.openqa.selenium.devtools.v145.network.Network} and {@link Network}.
*/
public class NetworkHandling {
public static final String LOC_NETWORK_INTERCEPTOR_START = "loc.browser.network.interceptor.start";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,7 @@ default <T extends IElement> List<T> findElementsInShadowRoot(By locator, String
* @param name Child elements name.
* @param supplier Required elements' supplier.
* @param state Visibility state of shadowed elements.
* @param count Expected number of elements that have to be found (zero, more than zero, any).
* @return List of shadowed elements.
*/
default <T extends IElement> List<T> findElementsInShadowRoot(By locator, String name, IElementSupplier<T> supplier, ElementState state, ElementsCount count) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public LoggingParameters getResult() {

/**
* Sets logging parameters for command result (when it's present).
* @param result command result logging parameters.
*/
public void setResult(LoggingParameters result) {
this.result = result;
Expand Down
6 changes: 4 additions & 2 deletions src/test/java/forms/MyLocationForm.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@ public MyLocationForm() {
super(By.xpath("//*[contains(text(),'Location')]"), "My Location");
}

public double getLatitude() {
public Double getLatitude() {
if (!lblLatitude.state().isDisplayed() && btnConsent.state().waitForDisplayed()) {
clickConsent();
}
lblLatitude.state().waitForDisplayed();
if (!lblLatitude.state().waitForDisplayed()) {
return null;
}
return Double.parseDouble(lblLatitude.getText());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import aquality.selenium.browser.AqualityServices;
import aquality.selenium.browser.devtools.EmulationHandling;
import com.google.common.collect.ImmutableMap;
import org.openqa.selenium.devtools.v143.emulation.Emulation;
import org.openqa.selenium.devtools.v143.emulation.model.DisplayFeature;
import org.openqa.selenium.devtools.v144.emulation.Emulation;
import org.openqa.selenium.devtools.v144.emulation.model.DisplayFeature;
import org.testng.Assert;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import aquality.selenium.browser.AqualityServices;
import aquality.selenium.browser.devtools.NetworkHandling;
import org.openqa.selenium.TimeoutException;
import org.openqa.selenium.devtools.v144.network.model.ConnectionType;
import org.openqa.selenium.devtools.v144.network.model.NetworkConditions;
import org.openqa.selenium.devtools.v145.network.model.ConnectionType;
import org.openqa.selenium.devtools.v145.network.model.NetworkConditions;
import org.testng.Assert;
import org.testng.annotations.Test;
import tests.BaseTest;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import aquality.selenium.browser.AqualityServices;
import forms.MyLocationForm;
import org.testng.Assert;
import org.testng.SkipException;
import org.testng.annotations.Test;
import tests.BaseTest;

Expand All @@ -19,7 +20,10 @@ public void overrideGeolocationTest() {
AqualityServices.getBrowser().goTo(URL_MYLOCATIONORG);
MyLocationForm form = new MyLocationForm();
Assert.assertTrue(form.state().waitForDisplayed());
double latDefault = form.getLatitude();
Double latDefault = form.getLatitude();
if (latDefault == null) {
throw new SkipException("Geolocation access is disabled");
}
double lngDefault = form.getLongitude();

AqualityServices.getBrowser().devTools().emulation().setGeolocationOverride(LAT_FOR_OVERRIDE, LNG_FOR_OVERRIDE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import manytools.BrowserLanguageForm;
import manytools.UserAgentForm;
import org.openqa.selenium.devtools.idealized.Network;
import org.openqa.selenium.devtools.v143.emulation.Emulation;
import org.openqa.selenium.devtools.v144.emulation.Emulation;
import org.testng.Assert;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
Expand Down
Loading