-
Notifications
You must be signed in to change notification settings - Fork 564
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
Fix CDP download for custom browsers #2728
Conversation
9161041
to
43364d0
Compare
import org.openqa.selenium.WebDriver; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@PetroOv Please avoid massive changing order of imports. Let them rest in peace.
@@ -42,6 +49,7 @@ void openFileUploadForm() { | |||
Configuration.remote = gridUrl.toString(); | |||
Configuration.browserCapabilities.setCapability("se:downloadsEnabled", true); | |||
Configuration.fileDownload = CDP; | |||
closeWebDriver(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it will slow down all previous tests.
Let's close the browser only in one test.
} | ||
Optional<HasDevTools> cdpBrowser = cast(driver.getWebDriver(), HasDevTools.class); | ||
if (cdpBrowser.isPresent()) { | ||
DevTools devTools = cdpBrowser.get().getDevTools(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem is that Firefox doesn't support downloading files via CDP.
We need to exclude Firefox in this IF. @PetroOv
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't know it( I returned isChromium check, but now we get browser name from capabilities of instance
43364d0
to
2af8482
Compare
Quality Gate passedIssues Measures |
Proposed changes
This PR fixes IllegalArgumentException for custom DriverProvider/DriverFactory when they support cdp
Checklist
gradlew check chrome_headless firefox_headless
command