diff options
author | Martin Stockhammer <martin_s@apache.org> | 2017-06-11 22:40:32 +0200 |
---|---|---|
committer | Martin Stockhammer <martin_s@apache.org> | 2017-06-11 22:40:32 +0200 |
commit | a674bda129314af2a601cdde7f28905e5f423c15 (patch) | |
tree | f7515fc57a0c4ee6ffc6630a3d2d388a83a4e0a2 /archiva-modules/archiva-web | |
parent | 7abf559673a7e76c1f7fcf0ab2b64c1efb46f828 (diff) | |
download | archiva-a674bda129314af2a601cdde7f28905e5f423c15.tar.gz archiva-a674bda129314af2a601cdde7f28905e5f423c15.zip |
Trying to stabilize htmlunit tests
Diffstat (limited to 'archiva-modules/archiva-web')
2 files changed, 11 insertions, 5 deletions
diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/parent/AbstractArchivaTest.java b/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/parent/AbstractArchivaTest.java index 44907ab2e..66696bc2e 100644 --- a/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/parent/AbstractArchivaTest.java +++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/parent/AbstractArchivaTest.java @@ -116,11 +116,11 @@ public abstract class AbstractArchivaTest el.click(); - wait.until(ExpectedConditions.textToBePresentInElementLocated(By.id("user-messages"),"User " + userName + " created." )); - assertElementPresent( "users-grid-user-id-" + userName ); - if ( valid ) { + wait.until(ExpectedConditions.textToBePresentInElementLocated(By.id("user-messages"),"User " + userName + " created." )); + wait.until(ExpectedConditions.visibilityOfElementLocated( By.id("users-grid-user-id-" + userName) )); + //String[] columnValues = { userName, fullName, emailAd }; //assertElementPresent( XPathExpressionUtil.getTableRow( columnValues ) ); diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/parent/AbstractSeleniumTest.java b/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/parent/AbstractSeleniumTest.java index b6741b19b..4d51fa270 100644 --- a/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/parent/AbstractSeleniumTest.java +++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/parent/AbstractSeleniumTest.java @@ -647,8 +647,14 @@ public abstract class AbstractSeleniumTest } 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()); + // Elements may be stale and throw an exception, if the location is requested + try + { + Point elLoc = el.getLocation(); + logger.info( "Location: x={} y={}", elLoc.getX(), elLoc.getY() ); + } catch (Throwable e2) { + logger.info("Could not determine location"); + } } ex = e; count--; |