Class PDFExportOptionsModal


  • public class PDFExportOptionsModal
    extends BaseModal
    Represents the actions possible on the modal used to configure and trigger the PDF export.
    Since:
    14.4.2, 14.5
    Version:
    $Id: 74f0023777e7f205a3a9396d4063e59293712ad1 $
    • Constructor Detail

      • PDFExportOptionsModal

        public PDFExportOptionsModal()
        Default constructor.
    • Method Detail

      • open

        public static PDFExportOptionsModal open​(ViewPage viewPage)
        Opens the PDF export options modal for the given page.
        Parameters:
        viewPage - the page for which to open the PDF export options modal
        Returns:
        the PDF export options modal
      • getTemplateSelect

        public org.openqa.selenium.support.ui.Select getTemplateSelect()
        Returns:
        the select used to specify the PDF template
      • getCoverCheckbox

        public org.openqa.selenium.WebElement getCoverCheckbox()
        Returns:
        the checkbox used to control whether the PDF cover page is generated or not
      • getTocCheckbox

        public org.openqa.selenium.WebElement getTocCheckbox()
        Returns:
        the checkbox used to control whether the PDF Table of Contents page is generated or not
      • getHeaderCheckbox

        public org.openqa.selenium.WebElement getHeaderCheckbox()
        Returns:
        the checkbox used to control whether the PDF header is generated or not
      • getFooterCheckbox

        public org.openqa.selenium.WebElement getFooterCheckbox()
        Returns:
        the checkbox used to control whether the PDF footer is generated or not
      • export

        public PDFDocument export​(URL hostURL,
                                  String userName,
                                  String password)
                           throws IOException
        Click on the export button and wait for the PDF document to be generated.
        Parameters:
        hostURL - the URL that can be used to access the XWiki instance from the test code; this may be different than the URL used by the browser (e.g. in case the browser is running inside a Docker container)
        userName - the user name used to access the generated PDF document
        password - the password used to access the generated PDF document
        Returns:
        the generated PDF document
        Throws:
        IOException - if the PDF export fails