diff --git a/pom.xml b/pom.xml index 73a2f85..99929a8 100644 --- a/pom.xml +++ b/pom.xml @@ -70,7 +70,7 @@ com.github.aquality-automation aquality-selenium-core - 4.8.0 + 4.9.0 org.apache.commons diff --git a/src/main/java/aquality/selenium/browser/devtools/DevToolsHandling.java b/src/main/java/aquality/selenium/browser/devtools/DevToolsHandling.java index 53c0eff..f4ba934 100644 --- a/src/main/java/aquality/selenium/browser/devtools/DevToolsHandling.java +++ b/src/main/java/aquality/selenium/browser/devtools/DevToolsHandling.java @@ -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.v138.performance.Performance; -import org.openqa.selenium.devtools.v138.performance.model.Metric; +import org.openqa.selenium.devtools.v140.performance.Performance; +import org.openqa.selenium.devtools.v140.performance.model.Metric; import java.util.List; import java.util.Map; diff --git a/src/main/java/aquality/selenium/browser/devtools/EmulationHandling.java b/src/main/java/aquality/selenium/browser/devtools/EmulationHandling.java index 11ea117..8d2e0a7 100644 --- a/src/main/java/aquality/selenium/browser/devtools/EmulationHandling.java +++ b/src/main/java/aquality/selenium/browser/devtools/EmulationHandling.java @@ -2,10 +2,10 @@ import org.apache.commons.lang3.StringUtils; import org.openqa.selenium.devtools.Command; -import org.openqa.selenium.devtools.v138.dom.model.RGBA; -import org.openqa.selenium.devtools.v138.emulation.Emulation; -import org.openqa.selenium.devtools.v138.emulation.model.MediaFeature; -import org.openqa.selenium.devtools.v138.emulation.model.ScreenOrientation; +import org.openqa.selenium.devtools.v140.dom.model.RGBA; +import org.openqa.selenium.devtools.v140.emulation.Emulation; +import org.openqa.selenium.devtools.v140.emulation.model.MediaFeature; +import org.openqa.selenium.devtools.v140.emulation.model.ScreenOrientation; import java.util.Collections; import java.util.List; @@ -24,6 +24,7 @@ public class EmulationHandling { /** * Initializes a new instance of the {@link NetworkHandling} class. + * * @param tools Instance of {@link DevToolsHandling}. */ public EmulationHandling(DevToolsHandling tools) { @@ -32,17 +33,20 @@ public EmulationHandling(DevToolsHandling tools) { /** * Tells whether emulation is supported. + * * @return true if the emulation is supported, false otherwise. */ + @Deprecated public boolean canEmulate() { return tools.sendCommand(Emulation.canEmulate()); } /** * Overrides the GeoLocation Position or Error. Omitting any of the parameters emulates position unavailable. - * @param latitude Latitude of location + * + * @param latitude Latitude of location * @param longitude Longitude of location - * @param accuracy Accuracy of the location + * @param accuracy Accuracy of the location */ public void setGeolocationOverride(double latitude, double longitude, double accuracy) { setGeolocationOverride(Optional.of(latitude), Optional.of(longitude), Optional.of(accuracy), Optional.empty(), @@ -52,7 +56,8 @@ public void setGeolocationOverride(double latitude, double longitude, double acc /** * Overrides the GeoLocation Position. Accuracy of the geoLocation is set to 1 meaning 100% accuracy. * Omitting any of the parameters emulates position unavailable. - * @param latitude Latitude of location + * + * @param latitude Latitude of location * @param longitude Longitude of location */ public void setGeolocationOverride(double latitude, double longitude) { @@ -61,9 +66,14 @@ public void setGeolocationOverride(double latitude, double longitude) { /** * Overrides the GeoLocation Position or Error. Omitting any of the parameters emulates position unavailable. - * @param latitude Latitude of location - * @param longitude Longitude of location - * @param accuracy Accuracy of the location + * + * @param latitude Latitude of location + * @param longitude Longitude of location + * @param altitude Altitude of location + * @param accuracy Accuracy of the location + * @param altitudeAccuracy Altitude accuracy of the location + * @param heading Heading of location + * @param speed Speed of location */ public void setGeolocationOverride(Optional latitude, Optional longitude, Optional accuracy, Optional altitude, Optional altitudeAccuracy, Optional heading, @@ -80,6 +90,7 @@ public void clearGeolocationOverride() { /** * Overrides the values of device screen dimensions. + * * @param params Version-specific set of parameters. For example, take a look at {@link Emulation#setDeviceMetricsOverride} */ public void setDeviceMetricsOverride(Map params) { @@ -88,10 +99,11 @@ public void setDeviceMetricsOverride(Map params) { /** * Overrides the values of device screen dimensions. - * @param width Value to override window.screen.width - * @param height Value to override window.screen.height + * + * @param width Value to override window.screen.width + * @param height Value to override window.screen.height * @param deviceScaleFactor Overriding device scale factor value. 0 disables the override. - * @param mobile Whether to emulate mobile device. This includes viewport meta tag, overlay scrollbars, text auto-sizing and more. + * @param mobile Whether to emulate mobile device. This includes viewport meta tag, overlay scrollbars, text auto-sizing and more. */ public void setDeviceMetricsOverride(Integer width, Integer height, Number deviceScaleFactor, Boolean mobile) { setDeviceMetricsOverride(width, height, deviceScaleFactor, mobile, Optional.empty(), Optional.empty()); @@ -99,12 +111,13 @@ public void setDeviceMetricsOverride(Integer width, Integer height, Number devic /** * Overrides the values of device screen dimensions. - * @param width Value to override window.screen.width - * @param height Value to override window.screen.height - * @param deviceScaleFactor Overriding device scale factor value. 0 disables the override. - * @param mobile Whether to emulate mobile device. This includes viewport meta tag, overlay scrollbars, text auto-sizing and more. - * @param screenOrientationType Orientation type. - * Allowed Values (in any case): portraitPrimary, portraitSecondary, landscapePrimary, landscapeSecondary. + * + * @param width Value to override window.screen.width + * @param height Value to override window.screen.height + * @param deviceScaleFactor Overriding device scale factor value. 0 disables the override. + * @param mobile Whether to emulate mobile device. This includes viewport meta tag, overlay scrollbars, text auto-sizing and more. + * @param screenOrientationType Orientation type. + * Allowed Values (in any case): portraitPrimary, portraitSecondary, landscapePrimary, landscapeSecondary. * @param screenOrientationAngle Orientation angle. Set only if orientation type was set. */ public void setDeviceMetricsOverride(Integer width, Integer height, Number deviceScaleFactor, Boolean mobile, @@ -130,6 +143,7 @@ public void clearDeviceMetricsOverride() { /** * Overrides the values of user agent. + * * @param params Version-specific set of parameters. * For example, take a look at {@link Emulation#setUserAgentOverride} */ @@ -139,6 +153,7 @@ public void setUserAgentOverride(Map params) { /** * Overrides the values of user agent. + * * @param userAgent User agent to use. */ public void setUserAgentOverride(String userAgent) { @@ -147,9 +162,10 @@ public void setUserAgentOverride(String userAgent) { /** * Overrides the values of user agent. - * @param userAgent User agent to use. + * + * @param userAgent User agent to use. * @param acceptLanguage Browser language to emulate. - * @param platform The platform navigator.platform should return. + * @param platform The platform navigator.platform should return. */ public void setUserAgentOverride(String userAgent, Optional acceptLanguage, Optional platform) { tools.sendCommand(Emulation.setUserAgentOverride(userAgent, acceptLanguage, platform, Optional.empty())); @@ -164,6 +180,7 @@ public void setScriptExecutionDisabled() { /** * Switches script execution in the page. + * * @param value Whether script execution should be disabled in the page. */ public void setScriptExecutionDisabled(boolean value) { @@ -179,6 +196,7 @@ public void setTouchEmulationEnabled() { /** * Enables touch on platforms which do not support them. + * * @param enabled Whether the touch event emulation should be enabled. */ public void setTouchEmulationEnabled(boolean enabled) { @@ -187,7 +205,8 @@ public void setTouchEmulationEnabled(boolean enabled) { /** * Enables touch on platforms which do not support them. - * @param enabled Whether the touch event emulation should be enabled. + * + * @param enabled Whether the touch event emulation should be enabled. * @param maxTouchPoints Maximum touch points supported. Defaults to one. */ public void setTouchEmulationEnabled(boolean enabled, Optional maxTouchPoints) { @@ -196,6 +215,7 @@ public void setTouchEmulationEnabled(boolean enabled, Optional maxTouch /** * Emulates the given media type or media feature for CSS media queries. + * * @param params Version-specific set of parameters. For example, take a look at {@link Emulation#setEmulatedMedia} */ public void setEmulatedMedia(Map params) { @@ -204,8 +224,9 @@ public void setEmulatedMedia(Map params) { /** * Emulates the given media type or media feature for CSS media queries. - * @param media Media type to emulate. Empty string disables the override. - * Possible values: braille, embossed, handheld, print, projection, screen, speech, tty, tv. + * + * @param media Media type to emulate. Empty string disables the override. + * Possible values: braille, embossed, handheld, print, projection, screen, speech, tty, tv. * @param mediaFeatures Media features to emulate. */ public void setEmulatedMedia(String media, Map mediaFeatures) { @@ -214,8 +235,9 @@ public void setEmulatedMedia(String media, Map mediaFeatures) { /** * Emulates the given media type or media feature for CSS media queries. - * @param media Media type to emulate. Empty string disables the override. - * Possible values: braille, embossed, handheld, print, projection, screen, speech, tty, tv. + * + * @param media Media type to emulate. Empty string disables the override. + * Possible values: braille, embossed, handheld, print, projection, screen, speech, tty, tv. * @param mediaFeatures Media features to emulate. */ public void setEmulatedMedia(Optional media, Optional> mediaFeatures) { @@ -233,9 +255,10 @@ public void disableEmulatedMediaOverride() { /** * Sets an override of the default background color of the frame. This override is used if the content does not specify one. - * @param red The red component, in the [0-255] range. + * + * @param red The red component, in the [0-255] range. * @param green The green component, in the [0-255] range. - * @param blue The blue component, in the [0-255] range. + * @param blue The blue component, in the [0-255] range. */ public void setDefaultBackgroundColorOverride(int red, int green, int blue) { setDefaultBackgroundColorOverride(red, green, blue, Optional.empty()); @@ -243,9 +266,10 @@ public void setDefaultBackgroundColorOverride(int red, int green, int blue) { /** * Sets an override of the default background color of the frame. This override is used if the content does not specify one. - * @param red The red component, in the [0-255] range. + * + * @param red The red component, in the [0-255] range. * @param green The green component, in the [0-255] range. - * @param blue The blue component, in the [0-255] range. + * @param blue The blue component, in the [0-255] range. * @param alpha The alpha component, in the [0-1] range (default: 1). */ public void setDefaultBackgroundColorOverride(int red, int green, int blue, Optional alpha) { diff --git a/src/main/java/aquality/selenium/browser/devtools/JavaScriptHandling.java b/src/main/java/aquality/selenium/browser/devtools/JavaScriptHandling.java index cb4acd4..0c66302 100644 --- a/src/main/java/aquality/selenium/browser/devtools/JavaScriptHandling.java +++ b/src/main/java/aquality/selenium/browser/devtools/JavaScriptHandling.java @@ -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.v138.page.Page; -import org.openqa.selenium.devtools.v138.page.model.ScriptIdentifier; -import org.openqa.selenium.devtools.v138.runtime.Runtime; +import org.openqa.selenium.devtools.v140.page.Page; +import org.openqa.selenium.devtools.v140.page.model.ScriptIdentifier; +import org.openqa.selenium.devtools.v140.runtime.Runtime; import org.openqa.selenium.logging.EventType; import org.openqa.selenium.logging.HasLogEvents; import org.openqa.selenium.remote.Augmenter; diff --git a/src/main/java/aquality/selenium/browser/devtools/NetworkHandling.java b/src/main/java/aquality/selenium/browser/devtools/NetworkHandling.java index ae29061..1029eb7 100644 --- a/src/main/java/aquality/selenium/browser/devtools/NetworkHandling.java +++ b/src/main/java/aquality/selenium/browser/devtools/NetworkHandling.java @@ -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.v138.network.model.*; +import org.openqa.selenium.devtools.v140.network.model.*; import org.openqa.selenium.remote.http.*; import java.net.URI; @@ -22,11 +22,11 @@ import static aquality.selenium.browser.AqualityServices.getBrowser; import static aquality.selenium.logging.LocalizedLoggerUtility.logByLevel; -import static org.openqa.selenium.devtools.v138.network.Network.*; +import static org.openqa.selenium.devtools.v140.network.Network.*; /** * DevTools commands for version-independent network interception. - * For more information, see {@link org.openqa.selenium.devtools.v138.network.Network} and {@link Network}. + * For more information, see {@link org.openqa.selenium.devtools.v140.network.Network} and {@link Network}. */ public class NetworkHandling { public static final String LOC_NETWORK_INTERCEPTOR_START = "loc.browser.network.interceptor.start"; @@ -80,6 +80,7 @@ public void setUserAgent(Network.UserAgent userAgent) { /** * Add basic authentication handler. + * @param whenThisMatches URI matcher. * @param useTheseCredentials parameters, such as URI matcher and credentials. */ public void addAuthHandler(Predicate whenThisMatches, Supplier useTheseCredentials) { @@ -199,7 +200,7 @@ private Consumer getResponseLogger(HttpExchangeLoggingOptions formatHeaders(response.getHeaders())); } if (loggingOptions.getResponseBody().isEnabled()) { - String responseBody = tools.sendCommand(org.openqa.selenium.devtools.v138.network.Network.getResponseBody(requestId)).getBody(); + String responseBody = tools.sendCommand(org.openqa.selenium.devtools.v140.network.Network.getResponseBody(requestId)).getBody(); if (StringUtils.isNotEmpty(responseBody)) { logByLevel(loggingOptions.getResponseBody().getLogLevel(), "loc.browser.network.event.responsereceived.log.body", diff --git a/src/main/java/aquality/selenium/elements/actions/JsActions.java b/src/main/java/aquality/selenium/elements/actions/JsActions.java index 2a70dd6..16d43c4 100644 --- a/src/main/java/aquality/selenium/elements/actions/JsActions.java +++ b/src/main/java/aquality/selenium/elements/actions/JsActions.java @@ -35,7 +35,8 @@ public SearchContext expandShadowRoot() { /** * Setting attribute value. - * @param name Attribute name + * + * @param name Attribute name * @param value Value to set */ public void setAttribute(String name, String value) { @@ -69,6 +70,8 @@ public void highlightElement() { /** * Highlights the element. + * + * @param highlightState Highlight state */ public void highlightElement(HighlightState highlightState) { if ((AqualityServices.getBrowserProfile().isElementHighlightEnabled() && !highlightState.equals(HighlightState.NOT_HIGHLIGHT)) @@ -186,7 +189,9 @@ private Object[] resolveArguments(Object... args) { /** * Executes pinned JavaScript against the element and gets result value. + * * @param pinnedScript Instance of script pinned with {@link Browser#javaScriptEngine()} + * @param args Script arguments. * @return Script execution result. */ public Object executeScript(ScriptKey pinnedScript, Object... args) { @@ -209,7 +214,8 @@ protected Object executeScript(JavaScript javaScript, Object... args) { /** * The implementation of a method for logging of Javascript actions * - * @param key key in localization resource of message to display in the log. + * @param key key in localization resource of message to display in the log. + * @param args arguments for message formatting. */ protected void logElementAction(String key, Object... args) { AqualityServices.getLocalizedLogger().infoElementAction(type, name, key, args); diff --git a/src/main/java/aquality/selenium/elements/interfaces/IShadowRootExpander.java b/src/main/java/aquality/selenium/elements/interfaces/IShadowRootExpander.java index db87ab2..77552b1 100644 --- a/src/main/java/aquality/selenium/elements/interfaces/IShadowRootExpander.java +++ b/src/main/java/aquality/selenium/elements/interfaces/IShadowRootExpander.java @@ -19,12 +19,14 @@ public interface IShadowRootExpander { /** * Expands shadow root. + * * @return ShadowRoot search context. */ SearchContext expandShadowRoot(); /** * Provides {@link IElementFactory} to find elements in the shadow root of the current element. + * * @return instance of ElementFactory for the shadow root. */ default IElementFactory getShadowRootElementFactory() { @@ -36,10 +38,10 @@ default IElementFactory getShadowRootElementFactory() { * Finds an element in the shadow root of the current element. * * @param locator shadowed element locator - * @param name output name in logs - * @param clazz class or interface of the element to be obtained - * @param state visibility state of target element - * @param the type of the element to be obtained + * @param name output name in logs + * @param clazz class or interface of the element to be obtained + * @param state visibility state of target element + * @param the type of the element to be obtained * @return found shadowed element */ default T findElementInShadowRoot(By locator, String name, Class clazz, ElementState state) { @@ -50,9 +52,9 @@ default T findElementInShadowRoot(By locator, String name, * Finds an element in the shadow root of the current element with DISPLAYED state * * @param locator shadowed element locator - * @param name output name in logs - * @param clazz class or interface of the element to be obtained - * @param the type of the element to be obtained + * @param name output name in logs + * @param clazz class or interface of the element to be obtained + * @param the type of the element to be obtained * @return found shadowed element */ default T findElementInShadowRoot(By locator, String name, Class clazz) { @@ -63,9 +65,9 @@ default T findElementInShadowRoot(By locator, String name, * Finds an element in the shadow root of the current element. * * @param locator shadowed element locator - * @param clazz class or interface of the element to be obtained - * @param state visibility state of target element - * @param the type of the element to be obtained + * @param clazz class or interface of the element to be obtained + * @param state visibility state of target element + * @param the type of the element to be obtained * @return found shadowed element */ default T findElementInShadowRoot(By locator, Class clazz, ElementState state) { @@ -76,8 +78,8 @@ default T findElementInShadowRoot(By locator, Class claz * Finds an element in the shadow root of the current element with DISPLAYED state * * @param locator shadowed element locator - * @param clazz class or interface of the element to be obtained - * @param the type of the element to be obtained + * @param clazz class or interface of the element to be obtained + * @param the type of the element to be obtained * @return found shadowed element */ default T findElementInShadowRoot(By locator, Class clazz) { @@ -87,7 +89,7 @@ default T findElementInShadowRoot(By locator, Class claz /** * Finds an element in the shadow root of the current element. * - * @param locator Child element locator + * @param locator Child element locator * @param name output name in logs * @param supplier required element's supplier * @param state visibility state of target element @@ -101,7 +103,7 @@ default T findElementInShadowRoot(By locator, String name, /** * Finds an element in the shadow root of the current element with DISPLAYED state * - * @param locator shadowed element locator + * @param locator shadowed element locator * @param name output name in logs * @param supplier required element's supplier * @param the type of the element to be obtained @@ -114,7 +116,7 @@ default T findElementInShadowRoot(By locator, String name, /** * Finds an element in the shadow root of the current element. * - * @param locator shadowed element locator + * @param locator shadowed element locator * @param supplier required element's supplier * @param state visibility state of target element * @param the type of the element to be obtained @@ -127,7 +129,7 @@ default T findElementInShadowRoot(By locator, IElementSuppl /** * Finds an element in the shadow root of the current element with DISPLAYED state * - * @param locator shadowed element locator + * @param locator shadowed element locator * @param supplier required element's supplier * @param the type of the element to be obtained * @return found shadowed element @@ -140,7 +142,8 @@ default T findElementInShadowRoot(By locator, IElementSuppl * Finds displayed shadowed elements by their locator relative to shadow root of the current element. * * @param locator Locator of shadowed elements relative to shadow root. - * @param clazz Class or interface of the elements to be obtained. + * @param clazz Class or interface of the elements to be obtained. + * @param Type of the target elements. * @return List of shadowed elements. */ default List findElementsInShadowRoot(By locator, Class clazz) { @@ -151,8 +154,9 @@ default List findElementsInShadowRoot(By locator, Class< * Finds displayed shadowed elements by their locator relative to shadow root of the current element. * * @param locator Locator of shadowed elements relative to shadow root. - * @param clazz Class or interface of the elements to be obtained. - * @param count Expected number of elements that have to be found (zero, more than zero, any). + * @param clazz Class or interface of the elements to be obtained. + * @param count Expected number of elements that have to be found (zero, more than zero, any). + * @param Type of the target elements. * @return List of shadowed elements. */ default List findElementsInShadowRoot(By locator, Class clazz, ElementsCount count) { @@ -163,8 +167,9 @@ default List findElementsInShadowRoot(By locator, Class< * Finds shadowed elements by their locator relative to shadow root of the current element. * * @param locator Locator of shadowed elements relative to shadow root. - * @param clazz Class or interface of the elements to be obtained. - * @param state Visibility state of shadowed elements. + * @param clazz Class or interface of the elements to be obtained. + * @param state Visibility state of shadowed elements. + * @param Type of the target elements. * @return List of shadowed elements. */ default List findElementsInShadowRoot(By locator, Class clazz, ElementState state) { @@ -175,13 +180,13 @@ default List findElementsInShadowRoot(By locator, Class< * Finds shadowed elements by their locator relative to shadow root of the current element. * * @param locator Locator of shadowed elements relative to shadow root. - * @param clazz Class or interface of the elements to be obtained. - * @param state Visibility state of shadowed elements. - * @param count Expected number of elements that have to be found (zero, more than zero, any). + * @param clazz Class or interface of the elements to be obtained. + * @param state Visibility state of shadowed elements. + * @param count Expected number of elements that have to be found (zero, more than zero, any). + * @param Type of the target elements. * @return List of shadowed elements. */ - default List findElementsInShadowRoot(By locator, Class clazz, ElementState state, - ElementsCount count) { + default List findElementsInShadowRoot(By locator, Class clazz, ElementState state, ElementsCount count) { return findElementsInShadowRoot(locator, null, clazz, state, count); } @@ -189,8 +194,9 @@ default List findElementsInShadowRoot(By locator, Class< * Finds displayed shadowed elements by their locator relative to shadow root of the current element. * * @param locator Locator of shadowed elements relative to shadow root. - * @param name Child elements name. - * @param clazz Class or interface of the elements to be obtained. + * @param name Child elements name. + * @param clazz Class or interface of the elements to be obtained. + * @param Type of the target elements. * @return List of shadowed elements. */ default List findElementsInShadowRoot(By locator, String name, Class clazz) { @@ -201,9 +207,10 @@ default List findElementsInShadowRoot(By locator, String * Finds displayed shadowed elements by their locator relative to shadow root of the current element. * * @param locator Locator of shadowed elements relative to shadow root. - * @param name Child elements name. - * @param clazz Class or interface of the elements to be obtained. - * @param count Expected number of elements that have to be found (zero, more than zero, any). + * @param name Child elements name. + * @param clazz Class or interface of the elements to be obtained. + * @param count Expected number of elements that have to be found (zero, more than zero, any). + * @param Type of the target elements. * @return List of shadowed elements. */ default List findElementsInShadowRoot(By locator, String name, Class clazz, ElementsCount count) { @@ -214,9 +221,10 @@ default List findElementsInShadowRoot(By locator, String * Finds shadowed elements by their locator relative to shadow root of the current element. * * @param locator Locator of shadowed elements relative to shadow root. - * @param name Child elements name. - * @param clazz Class or interface of the elements to be obtained. - * @param state Visibility state of shadowed elements. + * @param name Child elements name. + * @param clazz Class or interface of the elements to be obtained. + * @param state Visibility state of shadowed elements. + * @param Type of the target elements. * @return List of shadowed elements. */ default List findElementsInShadowRoot(By locator, String name, Class clazz, ElementState state) { @@ -226,24 +234,24 @@ default List findElementsInShadowRoot(By locator, String /** * Finds shadowed elements by their locator relative to shadow root of the current element. * - * @param Type of the target elements. + * @param Type of the target elements. * @param locator Locator of shadowed elements relative to shadow root. - * @param name Child elements name. - * @param clazz Class or interface of the elements to be obtained. - * @param state Visibility state of target elements. - * @param count Expected number of elements that have to be found (zero, more than zero, any). + * @param name Child elements name. + * @param clazz Class or interface of the elements to be obtained. + * @param state Visibility state of target elements. + * @param count Expected number of elements that have to be found (zero, more than zero, any). * @return List of shadowed elements. */ - default List findElementsInShadowRoot(By locator, String name, Class clazz, ElementState state, - ElementsCount count) { + default List findElementsInShadowRoot(By locator, String name, Class clazz, ElementState state, ElementsCount count) { return getShadowRootElementFactory().findElements(locator, name, clazz, count, state); } /** * Finds displayed shadowed elements by their locator relative to shadow root of the current element. * - * @param locator Locator of shadowed elements relative to shadow root. + * @param locator Locator of shadowed elements relative to shadow root. * @param supplier Required elements' supplier. + * @param Type of the target elements. * @return List of shadowed elements. */ default List findElementsInShadowRoot(By locator, IElementSupplier supplier) { @@ -253,49 +261,50 @@ default List findElementsInShadowRoot(By locator, IEleme /** * Finds displayed shadowed elements by their locator relative to shadow root of the current element. * - * @param locator Locator of shadowed elements relative to shadow root. + * @param locator Locator of shadowed elements relative to shadow root. * @param supplier Required elements' supplier. * @param count Expected number of elements that have to be found (zero, more than zero, any). + * @param Type of the target elements. * @return List of shadowed elements. */ - default List findElementsInShadowRoot(By locator, IElementSupplier supplier, - ElementsCount count) { + default List findElementsInShadowRoot(By locator, IElementSupplier supplier, ElementsCount count) { return findElementsInShadowRoot(locator, supplier, ElementState.DISPLAYED, count); } /** * Finds shadowed elements by their locator relative to shadow root of the current element. * - * @param locator Locator of shadowed elements relative to shadow root. + * @param locator Locator of shadowed elements relative to shadow root. * @param supplier Required elements' supplier. * @param state Visibility state of shadowed elements. + * @param Type of the target elements. * @return List of shadowed elements. */ - default List findElementsInShadowRoot(By locator, IElementSupplier supplier, - ElementState state) { + default List findElementsInShadowRoot(By locator, IElementSupplier supplier, ElementState state) { return findElementsInShadowRoot(locator, supplier, state, ElementsCount.ANY); } /** * Finds shadowed elements by their locator relative to shadow root of the current element. * - * @param locator Locator of shadowed elements relative to shadow root. + * @param locator Locator of shadowed elements relative to shadow root. * @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). + * @param Type of the target elements. * @return List of shadowed elements. */ - default List findElementsInShadowRoot(By locator, IElementSupplier supplier, ElementState state, - ElementsCount count) { + default List findElementsInShadowRoot(By locator, IElementSupplier supplier, ElementState state, ElementsCount count) { return findElementsInShadowRoot(locator, null, supplier, state, count); } /** * Finds displayed shadowed elements by their locator relative to shadow root of the current element. * - * @param locator Locator of shadowed elements relative to shadow root. + * @param locator Locator of shadowed elements relative to shadow root. * @param name Child elements name. * @param supplier Required elements' supplier. + * @param Type of the target elements. * @return List of shadowed elements. */ default List findElementsInShadowRoot(By locator, String name, IElementSupplier supplier) { @@ -305,28 +314,28 @@ default List findElementsInShadowRoot(By locator, String /** * Finds displayed shadowed elements by their locator relative to shadow root of the current element. * - * @param locator Locator of shadowed elements relative to shadow root. + * @param locator Locator of shadowed elements relative to shadow root. * @param name Child elements name. * @param supplier Required elements' supplier. * @param count Expected number of elements that have to be found (zero, more than zero, any). + * @param Type of the target elements. * @return List of shadowed elements. */ - default List findElementsInShadowRoot(By locator, String name, IElementSupplier supplier, - ElementsCount count) { + default List findElementsInShadowRoot(By locator, String name, IElementSupplier supplier, ElementsCount count) { return findElementsInShadowRoot(locator, name, supplier, ElementState.DISPLAYED, count); } /** * Finds shadowed elements by their locator relative to shadow root of the current element. * - * @param locator Locator of shadowed elements relative to shadow root. + * @param locator Locator of shadowed elements relative to shadow root. * @param name Child elements name. * @param supplier Required elements' supplier. * @param state Visibility state of shadowed elements. + * @param Type of the target elements. * @return List of shadowed elements. */ - default List findElementsInShadowRoot(By locator, String name, IElementSupplier supplier, - ElementState state) { + default List findElementsInShadowRoot(By locator, String name, IElementSupplier supplier, ElementState state) { return findElementsInShadowRoot(locator, name, supplier, state, ElementsCount.ANY); } @@ -334,14 +343,13 @@ default List findElementsInShadowRoot(By locator, String * Finds shadowed elements by their locator relative to shadow root of the current element. * * @param Type of the target elements. - * @param locator Locator of shadowed elements relative to shadow root. + * @param locator Locator of shadowed elements relative to shadow root. * @param name Child elements name. * @param supplier Required elements' supplier. * @param state Visibility state of shadowed elements. * @return List of shadowed elements. */ - default List findElementsInShadowRoot(By locator, String name, IElementSupplier supplier, - ElementState state, ElementsCount count) { + default List findElementsInShadowRoot(By locator, String name, IElementSupplier supplier, ElementState state, ElementsCount count) { return getShadowRootElementFactory().findElements(locator, name, supplier, count, state); } } diff --git a/src/main/java/aquality/selenium/forms/Form.java b/src/main/java/aquality/selenium/forms/Form.java index 6de6886..3ec2654 100644 --- a/src/main/java/aquality/selenium/forms/Form.java +++ b/src/main/java/aquality/selenium/forms/Form.java @@ -30,6 +30,9 @@ public abstract class Form extends aquality.selenium.core.forms.Form { /** * Constructor with parameters + * + * @param locator Locator for specified form. + * @param name Name of specified form. */ protected Form(By locator, String name) { super(IElement.class); @@ -58,6 +61,7 @@ public String getName() { /** * Provides ability to get form's state (whether it is displayed, exists or not) and respective waiting functions. + * * @return state provider of the current form. */ public IElementStateProvider state() { diff --git a/src/main/java/aquality/selenium/logging/DevToolsCommandLoggingOptions.java b/src/main/java/aquality/selenium/logging/DevToolsCommandLoggingOptions.java index 765ba0e..ecab019 100644 --- a/src/main/java/aquality/selenium/logging/DevToolsCommandLoggingOptions.java +++ b/src/main/java/aquality/selenium/logging/DevToolsCommandLoggingOptions.java @@ -17,6 +17,7 @@ public LoggingParameters getCommand() { /** * Sets logging parameters for command info: name and parameters (if any). + * @param command command info logging parameters. */ public void setCommand(LoggingParameters command) { this.command = command; diff --git a/src/main/java/aquality/selenium/logging/HttpExchangeLoggingOptions.java b/src/main/java/aquality/selenium/logging/HttpExchangeLoggingOptions.java index 3cf5ac1..df2d0fa 100644 --- a/src/main/java/aquality/selenium/logging/HttpExchangeLoggingOptions.java +++ b/src/main/java/aquality/selenium/logging/HttpExchangeLoggingOptions.java @@ -13,6 +13,7 @@ public class HttpExchangeLoggingOptions { /** * Gets logging parameters of general request info: Method, URL, Request ID. + * * @return request info logging parameters. */ public LoggingParameters getRequestInfo() { @@ -21,6 +22,8 @@ public LoggingParameters getRequestInfo() { /** * Sets logging parameters of general request info: Method, URL, Request ID. + * + * @param requestInfo request info logging parameters. */ public void setRequestInfo(LoggingParameters requestInfo) { this.requestInfo = requestInfo; @@ -28,6 +31,7 @@ public void setRequestInfo(LoggingParameters requestInfo) { /** * Gets logging parameters of request headers. + * * @return logging parameters of request headers. */ public LoggingParameters getRequestHeaders() { @@ -36,6 +40,8 @@ public LoggingParameters getRequestHeaders() { /** * Sets logging parameters of request headers. + * + * @param requestHeaders logging parameters of request headers. */ public void setRequestHeaders(LoggingParameters requestHeaders) { this.requestHeaders = requestHeaders; @@ -43,6 +49,7 @@ public void setRequestHeaders(LoggingParameters requestHeaders) { /** * Gets logging parameters of request POST data. + * * @return logging parameters of request POST data. */ public LoggingParameters getRequestPostData() { @@ -51,6 +58,8 @@ public LoggingParameters getRequestPostData() { /** * Sets logging parameters of request POST data. + * + * @param requestPostData logging parameters of request POST data. */ public void setRequestPostData(LoggingParameters requestPostData) { this.requestPostData = requestPostData; @@ -58,6 +67,7 @@ public void setRequestPostData(LoggingParameters requestPostData) { /** * Gets logging parameters of general response info: Status code, URL, Resource type, Request ID. + * * @return logging parameters of general response info. */ public LoggingParameters getResponseInfo() { @@ -66,6 +76,8 @@ public LoggingParameters getResponseInfo() { /** * Sets logging parameters of general response info: Status code, URL, Resource type, Request ID. + * + * @param responseInfo logging parameters of general response info. */ public void setResponseInfo(LoggingParameters responseInfo) { this.responseInfo = responseInfo; @@ -73,6 +85,7 @@ public void setResponseInfo(LoggingParameters responseInfo) { /** * Gets logging parameters of response headers. + * * @return logging parameters of response headers. */ public LoggingParameters getResponseHeaders() { @@ -81,6 +94,8 @@ public LoggingParameters getResponseHeaders() { /** * Sets logging parameters of response headers. + * + * @param responseHeaders logging parameters of response headers. */ public void setResponseHeaders(LoggingParameters responseHeaders) { this.responseHeaders = responseHeaders; @@ -88,6 +103,7 @@ public void setResponseHeaders(LoggingParameters responseHeaders) { /** * Gets logging parameters of response body. + * * @return logging parameters of response body. */ public LoggingParameters getResponseBody() { @@ -96,6 +112,8 @@ public LoggingParameters getResponseBody() { /** * Sets logging parameters of response body. + * + * @param responseBody logging parameters of response body. */ public void setResponseBody(LoggingParameters responseBody) { this.responseBody = responseBody; diff --git a/src/test/java/tests/usecases/devtools/DeviceEmulationTest.java b/src/test/java/tests/usecases/devtools/DeviceEmulationTest.java index 789e796..c768b05 100644 --- a/src/test/java/tests/usecases/devtools/DeviceEmulationTest.java +++ b/src/test/java/tests/usecases/devtools/DeviceEmulationTest.java @@ -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.v138.emulation.Emulation; -import org.openqa.selenium.devtools.v138.emulation.model.DisplayFeature; +import org.openqa.selenium.devtools.v139.emulation.Emulation; +import org.openqa.selenium.devtools.v139.emulation.model.DisplayFeature; import org.testng.Assert; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; diff --git a/src/test/java/tests/usecases/devtools/EmulationTests.java b/src/test/java/tests/usecases/devtools/EmulationTests.java index 7c05d72..ef1e2f5 100644 --- a/src/test/java/tests/usecases/devtools/EmulationTests.java +++ b/src/test/java/tests/usecases/devtools/EmulationTests.java @@ -26,11 +26,6 @@ private static EmulationHandling emulation() { protected void beforeMethod() { } - @Test - public void browserCanEmulateTest() { - Assert.assertTrue(emulation().canEmulate(), "Emulation should be supported in browser"); - } - @Test public void setScriptExecutionDisabledAndEnableAgainTest() { AqualityServices.getBrowser().goTo(TheInternetPage.JAVASCRIPT_ALERTS.getAddress()); diff --git a/src/test/java/tests/usecases/devtools/NetworkSpeedEmulationTest.java b/src/test/java/tests/usecases/devtools/NetworkSpeedEmulationTest.java index 5e8f708..11adf78 100644 --- a/src/test/java/tests/usecases/devtools/NetworkSpeedEmulationTest.java +++ b/src/test/java/tests/usecases/devtools/NetworkSpeedEmulationTest.java @@ -2,7 +2,7 @@ import aquality.selenium.browser.AqualityServices; import org.openqa.selenium.TimeoutException; -import org.openqa.selenium.devtools.v138.network.model.ConnectionType; +import org.openqa.selenium.devtools.v139.network.model.ConnectionType; import org.testng.Assert; import org.testng.annotations.Test; import tests.BaseTest; diff --git a/src/test/java/tests/usecases/devtools/OverrideUserAgentTest.java b/src/test/java/tests/usecases/devtools/OverrideUserAgentTest.java index 567aa5f..08fa66b 100644 --- a/src/test/java/tests/usecases/devtools/OverrideUserAgentTest.java +++ b/src/test/java/tests/usecases/devtools/OverrideUserAgentTest.java @@ -8,7 +8,7 @@ import manytools.BrowserLanguageForm; import manytools.UserAgentForm; import org.openqa.selenium.devtools.idealized.Network; -import org.openqa.selenium.devtools.v138.emulation.Emulation; +import org.openqa.selenium.devtools.v139.emulation.Emulation; import org.testng.Assert; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test;