Package com.isomorphic.autotest

# Interface DriverConfiguration

All Known Implementing Classes:
  `TestRunnerDriver`

public interface DriverConfiguration
Defines the setters available to configure how TestRunner is run when invoked via the wrapper class `TestRunnerDriver`.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `setAlertEmail(String recipient)`
  Sets recipient email address for batch report email.
  `void`
  `setBatchCommit(boolean commit)`
  Sets whether this batch run should be committed to the batchRun DS.
  `void`
  `setBatchLog(String message)`
  Sets the log message to be entered into the BatchRun DS for this batch run, You may include any details or description for the batch run.
  `void`
  `setBranch(String branch)`
  Sets the branch identifier to be entered in the BatchRun DS for this batch run, and used to compare against previous runs (if comparing differences).
  `void`
  `setBrowser(String browser)`
  Sets the browser that will be used by Selenium to run the HTML scripts.
  `void`
  `setCaptureScreenshot()`
  Configures TestRunner to capture a PNG screenshot of the browser if a Selenium test fails, adding the image to the test result record.
  `void`
  `setCcEmail(String recipient)`
  Sets recipient email address for batch report email.
  `void`
  `setFileRoot(String path)`
  Sets the root directory for all other file system paths.
  `void`
  `setFiles(String[] files)`
  Specifies an explicit set of Selenium HTML test script files to run.
  `void`
  `setHeadless(boolean headless)`
  Sets whether to run the browser in headless mode (without visible GUI).
  `void`
  `setHttpPort(int port)`
  Sets the HTTP port of the target to which TestRunner should connect when running Selenium open() commands in the Selenium HTML scripts.
  `void`
  `setHttpTarget(String target)`
  Sets the HTTP target webserver to which TestRunner should connect when running Selenium open() commands in the Selenium HTML scripts.
  `void`
  `setMailHost(String mailHost)`
  Sets the mail host to use when sending mail.
  `void`
  `setMailSubject(String subject)`
  Sets subject line base to use when sending the email reporting batch results.
  `void`
  `setMailTemplate(String template)`
  Sets velocity template file to use for generation of the batch report email body.
  `void`
  `setMaximizeBrowser(boolean maximize)`
  Sets whether to maximize the browser for Selenium tests.
  `void`
  `setNoEmail()`
  Disables sending any email for this batch run.
  `void`
  `setRepeatEmail(String recipient)`
  Sets recipient email address for batch report email.
  `void`
  `setSaveMessages()`
  Configures TestRunner to save the ISC Console Developer Messages to each test record for diagnostic purposes.
  `void`
  `setSeleniumTemplateFile(String path)`
  Sets the path to the template file for the Selenium HTML scripts.
  `void`
  `setSeleniumTimeout(int timeout)`
  Sets the timeout for the Selenium test as a whole, in seconds.
  `void`
  `setSenderEmail(String sender)`
  Sets sender email address for batch report email.
  `void`
  `setServerFileRoot(String path)`
  Sets the root directory on the target server used for looking up relative URLs in Selenium commands.
  `void`
  `setServerLogMode(String mode)`
  Configures TestRunner to collect the ISC Server Log Messages for each test for diagnostic purposes.
  `void`
  `setServerLogOutputMethod(String out)`
  Configures output method that TestRunner will use to report/persist any server log messages; only has an effect for server log modes of "some" or "all".
  `void`
  `setTestRoot(String path)`
  Sets the Selenium HTML test script root directory.
  `void`
  `setTimestamp(Date timestamp)`
  Specifies which previous batch run should be used as the baseline to compare against the current batch run.
  `void`
  `setUserName(String userName)`
  Sets the user name to be entered into the BatchRun DS for this batch run.
  `void`
  `setWebDriverLegacyMode(boolean legacyMode)`
  Sets whether to use legacy mode for Firefox browser.

