public class TestBenchCommandExecutor extends Object implements TestBenchCommands, HasDriver
| Constructor and Description |
|---|
TestBenchCommandExecutor(ImageComparison imageComparison,
ReferenceNameGenerator referenceNameGenerator) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
compareScreen(BufferedImage reference,
String referenceName)
Tests that a screen shot is equal to the specified reference image.
|
boolean |
compareScreen(File reference)
Tests that a screen shot is equal to the specified reference image.
|
boolean |
compareScreen(String referenceId)
Tests that a screen shot is equal to the specified reference image.
|
void |
disableWaitForVaadin()
Disables implicit waiting for Vaadin to finish processing requests.
|
void |
enableWaitForVaadin()
Enables implicit waiting for Vaadin to finish processing requests.
|
protected Object |
executeAsyncScript(String script,
Object... args) |
Object |
executeScript(String script,
Object... args) |
void |
focusElement(TestBenchElement testBenchElement) |
TestBenchDriverProxy |
getDriver()
Return a reference to the
WebDriver instance associated with this
TestBenchCommandExecutor |
ImageComparison |
getImageComparison()
Gets the image comparison implementation used for screenshots.
|
ReferenceNameGenerator |
getReferenceNameGenerator()
Gets the name generator used for screenshot references.
|
String |
getRemoteControlName()
Finds the canonical host name of the remotely executing node where the
test is being run.
|
boolean |
isAutoScrollIntoView()
Whether or not the elements should be scrolled into the visible area of
the browser window before interacting with them
|
void |
resizeViewPortTo(int desiredWidth,
int desiredHeight)
Tries to resize the browsers window so that the space available for
actual web content (aka viewport) is of given size.
|
void |
setAutoScrollIntoView(boolean autoScrollIntoView)
Sets if the elements should be scrolled into the visible area of the
browser window before interacting with them
|
void |
setDriver(TestBenchDriverProxy driver) |
long |
timeSpentRenderingLastRequest()
This method provides performance information of the client-side rendering
for the last operation performed.
|
long |
timeSpentServicingLastRequest()
This method provides performance information of the server-side
processing for the last request.
|
long |
totalTimeSpentRendering()
This method provides performance information of the client-side rendering
for the entire session.
|
long |
totalTimeSpentServicingRequests()
This method provides performance information of the server-side
processing for the entire session.
|
void |
waitForVaadin()
Block until Vaadin reports it has finished processing server messages.
|
public TestBenchCommandExecutor(ImageComparison imageComparison, ReferenceNameGenerator referenceNameGenerator)
public void setDriver(TestBenchDriverProxy driver)
public String getRemoteControlName()
TestBenchCommandsgetRemoteControlName in interface TestBenchCommandspublic void waitForVaadin()
public boolean compareScreen(String referenceId) throws IOException
CanCompareScreenshotscompareScreen in interface CanCompareScreenshotsreferenceId - the ID of the reference imageIOException - if there was a problem accessing the reference imagepublic boolean compareScreen(File reference) throws IOException
CanCompareScreenshotscompareScreen in interface CanCompareScreenshotsreference - the reference image fileIOException - if there was a problem accessing the reference imagepublic boolean compareScreen(BufferedImage reference, String referenceName) throws IOException
CanCompareScreenshotscompareScreen in interface CanCompareScreenshotsreference - the reference imagereferenceName - the filename of the reference image. Used when writing the
error files.IOException - if there was a problem accessing the reference imagepublic long timeSpentRenderingLastRequest()
TestBenchCommandsTestBenchCommands.timeSpentRenderingLastRequest() or
TestBenchCommands.totalTimeSpentServicingRequests(), since they will perform an
extra request, causing the value returned from this method to be that for
an empty request/response.timeSpentRenderingLastRequest in interface TestBenchCommandspublic long totalTimeSpentRendering()
TestBenchCommandstotalTimeSpentRendering in interface TestBenchCommandspublic long timeSpentServicingLastRequest()
TestBenchCommandsTestBenchCommands.timeSpentRenderingLastRequest()
before calling this method. This is due to the fact that this method
causes an extra server round-trip, which will cause an empty response to
be rendered.timeSpentServicingLastRequest in interface TestBenchCommandspublic long totalTimeSpentServicingRequests()
TestBenchCommandsTestBenchCommands.timeSpentRenderingLastRequest()
before calling this method. This is due to the fact that this method
causes an extra server round-trip, which will cause an empty response to
be rendered.totalTimeSpentServicingRequests in interface TestBenchCommandspublic void disableWaitForVaadin()
TestBenchCommandsdisableWaitForVaadin in interface TestBenchCommandspublic void enableWaitForVaadin()
TestBenchCommandsenableWaitForVaadin in interface TestBenchCommandspublic boolean isAutoScrollIntoView()
trueisAutoScrollIntoView in interface TestBenchCommandspublic void setAutoScrollIntoView(boolean autoScrollIntoView)
setAutoScrollIntoView in interface TestBenchCommandspublic TestBenchDriverProxy getDriver()
WebDriver instance associated with this
TestBenchCommandExecutorpublic void resizeViewPortTo(int desiredWidth,
int desiredHeight)
throws UnsupportedOperationException
TestBenchCommandsNote, that the result cannot be guaranteed on all platforms. For example browsers in mobile devices are most often always fullscreen and their viewport can be "simultated". Also browsers might not allow resizing the window or limit size of window to minimum or maximum (often limited by screen size). Currently most common desktop browsers support this.
resizeViewPortTo in interface TestBenchCommandsdesiredWidth - the desired width of the viewportdesiredHeight - the desired height of the viewportUnsupportedOperationExceptionpublic void focusElement(TestBenchElement testBenchElement)
public ReferenceNameGenerator getReferenceNameGenerator()
public ImageComparison getImageComparison()
Copyright © 2019. All rights reserved.