From 803265b57210f01a4d55f03ace93a0dee8bd5df6 Mon Sep 17 00:00:00 2001 From: Oscar Devora Date: Sat, 25 Nov 2023 13:45:42 -0600 Subject: [PATCH] run format script --- .../selenium/support/events/BUILD.bazel | 2 +- .../support/events/EventFiringDecorator.java | 2 - .../support/events/WebDriverListener.java | 135 ++++++++++-------- 3 files changed, 75 insertions(+), 64 deletions(-) diff --git a/java/src/org/openqa/selenium/support/events/BUILD.bazel b/java/src/org/openqa/selenium/support/events/BUILD.bazel index 14ea52daed378..8cb56480e0102 100644 --- a/java/src/org/openqa/selenium/support/events/BUILD.bazel +++ b/java/src/org/openqa/selenium/support/events/BUILD.bazel @@ -8,7 +8,7 @@ java_library( ], deps = [ "//java/src/org/openqa/selenium:core", + "//java/src/org/openqa/selenium/remote", "//java/src/org/openqa/selenium/support/decorators", - "//java/src/org/openqa/selenium/remote:remote", ], ) diff --git a/java/src/org/openqa/selenium/support/events/EventFiringDecorator.java b/java/src/org/openqa/selenium/support/events/EventFiringDecorator.java index 33e1a626c6f18..c1846bb260643 100644 --- a/java/src/org/openqa/selenium/support/events/EventFiringDecorator.java +++ b/java/src/org/openqa/selenium/support/events/EventFiringDecorator.java @@ -167,7 +167,6 @@ public class EventFiringDecorator extends WebDriverDecorato private final List listeners; /** - * * @param listeners the listeners to notify about events happening in the decorated WebDriver */ public EventFiringDecorator(WebDriverListener... listeners) { @@ -175,7 +174,6 @@ public EventFiringDecorator(WebDriverListener... listeners) { } /** - * * @param targetClass the class of the WebDriver to be decorated * @param listeners the listeners to notify about events happening in the decorated WebDriver */ diff --git a/java/src/org/openqa/selenium/support/events/WebDriverListener.java b/java/src/org/openqa/selenium/support/events/WebDriverListener.java index 87fa4b5b993bb..b55ae99e5d5d2 100644 --- a/java/src/org/openqa/selenium/support/events/WebDriverListener.java +++ b/java/src/org/openqa/selenium/support/events/WebDriverListener.java @@ -50,41 +50,41 @@ public interface WebDriverListener { // Global /** - * This method is called before the execution of any method on the 'target' object. - * It provides a hook for performing actions or logging before any method call. + * This method is called before the execution of any method on the 'target' object. It provides a + * hook for performing actions or logging before any method call. * * @param target The original object on which methods will be invoked. * @param method The method that will be called on the 'target' object. - * @param args The arguments that will be passed to the method. + * @param args The arguments that will be passed to the method. */ default void beforeAnyCall(Object target, Method method, Object[] args) {} /** - * This method is called after the execution of any instance methods on the 'target' object. - * It provides a hook for performing actions or logging after any instance method call. + * This method is called after the execution of any instance methods on the 'target' object. It + * provides a hook for performing actions or logging after any instance method call. * * @param target The original object on which instance methods were invoked. * @param method The method that was called on the 'target' object. - * @param args The arguments passed to the method. - * @param result The result returned by the method. + * @param args The arguments passed to the method. + * @param result The result returned by the method. */ default void afterAnyCall(Object target, Method method, Object[] args, Object result) {} /** - * Notifies registered listeners about an error that occurred during the execution of a decorated method. + * Notifies registered listeners about an error that occurred during the execution of a decorated + * method. * * @param target The original object on which the decorated method was invoked. * @param method The method that encountered an error. - * @param args The arguments passed to the method. - * @param e The InvocationTargetException containing the error details. + * @param args The arguments passed to the method. + * @param e The InvocationTargetException containing the error details. */ default void onError(Object target, Method method, Object[] args, InvocationTargetException e) {} // WebDriver /** - * This method will be called before any method of a {@link WebDriver} instance is - * called. + * This method will be called before any method of a {@link WebDriver} instance is called. * * @param driver - decorated WebDriver instance * @param method - method that will be called @@ -93,8 +93,7 @@ default void onError(Object target, Method method, Object[] args, InvocationTarg default void beforeAnyWebDriverCall(WebDriver driver, Method method, Object[] args) {} /** - * This method will be called after any method of a {@link WebDriver} instance is - * called. + * This method will be called after any method of a {@link WebDriver} instance is called. * * @param driver - decorated WebDriver instance * @param method - method that was called @@ -102,7 +101,7 @@ default void beforeAnyWebDriverCall(WebDriver driver, Method method, Object[] ar * @param result - result of the method call */ default void afterAnyWebDriverCall( - WebDriver driver, Method method, Object[] args, Object result) {} + WebDriver driver, Method method, Object[] args, Object result) {} /** * This method will be called before {@link WebDriver#get(String)} is called. @@ -258,7 +257,8 @@ default void beforeGetWindowHandle(WebDriver driver) {} default void afterGetWindowHandle(WebDriver driver, String result) {} /** - * This method will be called before {@link JavascriptExecutor#executeScript(ScriptKey, Object...)} is called. + * This method will be called before {@link JavascriptExecutor#executeScript(ScriptKey, + * Object...)} is called. * * @param driver - decorated WebDriver instance * @param script - script to be executed @@ -267,7 +267,8 @@ default void afterGetWindowHandle(WebDriver driver, String result) {} default void beforeExecuteScript(WebDriver driver, String script, Object[] args) {} /** - * This method will be called after {@link JavascriptExecutor#executeScript(ScriptKey, Object...)} is called. + * This method will be called after {@link JavascriptExecutor#executeScript(ScriptKey, Object...)} + * is called. * * @param driver - decorated WebDriver instance * @param script - script to be executed @@ -277,7 +278,8 @@ default void beforeExecuteScript(WebDriver driver, String script, Object[] args) default void afterExecuteScript(WebDriver driver, String script, Object[] args, Object result) {} /** - * This method will be called before {@link JavascriptExecutor#executeAsyncScript(String, Object...)}is called. + * This method will be called before {@link JavascriptExecutor#executeAsyncScript(String, + * Object...)}is called. * * @param driver - decorated WebDriver instance * @param script - script to be executed @@ -286,7 +288,8 @@ default void afterExecuteScript(WebDriver driver, String script, Object[] args, default void beforeExecuteAsyncScript(WebDriver driver, String script, Object[] args) {} /** - * This method will be called after {@link JavascriptExecutor#executeAsyncScript(String, Object...)} is called. + * This method will be called after {@link JavascriptExecutor#executeAsyncScript(String, + * Object...)} is called. * * @param driver - decorated WebDriver instance * @param script - script to be executed @@ -294,10 +297,10 @@ default void beforeExecuteAsyncScript(WebDriver driver, String script, Object[] * @param result - result of the script execution */ default void afterExecuteAsyncScript( - WebDriver driver, String script, Object[] args, Object result) {} + WebDriver driver, String script, Object[] args, Object result) {} /** - * This method will be called before {@link Actions#perform()} } is called. + * This method will be called before {@link Actions#perform()} } is called. * * @param driver - decorated WebDriver instance * @param actions - sequence of actions to be performed @@ -305,7 +308,7 @@ default void afterExecuteAsyncScript( default void beforePerform(WebDriver driver, Collection actions) {} /** - * This method will be called after {@link Actions#perform()} } is called. + * This method will be called after {@link Actions#perform()} } is called. * * @param driver - decorated WebDriver instance * @param actions - sequence of actions to be performed @@ -325,11 +328,11 @@ default void beforeResetInputState(WebDriver driver) {} * @param driver - decorated WebDriver instance */ default void afterResetInputState(WebDriver driver) {} + // WebElement /** - * This method will be called before any method of a {@link WebElement} instance is - * called. + * This method will be called before any method of a {@link WebElement} instance is called. * * @param element - decorated WebElement instance * @param method - method that will be called @@ -338,8 +341,7 @@ default void afterResetInputState(WebDriver driver) {} default void beforeAnyWebElementCall(WebElement element, Method method, Object[] args) {} /** - * This method will be called after any method of a {@link WebElement} instance is - * called. + * This method will be called after any method of a {@link WebElement} instance is called. * * @param element - decorated WebElement instance * @param method - method that was called @@ -347,7 +349,7 @@ default void beforeAnyWebElementCall(WebElement element, Method method, Object[] * @param result - result of the method call */ default void afterAnyWebElementCall( - WebElement element, Method method, Object[] args, Object result) {} + WebElement element, Method method, Object[] args, Object result) {} /** * This action will be performed each time before {@link WebElement#click()} is called. @@ -378,7 +380,8 @@ default void beforeSubmit(WebElement element) {} default void afterSubmit(WebElement element) {} /** - * This action will be performed each time before {@link WebElement#sendKeys(CharSequence...)} is called. + * This action will be performed each time before {@link WebElement#sendKeys(CharSequence...)} is + * called. * * @param element - decorated WebElement instance * @param keysToSend - keys to send @@ -417,7 +420,8 @@ default void beforeGetTagName(WebElement element) {} default void afterGetTagName(WebElement element, String result) {} /** - * This action will be performed each time before {@link WebElement#getAttribute(String)} is called. + * This action will be performed each time before {@link WebElement#getAttribute(String)} is + * called. * * @param element - decorated WebElement instance * @param name - name of the attribute @@ -425,7 +429,8 @@ default void afterGetTagName(WebElement element, String result) {} default void beforeGetAttribute(WebElement element, String name) {} /** - * This action will be performed each time after {@link WebElement#getAttribute(String)} is called. + * This action will be performed each time after {@link WebElement#getAttribute(String)} is + * called. * * @param element - decorated WebElement instance * @param name - name of the attribute @@ -558,7 +563,8 @@ default void beforeGetSize(WebElement element) {} default void afterGetSize(WebElement element, Dimension result) {} /** - * This action will be performed each time before {@link WebElement#getCssValue(String)} is called. + * This action will be performed each time before {@link WebElement#getCssValue(String)} is + * called. * * @param element - decorated WebElement instance * @param propertyName - name of the css property @@ -585,7 +591,7 @@ default void afterGetCssValue(WebElement element, String propertyName, String re * @param args - arguments for the method */ default void beforeAnyNavigationCall( - WebDriver.Navigation navigation, Method method, Object[] args) {} + WebDriver.Navigation navigation, Method method, Object[] args) {} /** * This method will be called after any method of a {@link WebDriver.Navigation} instance is @@ -597,7 +603,7 @@ default void beforeAnyNavigationCall( * @param result - result of the method call */ default void afterAnyNavigationCall( - WebDriver.Navigation navigation, Method method, Object[] args, Object result) {} + WebDriver.Navigation navigation, Method method, Object[] args, Object result) {} /** * This action will be performed each time before {@link WebDriver.Navigation#to(String)} is @@ -618,8 +624,7 @@ default void beforeTo(WebDriver.Navigation navigation, String url) {} default void afterTo(WebDriver.Navigation navigation, String url) {} /** - * This action will be performed each time before {@link WebDriver.Navigation#to(URL)} is - * called. + * This action will be performed each time before {@link WebDriver.Navigation#to(URL)} is called. * * @param navigation - decorated WebDriver.Navigation instance * @param url - url to navigate to (can be relative) @@ -627,8 +632,7 @@ default void afterTo(WebDriver.Navigation navigation, String url) {} default void beforeTo(WebDriver.Navigation navigation, URL url) {} /** - * This action will be performed each time after {@link WebDriver.Navigation#to(URL)} is - * called. + * This action will be performed each time after {@link WebDriver.Navigation#to(URL)} is called. * * @param navigation - decorated WebDriver.Navigation instance * @param url - url to navigate to (can be relative) @@ -636,16 +640,14 @@ default void beforeTo(WebDriver.Navigation navigation, URL url) {} default void afterTo(WebDriver.Navigation navigation, URL url) {} /** - * This action will be performed each time before {@link WebDriver.Navigation#back()} is - * called. + * This action will be performed each time before {@link WebDriver.Navigation#back()} is called. * * @param navigation - decorated WebDriver.Navigation instance */ default void beforeBack(WebDriver.Navigation navigation) {} /** - * This action will be performed each time after {@link WebDriver.Navigation#back()} is - * called. + * This action will be performed each time after {@link WebDriver.Navigation#back()} is called. * * @param navigation - decorated WebDriver.Navigation instance */ @@ -660,8 +662,7 @@ default void afterBack(WebDriver.Navigation navigation) {} default void beforeForward(WebDriver.Navigation navigation) {} /** - * This action will be performed each time after {@link WebDriver.Navigation#forward()} is - * called. + * This action will be performed each time after {@link WebDriver.Navigation#forward()} is called. * * @param navigation - decorated WebDriver.Navigation instance */ @@ -676,8 +677,7 @@ default void afterForward(WebDriver.Navigation navigation) {} default void beforeRefresh(WebDriver.Navigation navigation) {} /** - * This action will be performed each time after {@link WebDriver.Navigation#refresh()} is - * called. + * This action will be performed each time after {@link WebDriver.Navigation#refresh()} is called. * * @param navigation - decorated WebDriver.Navigation instance */ @@ -768,7 +768,7 @@ default void beforeAnyOptionsCall(WebDriver.Options options, Method method, Obje * @param result The result of the method call */ default void afterAnyOptionsCall( - WebDriver.Options options, Method method, Object[] args, Object result) {} + WebDriver.Options options, Method method, Object[] args, Object result) {} /** * This action will be performed each time before {@link WebDriver.Options#addCookie(Cookie)} @@ -787,7 +787,8 @@ default void beforeAddCookie(WebDriver.Options options, Cookie cookie) {} default void afterAddCookie(WebDriver.Options options, Cookie cookie) {} /** - * This action will be performed each time before {@link WebDriver.Options#deleteCookieNamed(String)} + * This action will be performed each time before {@link + * WebDriver.Options#deleteCookieNamed(String)} * * @param options - options to delete cookie from * @param name - name of the cookie to delete @@ -795,7 +796,8 @@ default void afterAddCookie(WebDriver.Options options, Cookie cookie) {} default void beforeDeleteCookieNamed(WebDriver.Options options, String name) {} /** - * This action will be performed each time after {@link WebDriver.Options#deleteCookieNamed(String)} + * This action will be performed each time after {@link + * WebDriver.Options#deleteCookieNamed(String)} * * @param options - options to delete cookie from * @param name - name of the cookie to delete @@ -884,10 +886,11 @@ default void beforeAnyTimeoutsCall(WebDriver.Timeouts timeouts, Method method, O * @param result The result of the method call */ default void afterAnyTimeoutsCall( - WebDriver.Timeouts timeouts, Method method, Object[] args, Object result) {} + WebDriver.Timeouts timeouts, Method method, Object[] args, Object result) {} /** - * This action will be performed each time before {@link WebDriver.Timeouts#implicitlyWait(Duration)} is called. + * This action will be performed each time before {@link + * WebDriver.Timeouts#implicitlyWait(Duration)} is called. * * @param timeouts The timeouts object that will be called * @param duration The duration that will be passed to the method @@ -895,7 +898,8 @@ default void afterAnyTimeoutsCall( default void beforeImplicitlyWait(WebDriver.Timeouts timeouts, Duration duration) {} /** - * This action will be performed each time after {@link WebDriver.Timeouts#implicitlyWait(Duration)} is called. + * This action will be performed each time after {@link + * WebDriver.Timeouts#implicitlyWait(Duration)} is called. * * @param timeouts The timeouts object that will be called * @param duration The duration that will be passed to the method @@ -903,7 +907,8 @@ default void beforeImplicitlyWait(WebDriver.Timeouts timeouts, Duration duration default void afterImplicitlyWait(WebDriver.Timeouts timeouts, Duration duration) {} /** - * This action will be performed each time before {@link WebDriver.Timeouts#setScriptTimeout(Duration)} is called. + * This action will be performed each time before {@link + * WebDriver.Timeouts#setScriptTimeout(Duration)} is called. * * @param timeouts The timeouts object that will be called * @param duration The duration that will be passed to the method @@ -911,7 +916,8 @@ default void afterImplicitlyWait(WebDriver.Timeouts timeouts, Duration duration) default void beforeSetScriptTimeout(WebDriver.Timeouts timeouts, Duration duration) {} /** - * This action will be performed each time after {@link WebDriver.Timeouts#setScriptTimeout(Duration)} is called. + * This action will be performed each time after {@link + * WebDriver.Timeouts#setScriptTimeout(Duration)} is called. * * @param timeouts The timeouts object that will be called * @param duration The duration that will be passed to the method @@ -919,7 +925,8 @@ default void beforeSetScriptTimeout(WebDriver.Timeouts timeouts, Duration durati default void afterSetScriptTimeout(WebDriver.Timeouts timeouts, Duration duration) {} /** - * This action will be performed each time before {@link WebDriver.Timeouts#pageLoadTimeout(Duration)} is called. + * This action will be performed each time before {@link + * WebDriver.Timeouts#pageLoadTimeout(Duration)} is called. * * @param timeouts The timeouts object that will be called * @param duration The duration that will be passed to the method @@ -927,7 +934,8 @@ default void afterSetScriptTimeout(WebDriver.Timeouts timeouts, Duration duratio default void beforePageLoadTimeout(WebDriver.Timeouts timeouts, Duration duration) {} /** - * This action will be performed each time after {@link WebDriver.Timeouts#pageLoadTimeout(Duration)} is called. + * This action will be performed each time after {@link + * WebDriver.Timeouts#pageLoadTimeout(Duration)} is called. * * @param timeouts The timeouts object that will be called * @param duration The duration that will be passed to the method @@ -954,7 +962,7 @@ default void beforeAnyWindowCall(WebDriver.Window window, Method method, Object[ * @param result The result of the method call */ default void afterAnyWindowCall( - WebDriver.Window window, Method method, Object[] args, Object result) {} + WebDriver.Window window, Method method, Object[] args, Object result) {} /** * This action will be performed each time before {@link WebDriver.Window#getSize()} is called. @@ -972,7 +980,8 @@ default void beforeGetSize(WebDriver.Window window) {} default void afterGetSize(WebDriver.Window window, Dimension result) {} /** - * This action will be performed each time before {@link WebDriver.Window#setSize(Dimension)} is called. + * This action will be performed each time before {@link WebDriver.Window#setSize(Dimension)} is + * called. * * @param window The window object that will be called * @param size The size that will be passed to the method @@ -980,7 +989,8 @@ default void afterGetSize(WebDriver.Window window, Dimension result) {} default void beforeSetSize(WebDriver.Window window, Dimension size) {} /** - * This action will be performed each time after {@link WebDriver.Window#setSize(Dimension)} is called. + * This action will be performed each time after {@link WebDriver.Window#setSize(Dimension)} is + * called. * * @param window The window object that will be called * @param size The size that will be passed to the method @@ -988,7 +998,8 @@ default void beforeSetSize(WebDriver.Window window, Dimension size) {} default void afterSetSize(WebDriver.Window window, Dimension size) {} /** - * This action will be performed each time before {@link WebDriver.Window#getPosition()} is called. + * This action will be performed each time before {@link WebDriver.Window#getPosition()} is + * called. * * @param window The window object that will be called */ @@ -1003,7 +1014,8 @@ default void beforeGetPosition(WebDriver.Window window) {} default void afterGetPosition(WebDriver.Window window, Point result) {} /** - * This action will be performed each time before {@link WebDriver.Window#setPosition(Point)} is called. + * This action will be performed each time before {@link WebDriver.Window#setPosition(Point)} is + * called. * * @param window The window object that will be called * @param position The position that will be passed to the method @@ -1011,7 +1023,8 @@ default void afterGetPosition(WebDriver.Window window, Point result) {} default void beforeSetPosition(WebDriver.Window window, Point position) {} /** - * This action will be performed each time after {@link WebDriver.Window#setPosition(Point)} is called. + * This action will be performed each time after {@link WebDriver.Window#setPosition(Point)} is + * called. * * @param window The window object that will be called * @param position The position that will be passed to the method