All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.selenide.grid.DownloadFileFromGridWithCdp Maven / Gradle / Ivy

The newest version!
package org.selenide.grid;

import com.codeborne.selenide.DownloadsFolder;
import com.codeborne.selenide.Driver;
import com.codeborne.selenide.impl.DownloadFileWithCdp;
import org.jspecify.annotations.Nullable;

import java.io.File;

public class DownloadFileFromGridWithCdp extends DownloadFileWithCdp {
  @Nullable
  @Override
  protected DownloadsFolder getDownloadsFolder(Driver driver) {
    return driver.isLocalBrowser() ?
      super.getDownloadsFolder(driver) :
      new GridDownloadsFolder(driver);
  }

  @Override
  protected File archiveFile(Driver driver, File downloadedFile) {
    if (driver.isLocalBrowser()) {
      return super.archiveFile(driver, downloadedFile);
    }
    return GridDownloader.archiveFile(downloader, driver, downloadedFile);
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy