Class MapElement
java.lang.Object
com.vaadin.testbench.TestBenchElement
com.vaadin.flow.component.map.testbench.MapElement
- All Implemented Interfaces:
com.vaadin.testbench.commands.CanCompareScreenshots,com.vaadin.testbench.HasCallFunction,com.vaadin.testbench.HasDriver,com.vaadin.testbench.HasElementQuery,com.vaadin.testbench.HasPropertySettersGetters,com.vaadin.testbench.HasSearchContext,com.vaadin.testbench.HasTestBenchCommandExecutor,org.openqa.selenium.SearchContext,org.openqa.selenium.TakesScreenshot,org.openqa.selenium.WebElement,org.openqa.selenium.WrapsElement
public class MapElement
extends com.vaadin.testbench.TestBenchElement
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classAbstract class for wrapping an in-browser OpenLayers configuration class instance.static classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic class -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclickAtCoordinates(double x, double y) Performs a native click at the specified map coordinates.voidDisables all interactions that could interfere with a test, such as double-click to zoom.com.vaadin.testbench.TestBenchElementGets the attribution container divList<com.vaadin.testbench.TestBenchElement>Gets the list of attributions list items in the attribution container divReturns aMapElement.ConfigurationObjectReferencewrapper for the OpenLayers map instance.getPixelCoordinates(double x, double y) Returns the pixel coordinates of the specifiedxandymap coordinates.getPixelCoordinates(double x, double y, boolean relativeToCenter) Returns the pixel coordinates of the specifiedxandymap coordinates.Methods inherited from class com.vaadin.testbench.TestBenchElement
callFunction, clear, click, click, compareScreen, compareScreen, compareScreen, contextClick, dispatchEvent, dispatchEvent, doubleClick, equals, executeScript, findElement, findElements, focus, getAttribute, getCapabilities, getChildren, getClassNames, getCommandExecutor, getContext, getCssValue, getDomAttribute, getDomProperty, getDriver, getId, getLocation, getParent, getProperty, getPropertyBoolean, getPropertyDouble, getPropertyElement, getPropertyElements, getPropertyInteger, getPropertyString, getRect, getScreenshotAs, getShadowRoot, getSize, getTagName, getText, getWrappedElement, hasAttribute, hasClassName, hashCode, hover, init, init, isChrome, isDisplayed, isEnabled, isFirefox, isFocused, isReadOnly, isSelected, scroll, scrollIntoView, scrollLeft, sendKeys, setProperty, setProperty, setProperty, setProperty, submit, waitForVaadin, waitUntil, waitUntil, wrap, wrapElement, wrapElementsMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.vaadin.testbench.HasElementQuery
$, $Methods inherited from interface org.openqa.selenium.WebElement
getAccessibleName, getAriaRole
-
Constructor Details
-
MapElement
public MapElement()
-
-
Method Details
-
getMapReference
Returns aMapElement.ConfigurationObjectReferencewrapper for the OpenLayers map instance. Used to access nested configuration objects in the browser and extract values from them to be used for assertions. -
clickAtCoordinates
public void clickAtCoordinates(double x, double y) Performs a native click at the specified map coordinates. The method will convert the coordinates into pixel values, and perform a click on the map at the calculated pixel offset.- Parameters:
x-y-
-
getPixelCoordinates
Returns the pixel coordinates of the specifiedxandymap coordinates.The pixel coordinates are based from the top-left corner of the map.
- Parameters:
x- the x map coordinatey- the y map coordinate- Returns:
- the equivalent pixel coordinate on the map element
-
getPixelCoordinates
Returns the pixel coordinates of the specifiedxandymap coordinates.If
relativeToCenteristrue, then the pixel coordinates are based from the center of the map. This is useful for Selenium mouse actions, which are based off of the center of the element. IfrelativeToCenterisfalse, then the pixel coordinates are based from the top-left corner of the map.- Parameters:
x- the x map coordinatey- the y map coordinaterelativeToCenter- whether to base the resulting pixel coordinates from the center of the map element- Returns:
- the equivalent pixel coordinate on the map element
-
getAttributionContainer
public com.vaadin.testbench.TestBenchElement getAttributionContainer()Gets the attribution container div- Returns:
- attribution container div
-
getAttributionItems
Gets the list of attributions list items in the attribution container div- Returns:
- list of list items
-
disableInteractions
public void disableInteractions()Disables all interactions that could interfere with a test, such as double-click to zoom.
-