You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The PR adds a new abstract method to the HasDownloads interface without a default implementation, which will break existing implementations that don't extend RemoteWebDriver. Consider providing a default implementation that uses the static utility method.
Add the @OverRide annotation to the isDownloadsEnabled() method since it implements a method from the HasDownloads interface. This improves code clarity and allows the compiler to verify correct implementation.
+@Override
public boolean isDownloadsEnabled() {
return HasDownloads.isDownloadsEnabled(capabilities);
}
Apply / Chat
Suggestion importance[1-10]: 4
__
Why: The suggestion correctly identifies that the @Override annotation should be added since isDownloadsEnabled() implements an interface method from HasDownloads. This is a minor but valid code style improvement.
That's something strange. Today isDownloadsEnabled(), tomorrow isUploadEnabled(). Who enables it? I want to believe it should be determined by the initiator. And core question who is "initiator".
That's something strange. Today isDownloadsEnabled(), tomorrow isUploadEnabled(). Who enables it? I want to believe it should be determined by the initiator. And core question who is "initiator".
I absolutely agree with you: in a typical "test automation" project, the initiator knows.
But my case is different: I want to check it in a generic testing library.
I am implementing "file download" method. I receive the webdriver from end-user, and I need to check if the downloads are enabled.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
User description
💥 What does this PR do?
I want to add method
RemoteWebDriver.isDownloadsEnabled()which re🔧 Motivation
I need to check if current webdriver has capability
se:downloadsEnabled.My scenario looks like this:
🔄 Types of changes
HasDownloads, but don't extendRemoteWebDriver, will need to implement methodisDownloadsEnabled().PR Type
Enhancement
Description
Add
isDownloadsEnabled()method toRemoteWebDriverRequire
HasDownloadsimplementors to defineisDownloadsEnabled()Refactor download capability check in
HasDownloadsChanges walkthrough 📝
HasDownloads.java
Add and refactor downloads-enabled capability checks in HasDownloadsjava/src/org/openqa/selenium/HasDownloads.java
isDownloadsEnabled()method to interfacerequireDownloadsEnabledto use new methodRemoteWebDriver.java
Implement isDownloadsEnabled() in RemoteWebDriverjava/src/org/openqa/selenium/remote/RemoteWebDriver.java
isDownloadsEnabled()using HasDownloads utility