Skip to content
Snippets Groups Projects
Commit 7db84343 authored by Joël Krähemann's avatar Joël Krähemann
Browse files

OO-348: fixed unsafe waitForPageToLoad() in test

parent 8d64248e
No related branches found
No related tags found
No related merge requests found
...@@ -169,6 +169,8 @@ public class FunctionalCatalogTest { ...@@ -169,6 +169,8 @@ public class FunctionalCatalogTest {
/* verify resources */ /* verify resources */
for(int i = 0; i < courses; i++){ for(int i = 0; i < courses; i++){
functionalUtil.idle(browser);
/* click on catalog root */ /* click on catalog root */
StringBuffer selectorBuffer = new StringBuffer(); StringBuffer selectorBuffer = new StringBuffer();
...@@ -176,8 +178,6 @@ public class FunctionalCatalogTest { ...@@ -176,8 +178,6 @@ public class FunctionalCatalogTest {
.append(functionalRepositorySiteUtil.getCatalogNavigationCss()) .append(functionalRepositorySiteUtil.getCatalogNavigationCss())
.append("')]//a"); .append("')]//a");
functionalUtil.idle(browser);
if(browser.isElementPresent(selectorBuffer.toString())){ if(browser.isElementPresent(selectorBuffer.toString())){
browser.click(selectorBuffer.toString()); browser.click(selectorBuffer.toString());
} }
...@@ -186,11 +186,13 @@ public class FunctionalCatalogTest { ...@@ -186,11 +186,13 @@ public class FunctionalCatalogTest {
String[] selectors = functionalRepositorySiteUtil.createCatalogSelectors(SUBCATEGORY_PATHS_INCLUDING_RESOURCE[i]); String[] selectors = functionalRepositorySiteUtil.createCatalogSelectors(SUBCATEGORY_PATHS_INCLUDING_RESOURCE[i]);
for(String currentSelector: selectors){ for(String currentSelector: selectors){
functionalUtil.idle(browser);
functionalUtil.waitForPageToLoadElement(browser, currentSelector.toString()); functionalUtil.waitForPageToLoadElement(browser, currentSelector.toString());
browser.click(currentSelector); browser.click(currentSelector);
} }
functionalUtil.waitForPageToLoad(browser); functionalUtil.idle(browser);
/* click first course and retrieve business path */ /* click first course and retrieve business path */
selectorBuffer = new StringBuffer(); selectorBuffer = new StringBuffer();
...@@ -203,12 +205,16 @@ public class FunctionalCatalogTest { ...@@ -203,12 +205,16 @@ public class FunctionalCatalogTest {
String businessPath0 = functionalUtil.getDeploymentUrl() + "/url/RepositoryEntry/" + courseVO[i].getRepoEntryKey(); String businessPath0 = functionalUtil.getDeploymentUrl() + "/url/RepositoryEntry/" + courseVO[i].getRepoEntryKey();
boolean found = false; boolean found = false;
/* click show all */
//FIXME:JK: implement me
for(int j = 0; j < browser.getXpathCount(selectorBuffer.toString().substring(6)).intValue(); j++){ for(int j = 0; j < browser.getXpathCount(selectorBuffer.toString().substring(6)).intValue(); j++){
functionalUtil.idle(browser);
functionalUtil.waitForPageToLoadElement(browser, selectorBuffer.toString() + "[" + (j + 1) + "]"); functionalUtil.waitForPageToLoadElement(browser, selectorBuffer.toString() + "[" + (j + 1) + "]");
browser.click(selectorBuffer.toString() + "[" + (j + 1) + "]"); browser.click(selectorBuffer.toString() + "[" + (j + 1) + "]");
functionalUtil.waitForPageToLoad(browser); functionalUtil.idle(browser);
String businessPath1 = functionalUtil.currentBusinessPath(browser); String businessPath1 = functionalUtil.currentBusinessPath(browser);
functionalCourseUtil.closeActiveTab(browser); functionalCourseUtil.closeActiveTab(browser);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment