From 7db84343ed011146cdaf3e9ca663df220179818b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=ABl=20Kr=C3=A4hemann?= <joel.kraehemann@frentix.com> Date: Wed, 17 Oct 2012 08:52:24 +0200 Subject: [PATCH] OO-348: fixed unsafe waitForPageToLoad() in test --- .../olat/repository/FunctionalCatalogTest.java | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/test/java/org/olat/repository/FunctionalCatalogTest.java b/src/test/java/org/olat/repository/FunctionalCatalogTest.java index 809597271ea..1024ee8f566 100644 --- a/src/test/java/org/olat/repository/FunctionalCatalogTest.java +++ b/src/test/java/org/olat/repository/FunctionalCatalogTest.java @@ -169,6 +169,8 @@ public class FunctionalCatalogTest { /* verify resources */ for(int i = 0; i < courses; i++){ + functionalUtil.idle(browser); + /* click on catalog root */ StringBuffer selectorBuffer = new StringBuffer(); @@ -176,8 +178,6 @@ public class FunctionalCatalogTest { .append(functionalRepositorySiteUtil.getCatalogNavigationCss()) .append("')]//a"); - functionalUtil.idle(browser); - if(browser.isElementPresent(selectorBuffer.toString())){ browser.click(selectorBuffer.toString()); } @@ -186,11 +186,13 @@ public class FunctionalCatalogTest { String[] selectors = functionalRepositorySiteUtil.createCatalogSelectors(SUBCATEGORY_PATHS_INCLUDING_RESOURCE[i]); for(String currentSelector: selectors){ + functionalUtil.idle(browser); + functionalUtil.waitForPageToLoadElement(browser, currentSelector.toString()); browser.click(currentSelector); } - - functionalUtil.waitForPageToLoad(browser); + + functionalUtil.idle(browser); /* click first course and retrieve business path */ selectorBuffer = new StringBuffer(); @@ -203,12 +205,16 @@ public class FunctionalCatalogTest { String businessPath0 = functionalUtil.getDeploymentUrl() + "/url/RepositoryEntry/" + courseVO[i].getRepoEntryKey(); boolean found = false; + /* click show all */ + //FIXME:JK: implement me + for(int j = 0; j < browser.getXpathCount(selectorBuffer.toString().substring(6)).intValue(); j++){ + functionalUtil.idle(browser); functionalUtil.waitForPageToLoadElement(browser, selectorBuffer.toString() + "[" + (j + 1) + "]"); browser.click(selectorBuffer.toString() + "[" + (j + 1) + "]"); - - functionalUtil.waitForPageToLoad(browser); + + functionalUtil.idle(browser); String businessPath1 = functionalUtil.currentBusinessPath(browser); functionalCourseUtil.closeActiveTab(browser); -- GitLab