Skip to content

Commit

Permalink
Keep using the proxy driver for all operations
Browse files Browse the repository at this point in the history
  • Loading branch information
Artur- committed Oct 27, 2017
1 parent 6339e37 commit e04fc3e
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ public String getCssValue(String propertyName) {
@Override
public void click(int x, int y, Keys... modifiers) {
waitForVaadin();
Actions actions = new Actions(getCommandExecutor().getWrappedDriver());
Actions actions = new Actions(getDriver());
actions.moveToElement(actualElement, x, y);
// Press any modifier keys
for (Keys modifier : modifiers) {
Expand Down Expand Up @@ -337,7 +337,7 @@ public TestBenchCommandExecutor getTestBenchCommandExecutor() {

@Override
public WebDriver getDriver() {
return getCommandExecutor().getWrappedDriver();
return getCommandExecutor().getDriver();
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,15 +124,15 @@ public void waitForVaadin() {

@Override
public boolean compareScreen(String referenceId) throws IOException {
WebDriver driver = getWrappedDriver();
WebDriver driver = getDriver();
return ScreenshotComparator.compareScreen(referenceId,
referenceNameGenerator, imageComparison,
(TakesScreenshot) driver, (HasCapabilities) driver);
}

@Override
public boolean compareScreen(File reference) throws IOException {
WebDriver driver = getWrappedDriver();
WebDriver driver = getDriver();
return ScreenshotComparator.compareScreen(reference, imageComparison,
(TakesScreenshot) driver, (HasCapabilities) driver);

Expand All @@ -141,7 +141,7 @@ public boolean compareScreen(File reference) throws IOException {
@Override
public boolean compareScreen(BufferedImage reference, String referenceName)
throws IOException {
WebDriver driver = getWrappedDriver();
WebDriver driver = getDriver();
return ScreenshotComparator.compareScreen(reference, referenceName,
imageComparison, (TakesScreenshot) driver,
(HasCapabilities) driver);
Expand Down Expand Up @@ -239,7 +239,7 @@ public Object executeAsyncScript(String script, Object... args) {
}

/**
* Return a reference to the {@link WebDriver} instance associated with this
* Return a reference to the {@link WebDriver} instance wrapped by this
* {@link TestBenchCommandExecutor}
*
* @return a WebDriver instance
Expand All @@ -248,6 +248,19 @@ public WebDriver getWrappedDriver() {
return actualDriver;
}

/**
* Return a reference to the {@link WebDriver} instance associated with this
* {@link TestBenchCommandExecutor}
*
* @return a WebDriver instance
*/
public WebDriver getDriver() {
// This is actually never called. The overridden version in
// TestBenchDriverProy is. This class hierarchy is wrong in several
// ways.
return actualDriver;
}

@Override
public void resizeViewPortTo(final int desiredWidth,
final int desiredHeight) throws UnsupportedOperationException {
Expand Down

0 comments on commit e04fc3e

Please sign in to comment.