Browse Source

Trying additional fix for chrome WebDriver

citest
Martin Stockhammer 7 years ago
parent
commit
0643a0fb3f

+ 13
- 3
archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/parent/AbstractSeleniumTest.java View File

@@ -37,6 +37,7 @@ import java.util.function.Function;

import org.openqa.selenium.*;
import org.openqa.selenium.htmlunit.HtmlUnitDriver;
import org.openqa.selenium.interactions.Actions;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.FluentWait;
import org.openqa.selenium.support.ui.Select;
@@ -626,16 +627,24 @@ public abstract class AbstractSeleniumTest
WebDriverWait wait = new WebDriverWait( getWebDriver(), maxWaitTimeInS );
V result = null;
Exception ex = null;
WebElement el = null;
while(count>0)
{
try
{
WebElement el = wait.until(ExpectedConditions.elementToBeClickable( clickableLocator ));
el = wait.until(ExpectedConditions.elementToBeClickable( clickableLocator ));
Actions actions = new Actions(getWebDriver());
actions.moveToElement(el);
actions.perform();
el.click();
result = wait.until( conditions );
count=0;
ex = null;
return result;
} catch (Exception e) {
logger.info("Error: {}, {}, {}",count,e.getClass().getName(), e.getMessage());
if (el!=null) {
Point elLoc = el.getLocation();
logger.info("Location: x={} y={}", elLoc.getX(), elLoc.getY());
}
ex = e;
count--;
}
@@ -694,6 +703,7 @@ public abstract class AbstractSeleniumTest
result = wait.until( conditions );
return result;
} catch (Exception e) {
logger.info("Error: {}, {}",count, e.getMessage());
ex = e;
count--;
}

+ 2
- 2
src/ci/docker/webtest/Dockerfile View File

@@ -65,8 +65,8 @@ COPY chrome_launcher.sh /usr/bin/google-chrome
RUN chmod +x /opt/bin/entry_point.sh
RUN chmod +x /usr/bin/google-chrome

ENV SCREEN_WIDTH 1360
ENV SCREEN_HEIGHT 1020
ENV SCREEN_WIDTH 1600
ENV SCREEN_HEIGHT 1200
ENV SCREEN_DEPTH 24
ENV X_START_NUM=3


+ 3
- 0
src/ci/scripts/container_webtest.sh View File

@@ -33,6 +33,9 @@ INSTANCE_NAME="archiva-webtest"
PORT_MAPPING="4444:4444"
NETWORK_TYPE="host"

export SCREEN_WIDTH="1600"
export SCREEN_HEIGHT="1200"

HERE=`dirname $0`

TAG="${CONTAINER_NAME}:${CONTAINER_VERSION}"

Loading…
Cancel
Save