Package io.testproject.sdk
Class DriverBuilder<T extends ReportingDriver>
- java.lang.Object
-
- io.testproject.sdk.DriverBuilder<T>
-
- Type Parameters:
T- Any of the supported drivers implementing theReportingDriverinterface.
public final class DriverBuilder<T extends ReportingDriver> extends java.lang.ObjectUtility class to build Driver instances.
-
-
Constructor Summary
Constructors Constructor Description DriverBuilder(org.openqa.selenium.Capabilities capabilities)Initializes a new instance of the builder.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Tbuild(java.lang.Class<T> clazz)Builds an instance of the requested driver using set values.DriverBuilder<T>withCapabilities(org.openqa.selenium.Capabilities capabilities)Set capabilities that should be passed to the server for session initialization.DriverBuilder<T>withJobName(java.lang.String jobName)Set Job name to be used for reporting.DriverBuilder<T>withProjectName(java.lang.String projectName)Set Project name to be used for reporting.DriverBuilder<T>withRemoteAddress(java.net.URL remoteAddress)Set an Agent API base URL (e.g.DriverBuilder<T>withReportName(java.lang.String reportName)Set the name of the generated report.DriverBuilder<T>withReportPath(java.lang.String reportPath)Set the path of the generated report.DriverBuilder<T>withReportsDisabled(boolean disableReports)Set flag to enable or disable reports.DriverBuilder<T>withReportType(ReportType reportType)Set report type - cloud, local or both.DriverBuilder<T>withToken(java.lang.String token)Set a development token to authorize with the Agent.
-
-
-
Constructor Detail
-
DriverBuilder
public DriverBuilder(org.openqa.selenium.Capabilities capabilities)
Initializes a new instance of the builder. Builder can be conveniently used to initialize new Drivers.- Parameters:
capabilities- Capabilities that should be passed to the server for session initialization.
-
-
Method Detail
-
withCapabilities
public DriverBuilder<T> withCapabilities(org.openqa.selenium.Capabilities capabilities)
Set capabilities that should be passed to the server for session initialization. Token can be obtained from the SDK page.- Parameters:
capabilities- Capabilities to be set.- Returns:
- Modified builder.
-
withToken
public DriverBuilder<T> withToken(java.lang.String token)
Set a development token to authorize with the Agent. Token can be obtained from the SDK page.- Parameters:
token- Token to be set.- Returns:
- Modified builder.
-
withRemoteAddress
public DriverBuilder<T> withRemoteAddress(java.net.URL remoteAddress)
Set an Agent API base URL (e.g. http://localhost:8585/).- Parameters:
remoteAddress- URL to be set.- Returns:
- Modified builder.
-
withProjectName
public DriverBuilder<T> withProjectName(java.lang.String projectName)
Set Project name to be used for reporting.- Parameters:
projectName- Project name to be set.- Returns:
- Modified builder.
-
withJobName
public DriverBuilder<T> withJobName(java.lang.String jobName)
Set Job name to be used for reporting.- Parameters:
jobName- Job name to be set.- Returns:
- Modified builder.
-
withReportsDisabled
public DriverBuilder<T> withReportsDisabled(boolean disableReports)
Set flag to enable or disable reports. Note: Once disabled during driver construction, reports can not be enabled later.- Parameters:
disableReports- True to disable or False to enable reports.- Returns:
- Modified builder.
-
withReportType
public DriverBuilder<T> withReportType(ReportType reportType)
Set report type - cloud, local or both.- Parameters:
reportType- report type - cloud, local or both.- Returns:
- Modified builder.
-
withReportName
public DriverBuilder<T> withReportName(java.lang.String reportName)
Set the name of the generated report.- Parameters:
reportName- The name to give to the generated report.- Returns:
- Modified builder.
-
withReportPath
public DriverBuilder<T> withReportPath(java.lang.String reportPath)
Set the path of the generated report.- Parameters:
reportPath- The path to the generated report.- Returns:
- Modified builder.
-
-