Skip to content

fix: Make unit tests compatible with Selenium 4.33.0+ #2293

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 19, 2025
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import org.openqa.selenium.logging.Logs;
import org.openqa.selenium.remote.Response;

import java.time.Duration;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -155,20 +156,72 @@ public Cookie getCookieNamed(String name) {
@Override
public Timeouts timeouts() {
return new Timeouts() {
@Override
/**
* Does nothing.
*
* @param time The amount of time to wait.
* @param unit The unit of measure for {@code time}.
* @return A self reference.
* @deprecated Kept for the backward compatibility, should be removed when a minimum Selenium
* version is bumped to 4.33.0 or higher.
*/
@Deprecated
public Timeouts implicitlyWait(long time, TimeUnit unit) {
return this;
}

@Override
public Timeouts implicitlyWait(Duration duration) {
return this;
}

/**
* Does nothing.
*
* @param time The timeout value.
* @param unit The unit of time.
* @return A self reference.
* @deprecated Kept for the backward compatibility, should be removed when Selenium client removes
* this method from its interface.
*/
@Deprecated
public Timeouts setScriptTimeout(long time, TimeUnit unit) {
return this;
}

@Override
/**
* Does nothing.
*
* @param duration The timeout value.
* @return A self reference.
* @deprecated Kept for the backward compatibility, should be removed when Selenium client removes
* this method from its interface.
*/
@Deprecated
public Timeouts setScriptTimeout(Duration duration) {
return this;
}

public Timeouts scriptTimeout(Duration duration) {
return this;
}

/**
* Does nothing.
*
* @param time The timeout value.
* @param unit The unit of time.
* @return A self reference.
* @deprecated Kept for the backward compatibility, should be removed when Selenium client removes
* this method from its interface.
*/
@Deprecated
public Timeouts pageLoadTimeout(long time, TimeUnit unit) {
return this;
}

public Timeouts pageLoadTimeout(Duration duration) {
return this;
}
};
}

Expand Down