Package io.karatelabs.driver.cdp
Class CdpDriverOptions
java.lang.Object
io.karatelabs.driver.cdp.CdpDriverOptions
- All Implemented Interfaces:
DriverOptions
CDP-specific driver configuration options.
Implements DriverOptions interface and adds CDP-specific settings.
Supports both Builder pattern and Map constructor for v1 compatibility.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic CdpDriverOptions.Builderbuilder()static CdpDriverOptionsGet additional Chrome args.Get executable path.intGet highlight duration in milliseconds.getHost()Get page load strategy.intgetPort()Get the pre-submit hash (set by submit(), cleared after next action).intGet retry count for operations.intGet retry interval in milliseconds.getScope()Get driver scope (default: "scenario").intGet timeout in milliseconds.Get timeout as Duration.booleanCheck if driver scope is "caller" (V1-style behavior).booleanCheck headless mode.booleanCheck if element highlighting is enabled.booleanCheck if screenshots should be taken on failure.booleanisStop()Whether the browser should be quit at scenario end.voidsetPreSubmitHash(String hash) Set the pre-submit hash.voidsetTimeout(int millis) Update the operation timeout in milliseconds.
-
Method Details
-
builder
-
fromMap
-
getTimeout
public int getTimeout()Description copied from interface:DriverOptionsGet timeout in milliseconds.- Specified by:
getTimeoutin interfaceDriverOptions
-
setTimeout
public void setTimeout(int millis) Description copied from interface:DriverOptionsUpdate the operation timeout in milliseconds. Used byDriver.timeout(int)for v1 parity (mid-scenario timeout tweaks).- Specified by:
setTimeoutin interfaceDriverOptions
-
getRetryCount
public int getRetryCount()Description copied from interface:DriverOptionsGet retry count for operations.- Specified by:
getRetryCountin interfaceDriverOptions
-
getRetryInterval
public int getRetryInterval()Description copied from interface:DriverOptionsGet retry interval in milliseconds.- Specified by:
getRetryIntervalin interfaceDriverOptions
-
isHeadless
public boolean isHeadless()Check headless mode. Falls back to KARATE_DRIVER_HEADLESS env var if not set explicitly.- Specified by:
isHeadlessin interfaceDriverOptions
-
getHost
-
getPort
public int getPort() -
getExecutable
Get executable path. Falls back to KARATE_CHROME_EXECUTABLE env var if not set explicitly. -
getUserDataDir
-
getUserAgent
-
isScreenshotOnFailure
public boolean isScreenshotOnFailure()Description copied from interface:DriverOptionsCheck if screenshots should be taken on failure.- Specified by:
isScreenshotOnFailurein interfaceDriverOptions
-
isHighlight
public boolean isHighlight()Description copied from interface:DriverOptionsCheck if element highlighting is enabled.- Specified by:
isHighlightin interfaceDriverOptions
-
getHighlightDuration
public int getHighlightDuration()Description copied from interface:DriverOptionsGet highlight duration in milliseconds.- Specified by:
getHighlightDurationin interfaceDriverOptions
-
getPageLoadStrategy
Description copied from interface:DriverOptionsGet page load strategy.- Specified by:
getPageLoadStrategyin interfaceDriverOptions
-
getPreSubmitHash
Description copied from interface:DriverOptionsGet the pre-submit hash (set by submit(), cleared after next action).- Specified by:
getPreSubmitHashin interfaceDriverOptions
-
setPreSubmitHash
Description copied from interface:DriverOptionsSet the pre-submit hash. Called by submit() to record page state before action.- Specified by:
setPreSubmitHashin interfaceDriverOptions
-
getAddOptions
Get additional Chrome args. Merges explicit addOptions with KARATE_CHROME_ARGS env var. -
getWebSocketUrl
-
getScope
Get driver scope (default: "scenario").- "scenario" - driver released at scenario end (pooled behavior)
- "caller" - driver propagates to caller hierarchy (V1 behavior)
-
isCallerScope
public boolean isCallerScope()Check if driver scope is "caller" (V1-style behavior). -
isStop
public boolean isStop()Description copied from interface:DriverOptionsWhether the browser should be quit at scenario end. Default true. When false, the driver process and browser are intentionally left alive so the DOM can be inspected after the run — typically used for one-off UI debugging. v1 parity:configure driver = { ..., stop: false }.- Specified by:
isStopin interfaceDriverOptions
-
getTimeoutDuration
Description copied from interface:DriverOptionsGet timeout as Duration.- Specified by:
getTimeoutDurationin interfaceDriverOptions
-