-
- 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 BrowserInstancebrowserInstanceprivate 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 final AtomicReference<AbstractWebDriver.Status>statusprivate Stringurlprivate DurationwaitForTimeout
-
Constructor Summary
Constructors Constructor Description MockWebDriver(MockBrowserInstance browserInstance, Function0<ChromeDevtoolsDriver> backupDriverCreator)
-
Method Summary
-
Methods inherited from class ai.platon.pulsar.protocol.browser.driver.test.MockWebDriver
allAttrs, allTexts, cancel, compareTo, equals, evaluateSilently, firstAttr, firstText, free, hashCode, loadResource, newSession, outerHTML, retire, scrollDown, scrollUp, startWork, waitForNavigation, waitForNavigation, waitForSelector, waitForSelector -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
MockWebDriver
MockWebDriver(MockBrowserInstance browserInstance, 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()
-
getBrowserInstance
BrowserInstance getBrowserInstance()
-
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)
-
getStatus
final AtomicReference<AbstractWebDriver.Status> getStatus()
-
getWaitForTimeout
final Duration getWaitForTimeout()
-
setWaitForTimeout
final Unit setWaitForTimeout(Duration waitForTimeout)
-
waitForSelector
Long waitForSelector(String selector, Duration timeout)
-
waitForNavigation
Long waitForNavigation(Duration timeout)
-
setTimeouts
Unit setTimeouts(BrowserSettings browserSettings)
-
navigateTo
Unit navigateTo(String url)
-
mainRequestHeaders
Map<String, Object> mainRequestHeaders()
-
mainRequestCookies
List<Map<String, String>> mainRequestCookies()
-
getCookies
List<Map<String, String>> getCookies()
-
currentUrl
String currentUrl()
-
pageSource
String pageSource()
-
bringToFront
Unit bringToFront()
-
-
-
-