Package com.vaadin.flow.testutil
Class DevToolsWrapper
java.lang.Object
com.vaadin.flow.testutil.DevToolsWrapper
Controls browser network conditions through the Chrome DevTools Protocol.
The CDP commands are built by hand rather than through the generated
org.openqa.selenium.devtools.vNNN classes or the version-independent
Domains facade in front of them. Selenium picks a generated
implementation by matching the browser major version against the CDP
implementations it bundles, and it only ever falls back to an implementation
older than the browser. A Selenium release bundles the few newest Chrome
versions, so a browser older than all of them matches nothing and resolves to
a no-op implementation that throws on every call. The commands used here are
part of the stable CDP surface and are sent over the raw connection, which
makes them work with any Chrome version.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voidsetCacheDisabled(Boolean isDisabled) Controls the `Disable cache` option in DevTools via the corresponding Selenium API.voidsetOfflineEnabled(Boolean isEnabled) Controls the throttling `Offline` option in DevTools via the corresponding Selenium API.
-
Constructor Details
-
DevToolsWrapper
public DevToolsWrapper(org.openqa.selenium.WebDriver driver)
-
-
Method Details
-
setOfflineEnabled
Controls the throttling `Offline` option in DevTools via the corresponding Selenium API.- Parameters:
isEnabled- whether to enable the offline mode.
-
setCacheDisabled
Controls the `Disable cache` option in DevTools via the corresponding Selenium API.- Parameters:
isDisabled- whether to disable the browser cache.
-
close
public void close()
-