- ## Method Details

  - ### setFileRoot

    void setFileRoot(String path)
    Sets the root directory for all other file system paths. If not set, defaults to the current working directory in which Java was launched.
    Parameters:
      `path` - file system root directory for TestRunner

  - ### setTestRoot

    void setTestRoot(String path)
    Sets the Selenium HTML test script root directory. Accepts an absolute path or path relative to the file root.

    If the driver is being run in s servlet container, then this path must use Unix-style path separators (forward slashes) and be absolute (starting with a separator). In the host filesystem, the path will be interpreted relative to the root container directory.

    Parameters:
      `path` - test script root directory

  - ### setServerFileRoot

    void setServerFileRoot(String path)
    Sets the root directory on the target server used for looking up relative URLs in Selenium commands.
    Parameters:
      `path` - server file system root directory

  - ### setSeleniumTemplateFile

    void setSeleniumTemplateFile(String path)
    Sets the path to the template file for the Selenium HTML scripts.
    Parameters:
      `path` - path to selenium template

  - ### setHttpTarget

    void setHttpTarget(String target)
    Sets the HTTP target webserver to which TestRunner should connect when running Selenium open() commands in the Selenium HTML scripts.
    Parameters:
      `target` - HTTP target

  - ### setHttpPort

    void setHttpPort(int port)
    Sets the HTTP port of the target to which TestRunner should connect when running Selenium open() commands in the Selenium HTML scripts.
    Parameters:
      `port` - HTTP port

  - ### setFiles

    void setFiles(String[] files)
    Specifies an explicit set of Selenium HTML test script files to run. Each file is either interpreted as a relative path from the test root directory, or as simply a filename with no path information, the presence of a path separator controlling the decision. If just a filename, it matches any file with that name beneath the test root directory.
    Parameters:
      `files` - test script files to run

  - ### setUserName

    void setUserName(String userName)
    Sets the user name to be entered into the BatchRun DS for this batch run.
    Parameters:
      `userName` - name of user for batch log and email purposes

  - ### setBatchLog

    void setBatchLog(String message)
    Sets the log message to be entered into the BatchRun DS for this batch run, You may include any details or description for the batch run.
    Parameters:
      `message` - log message to commit for this batch run

  - ### setBranch

    void setBranch(String branch)
    Sets the branch identifier to be entered in the BatchRun DS for this batch run, and used to compare against previous runs (if comparing differences).
    Parameters:
      `branch` - branch identifier to commit for this batch run

  - ### setTimestamp

    void setTimestamp(Date timestamp)
    Specifies which previous batch run should be used as the baseline to compare against the current batch run.
    Parameters:
      `timestamp` - desired timestamp of baseline batch to compare with current

  - ### setBrowser

    void setBrowser(String browser)
    Sets the browser that will be used by Selenium to run the HTML scripts. The syntax is the same as specified by the Selenium documentation.
    Parameters:
      `browser` - browser specification (passed through to Selenium)

  - ### setWebDriverLegacyMode

    void setWebDriverLegacyMode(boolean legacyMode)
    Sets whether to use legacy mode for Firefox browser. Legacy mode may have better compatibility for emulation of Selenese scripts with current Selenium releases, but can only be used with older browsers, such as Firefox 52ESR, and not with Firefox 60ESR.
    Parameters:
      `legacyMode` - whether to use legacy mode for Firefox browser

  - ### setHeadless

    void setHeadless(boolean headless)
    Sets whether to run the browser in headless mode (without visible GUI). Headless mode is supported by Firefox and Chrome only. This is useful for running tests on servers without displays or in CI/CD pipelines.
    Parameters:
      `headless` - whether to run browser in headless mode

  - ### setBatchCommit

    void setBatchCommit(boolean commit)
    Sets whether this batch run should be committed to the batchRun DS. This is useful for overriding the default behavior, which may depend on which options have been set. If a batchRun DS record is committed, the test results will also be persisted to the testResult DS.
    Parameters:
      `commit` - whether to commit

  - ### setAlertEmail

    void setAlertEmail(String recipient)
    Sets recipient email address for batch report email. If the "repeat email" recipient has also been set via setRepeatEmail(), this address will only receive "alert email" - reports where fixes or regressions are present. Otherwise, it will receive all batch report email.
    Parameters:
      `recipient` - email address

  - ### setRepeatEmail

    void setRepeatEmail(String recipient)
    Sets recipient email address for batch report email. If the "alert email" recipient has also been set via setAlertEmail(), this address will only receive "repeat email" - reports where no fixes or regressions are present. Otherwise, it will receive all batch report email.
    Parameters:
      `recipient` - email address

  - ### setCcEmail

    void setCcEmail(String recipient)
    Sets recipient email address for batch report email. This recipient will always be CC'd a copy of the batch report email, regardless of fixes or regressions present.
    Parameters:
      `recipient` - email address

  - ### setSenderEmail

    void setSenderEmail(String sender)
    Sets sender email address for batch report email. Only needed if there is a problem sending email using the sender address generated by default.
    Parameters:
      `sender` - email address

  - ### setNoEmail

    void setNoEmail()
    Disables sending any email for this batch run. If email addresses have not been set through this interface and have not been specified in server.properties, this is not needed. However, it may be used to suppress email when default recipients are configured in server.properties.

  - ### setMailHost

    void setMailHost(String mailHost)
    Sets the mail host to use when sending mail. This may be useful for overcoming anti-spam measures present when connecting to the default mail host.
    Parameters:
      `mailHost` - mail host

  - ### setMailSubject

    void setMailSubject(String subject)
    Sets subject line base to use when sending the email reporting batch results. Info about regressions and fixes will be appended to the provided subject content.
    Parameters:
      `subject` - subject line

  - ### setMailTemplate

    void setMailTemplate(String template)
    Sets velocity template file to use for generation of the batch report email body.
    Parameters:
      `template` - batch report mail template file

  - ### setSaveMessages

    void setSaveMessages()
    Configures TestRunner to save the ISC Console Developer Messages to each test record for diagnostic purposes.

  - ### setServerLogMode

    void setServerLogMode(String mode)
    Configures TestRunner to collect the ISC Server Log Messages for each test for diagnostic purposes. Legal modes are:
    - none - don't collect any logs
    - some - collect logs if script executes captureServerLogs() command
    - all - collect logs for all scripts, automatically
    Parameters:
      `mode` - sets collection mode

  - ### setServerLogOutputMethod

    void setServerLogOutputMethod(String out)
    Configures output method that TestRunner will use to report/persist any server log messages; only has an effect for server log modes of "some" or "all". Legal values are:
    - email - attach logs to report email
    - datasource - store logs in the test record
    - both - attach logs and store in test record
    Parameters:
      `out` - sets output method

  - ### setCaptureScreenshot

    void setCaptureScreenshot()
    Configures TestRunner to capture a PNG screenshot of the browser if a Selenium test fails, adding the image to the test result record.

  - ### setMaximizeBrowser

    void setMaximizeBrowser(boolean maximize)
    Sets whether to maximize the browser for Selenium tests. If not explicitly set via this call, the browser will be maximized if and only if screenshots are being taken.
    Parameters:
      `maximize` - whether to maximize the browser

  - ### setSeleniumTimeout

    void setSeleniumTimeout(int timeout)
    Sets the timeout for the Selenium test as a whole, in seconds.
    Parameters:
      `timeout` - sets timeout in seconds