module OA
  class UploadCheckDeletionPage < OA::BasePage
    page_url "/accounting/delete_checks.php"

    link(:download_template_link, text: 'Download "Delete Payment" template') # this could use an id
    file_field(:choose_file, name: "prmUserFile")
    button(:upload_button, name: "exUpload")
    element(:validation_errors, :tr, id: "delete-checks-errors")

    def template_url
      download_template_link_element.href
    end

    def upload_file(file_path)
      self.choose_file = file_path
      upload_button
    end
  end
end
