package com.codeborne.selenide.commands;

import com.codeborne.selenide.Command;
import com.codeborne.selenide.SelenideElement;
import com.codeborne.selenide.impl.WebElementSource;
import com.codeborne.selenide.impl.FileDownloader;

import java.io.File;
import java.io.IOException;

public class DownloadFile implements Command<File> {
  @Override
  public File execute(SelenideElement proxy, WebElementSource linkWithHref, Object[] args) throws IOException {
    return FileDownloader.instance.download(linkWithHref.getWebElement());
  }
}

@@ -514,21 +514,37 @@
 ref.
-getWebElement
+findAndAssertElementIsVisible
 ());

Fix #263 Do not allow to download file via invisible link