-
- All Implemented Interfaces:
-
ai.platon.pulsar.crawl.fetch.driver.WebDriver,java.io.Closeable,java.lang.AutoCloseable,kotlin.Comparable
public final class MockWebDriver extends AbstractWebDriver
-
-
Field Summary
Fields Modifier and Type Field Description private StringmockPageSourceprivate final WebDriverrealDriverprivate final BrowserTypebrowserTypeprivate final BooleansupportJavascriptprivate final BooleanisMockedPageSourceprivate final StringsessionIdprivate final BrowserInstanceIdbrowserInstanceIdprivate final Function1<String, Long>delayPolicyprivate final Integeridprivate DurationidleTimeoutprivate final BooleanisCanceledprivate final BooleanisCrashedprivate final BooleanisFreeprivate final BooleanisIdleprivate final BooleanisNotWorkingprivate final BooleanisQuitprivate final BooleanisRetiredprivate final BooleanisWorkingprivate InstantlastActiveTimeprivate final Stringnameprivate ProxyEntryproxyEntryprivate final AtomicReference<AbstractWebDriver.Status>statusprivate Stringurlprivate DurationwaitForTimeout
-
Constructor Summary
Constructors Constructor Description MockWebDriver(BrowserInstanceId browserInstanceId, Function0<ChromeDevtoolsDriver> backupDriverCreator)
-
Method Summary
-
Methods inherited from class ai.platon.pulsar.protocol.browser.driver.test.MockWebDriver
cancel, compareTo, equals, evaluateSilently, free, hashCode, retire, startWork, waitFor -
Methods inherited from class ai.platon.pulsar.crawl.fetch.driver.AbstractWebDriver
click, exists, type, waitFor -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
MockWebDriver
MockWebDriver(BrowserInstanceId browserInstanceId, Function0<ChromeDevtoolsDriver> backupDriverCreator)
-
-
Method Detail
-
getMockPageSource
final String getMockPageSource()
-
setMockPageSource
final Unit setMockPageSource(String mockPageSource)
-
getRealDriver
final WebDriver getRealDriver()
-
getBrowserType
BrowserType getBrowserType()
-
getSupportJavascript
Boolean getSupportJavascript()
-
getIsMockedPageSource
Boolean getIsMockedPageSource()
-
getSessionId
String getSessionId()
-
getBrowserInstanceId
BrowserInstanceId getBrowserInstanceId()
-
getDelayPolicy
Function1<String, Long> getDelayPolicy()
-
getIdleTimeout
Duration getIdleTimeout()
-
setIdleTimeout
Unit setIdleTimeout(Duration idleTimeout)
-
getIsCanceled
Boolean getIsCanceled()
-
getIsCrashed
final Boolean getIsCrashed()
-
getIsNotWorking
final Boolean getIsNotWorking()
-
getIsRetired
Boolean getIsRetired()
-
getIsWorking
final Boolean getIsWorking()
-
getLastActiveTime
Instant getLastActiveTime()
-
setLastActiveTime
Unit setLastActiveTime(Instant lastActiveTime)
-
getProxyEntry
final ProxyEntry getProxyEntry()
-
setProxyEntry
final Unit setProxyEntry(ProxyEntry proxyEntry)
-
getStatus
final AtomicReference<AbstractWebDriver.Status> getStatus()
-
getWaitForTimeout
final Duration getWaitForTimeout()
-
setWaitForTimeout
final Unit setWaitForTimeout(Duration waitForTimeout)
-
setTimeouts
Unit setTimeouts(BrowserSettings driverConfig)
-
navigateTo
Unit navigateTo(String url)
-
stopLoading
Unit stopLoading()
-
currentUrl
String currentUrl()
-
pageSource
String pageSource()
-
bringToFront
Unit bringToFront()
-
-
-
-