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

OO-296, OO-306: replaced obsolete code within addToEPorfolio().

parent eeee1f7f
No related branches found
No related tags found
No related merge requests found
......@@ -918,19 +918,7 @@ public class FunctionalCourseUtil {
functionalEPortfolioUtil.fillInTags(browser, tags);
/* fill in wizard - destination */
String selector = functionalEPortfolioUtil.createSelector(binder, page, structure);
functionalUtil.waitForPageToLoadElement(browser, selector);
browser.click(selector);
selectorBuffer = new StringBuffer();
selectorBuffer.append("xpath=//li[contains(@class, 'x-tree-node')]//a//span[contains(text(), '")
.append((structure != null) ? structure: page)
.append("')]");
functionalUtil.waitForPageToLoadElement(browser, selectorBuffer.toString());
functionalEPortfolioUtil.selectTree(browser, binder, page, structure);
}
/* click finish */
......
......@@ -586,6 +586,8 @@ public class FunctionalEPortfolioUtil {
functionalUtil.waitForPageToLoad(browser);
boolean modified = false;
/* fill in wizard - title */
if(title != null){
selectorBuffer = new StringBuffer();
......@@ -596,6 +598,8 @@ public class FunctionalEPortfolioUtil {
functionalUtil.waitForPageToLoadElement(browser, selectorBuffer.toString());
browser.type(selectorBuffer.toString(), title);
modified = true;
}
/* fill in wizard - display */
......@@ -610,24 +614,32 @@ public class FunctionalEPortfolioUtil {
functionalUtil.waitForPageToLoadElement(browser, selectorBuffer.toString());
browser.click(selectorBuffer.toString());
modified = true;
}
/* fill in wizard - description */
functionalUtil.typeMCE(browser, description);
if(description != null){
functionalUtil.typeMCE(browser, description);
modified = true;
}
/* fill in wizard - save */
selectorBuffer = new StringBuffer();
if(modified){
selectorBuffer = new StringBuffer();
selectorBuffer.append("xpath=//div[contains(@class, '")
.append(getEPortfolioMapCss())
.append("')]//form//button[last() and contains(@class, '")
.append(functionalUtil.getButtonDirtyCss())
.append("')]");
functionalUtil.waitForPageToLoadElement(browser, selectorBuffer.toString());
browser.click(selectorBuffer.toString());
functionalUtil.waitForPageToLoad(browser);
selectorBuffer.append("xpath=//div[contains(@class, '")
.append(getEPortfolioMapCss())
.append("')]//form//button[last() and contains(@class, '")
.append(functionalUtil.getButtonDirtyCss())
.append("')]");
functionalUtil.waitForPageToLoadElement(browser, selectorBuffer.toString());
browser.click(selectorBuffer.toString());
functionalUtil.waitForPageToLoad(browser);
}
return(true);
}
......@@ -641,6 +653,15 @@ public class FunctionalEPortfolioUtil {
* @return
*/
public boolean renamePage(Selenium browser, String binder, String oldName, String newName){
/* wait until tree has loaded */
StringBuffer locatorBuffer = new StringBuffer();
locatorBuffer.append("xpath=//li[contains(@class, '")
.append(functionalUtil.getTreeNodeLoadingCss())
.append("')]");
functionalUtil.waitForPageToUnloadElement(browser, locatorBuffer.toString());
/* select page */
String selector = createSelector(binder, oldName, null);
functionalUtil.waitForPageToLoadElement(browser, selector);
......@@ -826,6 +847,7 @@ public class FunctionalEPortfolioUtil {
functionalUtil.waitForPageToLoadElement(browser, selectorBuffer.toString());
browser.click(selectorBuffer.toString());
/* */
functionalUtil.waitForPageToLoadElement(browser, createSelector(binder, page, title));
return(true);
......@@ -1006,33 +1028,6 @@ public class FunctionalEPortfolioUtil {
return(fillInTags(browser, tags, true));
}
protected boolean selectTree(Selenium browser, String binder, String page, String structure){
String selector = createSelector(binder, page, structure);
/* wait until tree has loaded */
StringBuffer locatorBuffer = new StringBuffer();
locatorBuffer.append("xpath=//li[contains(@class, '")
.append(functionalUtil.getTreeNodeLoadingCss())
.append("')]");
functionalUtil.waitForPageToUnloadElement(browser, locatorBuffer.toString());
/* click selector */
functionalUtil.waitForPageToLoadElement(browser, selector);
browser.click(selector);
locatorBuffer = new StringBuffer();
locatorBuffer.append("xpath=//li[contains(@class, 'x-tree-node')]//a//span[contains(text(), '")
.append((structure != null) ? structure: page)
.append("')]");
functionalUtil.waitForPageToLoadElement(browser, locatorBuffer.toString());
return(true);
}
/**
* Fills in the open wizard's tags.
*
......@@ -1080,6 +1075,42 @@ public class FunctionalEPortfolioUtil {
return(true);
}
/**
* Selects a tree node.
*
* @param browser
* @param binder
* @param page
* @param structure
* @return
*/
protected boolean selectTree(Selenium browser, String binder, String page, String structure){
String selector = createSelector(binder, page, structure);
/* wait until tree has loaded */
StringBuffer locatorBuffer = new StringBuffer();
locatorBuffer.append("xpath=//li[contains(@class, '")
.append(functionalUtil.getTreeNodeLoadingCss())
.append("')]");
functionalUtil.waitForPageToUnloadElement(browser, locatorBuffer.toString());
/* click selector */
functionalUtil.waitForPageToLoadElement(browser, selector);
browser.click(selector);
locatorBuffer = new StringBuffer();
locatorBuffer.append("xpath=//li[contains(@class, 'x-tree-node')]//a//span[contains(text(), '")
.append((structure != null) ? structure: page)
.append("')]");
functionalUtil.waitForPageToLoadElement(browser, locatorBuffer.toString());
return(true);
}
/**
*
* @param 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