Permalink
Browse files

Merged default

  • Loading branch information...
OLAT Team
OLAT Team committed Jun 26, 2018
2 parents 5bd1ef6 + 812c7d1 commit 5ac64e2f7b551631ed524b9f07d02f34148181d7
@@ -8,7 +8,9 @@ To learn more about OLAT, visit [olat.org](https://olat.org)
## Changelog
**2018/06/06**
**~~2018/06/06~~**
**2018/07/04**
* Fixed an issue with session timeout for some legacy courses
* Fixed an issue with empty search strings
* Fixed an issue with language setting on sign up
* Fixed an issue with question pool usage info
@@ -84,11 +84,13 @@
<artifactId>lmsuzh-extension-adobeconnect</artifactId>
<version>${project.version}</version>
</dependency>
<!--
<dependency>
<groupId>ch.uzh.extension</groupId>
<artifactId>lmsuzh-extension-epis</artifactId>
<version>${project.version}</version>
</dependency>
-->
<!-- The OpenOLAT dependency is mandatory. -->
<dependency>
<groupId>org.openolat</groupId>
@@ -19,7 +19,9 @@
<import resource="classpath:campusContext.xml" />
<import resource="classpath:persistenceContext.xml"/>
<import resource="classpath:switchinteractContext.xml" />
<!--
<import resource="classpath:episContext.xml"/>
-->
<!-- Must be at the very end in order that "@Primary" annotations work as
expected. -->
@@ -4,7 +4,7 @@
import ch.uzh.extension.config.LmsuzhConfigBeanFactory;
import ch.uzh.extension.olatreplacement.jsf.AuthenticationFilter;
import ch.uzh.extension.tool.LmsuzhClasspath;
import ch.uzh.lms.epis.EpisConfiguration;
//import ch.uzh.lms.epis.EpisConfiguration;
import com.ocpsoft.pretty.PrettyFilter;
import org.apache.myfaces.shared.util.ClassLoaderUtils;
import org.apache.myfaces.webapp.StartupServletContextListener;
@@ -68,7 +68,7 @@ private static void addLmsuzhResource(Class<?> clazz, List<Resource> resources)
addLmsuzhResource(LmsuzhConfigBeanFactory.class, result);
addLmsuzhResource(OpenOLATServlet.class, result);
addLmsuzhResource(CampusCoursePresentationBeanFactory.class, result);
addLmsuzhResource(EpisConfiguration.class, result);
//addLmsuzhResource(EpisConfiguration.class, result);
{
URL url = LmsuzhClasspath.getSourceCodeUrl(LmsuzhConfigBeanFactory.class);
@@ -900,7 +900,7 @@ public void changeAccessForUserFromCourse(WebDriver driver, Buttons user, Access
/**
*Set info in title and description
*/
public void setTitleAndDescription(WebDriver driver, String nodetitle, TitleAndDescription item, String text, Boolean isCourseNode) throws Exception {
public void setTitleAndDescription(WebDriver driver, String nodetitle, TitleAndDescription item, String text, boolean sourcecode, boolean isCourseNode) throws Exception {
if (selectTreeNodeByTitle(driver, nodetitle, true) != 0) {
authorCoreMacros.selectConfigTab(driver, ConfigurationsTabsInAuthoring.TITLEANDDESCRIPTION);
if (isCourseNode && item == TitleAndDescription.TITLE) {
@@ -912,10 +912,17 @@ public void setTitleAndDescription(WebDriver driver, String nodetitle, TitleAndD
}
} else {
if (item == TitleAndDescription.DESCRIPTION){
Util.editIFrame(driver, text, TextColour.BLACK, TextFormat.NONE);
String label = Util.getText(driver, Xpathes.XPATH_DESCRIPTION_INPUTS_IN_COURSE_EDITOR + "[" + item.getnr() + "]/div/label");
Util.selectXpath(driver, Xpathes.XPATH_SAVE_TITLE_AND_DESCRIPTIOM_BUTTON_DIRTY);
LogTexts.logSetTitleAndDescription(LOGGER, false, label, text);
if (sourcecode) {
Util.addSourceCode(driver, text);
String label = Util.getText(driver, Xpathes.XPATH_DESCRIPTION_INPUTS_IN_COURSE_EDITOR + "[" + item.getnr() + "]/div/label");
Util.selectXpath(driver, Xpathes.XPATH_SAVE_TITLE_AND_DESCRIPTIOM_BUTTON_DIRTY);
LogTexts.logSetTitleAndDescription(LOGGER, false, label, text);
}else {
Util.editIFrame(driver, text, TextColour.BLACK, TextFormat.NONE);
String label = Util.getText(driver, Xpathes.XPATH_DESCRIPTION_INPUTS_IN_COURSE_EDITOR + "[" + item.getnr() + "]/div/label");
Util.selectXpath(driver, Xpathes.XPATH_SAVE_TITLE_AND_DESCRIPTIOM_BUTTON_DIRTY);
LogTexts.logSetTitleAndDescription(LOGGER, false, label, text);
}
} else {
if (Util.setInputsField(driver, Xpathes.XPATH_DESCRIPTION_INPUTS_IN_COURSE_EDITOR + item.getxpath(), text)) {
String label = Util.getText(driver, Xpathes.XPATH_DESCRIPTION_INPUTS_IN_COURSE_EDITOR + "[" + item.getnr() + "]/div/label");
@@ -664,6 +664,22 @@ public static void editIFrame(WebDriver driver, String ntext, TextColour color,
new Actions(driver).sendKeys(driver.findElement(By.xpath(IFRAME_ACTIVE)), ntext).perform();
}
public static void addSourceCode(WebDriver driver, String ntext, Boolean... clear) throws Exception {
Util.selectXpath(driver, Xpathes.XPATH_SOURCE_CODE);
if (clear.length != 0) {
new Actions(driver).click(driver.findElement(By.xpath(Xpathes.XPATH_SOURCE_CODE_WINDOW))).perform();
new Actions(driver).keyDown(Keys.CONTROL).sendKeys("a").keyUp(Keys.CONTROL).sendKeys(Keys.DELETE).perform();
}
new Actions(driver).click(driver.findElement(By.xpath(Xpathes.XPATH_SOURCE_CODE_WINDOW))).perform();
new Actions(driver).sendKeys(driver.findElement(By.xpath(Xpathes.XPATH_SOURCE_CODE_WINDOW)), ntext).perform();
Util.selectXpath(driver, Xpathes.XPATH_SOURCE_CODE_BUTTON);
}
/**
* Switch to OLAT window
*/
@@ -438,6 +438,10 @@
static final String XPATH_TEXT_ITALIC = "//button/i[@class='mce-ico mce-i-italic']";
static final String XPATH_TEXT_UNDERLINE = "//button/i[@class='mce-ico mce-i-underline']";
static final String XPATH_TEXT_COLOR = "//*[@class='mce-widget mce-btn mce-colorbutton mce-first']/button[2]";
static final String XPATH_SOURCE_CODE = "//*[@class='mce-container mce-flow-layout-item mce-last mce-btn-group']//button";
static final String XPATH_SOURCE_CODE_WINDOW= "//*[@class='mce-container mce-panel mce-floatpanel mce-window mce-in']//textarea";
static final String XPATH_SOURCE_CODE_BUTTON= "//*[@class='mce-container mce-panel mce-foot']/div/div//button";
/*Mainleft - course*/
public static final String XPATH_MAIN_LEFT_ALL_NODE_ICONS = "//div[@id='o_main_left_content']//div/span//a/i";
@@ -0,0 +1,14 @@
package ch.uzh.extension.functionaltest.properties;
public class RegressionTestSessionTimeout {
public static final String MAINTENANCEMESSAGE = "AUTO TEST: Regression Test - Session Timeout";
public static final boolean CLEANUP = false;
public static final String ADMIN= "test_administrator";
public static final String PASSWORD = "Tetris2020!";
public static final String USER1 = "test_author";
public static final String USER2 = "test_student";
public static final String PASSWORD1 = "Tetris2020!";
public static final String COURSETITLE = "Regression: Session Timeout";
public static final String DESCRIPTION = "<img class=\"test_classe\" src=\"/olat/raw/noversion/images/testpics.gif\" alt=\"test\"/>";
public static final String FOLDER = "Testfolder";
}
@@ -159,6 +159,7 @@ private void cleanUp() throws Exception {
LOGGER.info("--- CLEANUP: START --------------------------------------");
OLAT1.startOlat(StartMacros.TestWebDriver.FIREFOX, olatUrl);
TestUtil.cleanUpCourses(OLAT1, CLEANUP, USER1, PASSWORD1, COURSETITLE);
OLAT1.stopOLAT(OLAT1.driver);
LOGGER.info("--- CLEANUP: DONE ---------------------------------------");
}
@@ -0,0 +1,116 @@
package ch.uzh.extension.functionaltest.regression;
import ch.uzh.extension.functionaltest.macros.AuthorMacros;
import ch.uzh.extension.functionaltest.macros.CourseMacros;
import ch.uzh.extension.functionaltest.macros.StartMacros;
import ch.uzh.extension.functionaltest.macros.enums.*;
import ch.uzh.extension.functionaltest.testutil.TestUtil;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import static ch.uzh.extension.functionaltest.properties.RegressionTestSessionTimeout.*;
import static ch.uzh.extension.functionaltest.testutil.TestUtil.deleteInfoMessages;
import static ch.uzh.extension.functionaltest.testutil.TestUtil.editInfoMessages;
import static ch.uzh.extension.tool.LmsuzhClasspath.getValue;
/**
* @Author Andrea Habayeb
*
* Description:
* https://jira.olat.uzh.ch/browse/LMSUZH-720
*
*/
/**
* Run
* total time: 5 min
*/
public class RegressionTestSessionTimeout {
private final static Logger LOGGER = LoggerFactory.getLogger(RegressionTestSessionTimeout.class);
private final static String PROPERTIES_PATH = "properties/OlatTestAutomation.properties";
private String olatUrl;
private final StartMacros OLAT1 = new StartMacros();
private final StartMacros OLAT2 = new StartMacros();
private final AuthorMacros author = new AuthorMacros();
private final CourseMacros student = new CourseMacros();
public RegressionTestSessionTimeout() {
olatUrl = getValue("OLAT_URL", PROPERTIES_PATH);
}
@Test
public void sessionTimeout() throws Exception {
LOGGER.info("---------------------------------------------------------");
LOGGER.info("---------------------------------------------------------");
LOGGER.info("--- URL: {}", olatUrl);
LOGGER.info("--- AUTHOR: {}", USER1);
LOGGER.info("--- STUDENT: {}", USER2);
LOGGER.info("--- COURSE: {}", COURSETITLE);
LOGGER.info("--- DESCRIPTION: {}", DESCRIPTION);
addInfoMessages();
createCourse();
startCourse();
cleanUp();
removeInfoMessages();
}
private void addInfoMessages() throws Exception {
LOGGER.info("--- ADD INFO MESSAGES - Regression-Session Timeout ----------");
OLAT1.startOlat(StartMacros.TestWebDriver.CHROME, olatUrl);
editInfoMessages(OLAT1, ADMIN, PASSWORD, MAINTENANCEMESSAGE);
OLAT1.stopOLAT(OLAT1.driver);
LOGGER.info("--- ADD INFO MESSAGES: DONE -----------------------------");
}
private void createCourse() throws Exception {
LOGGER.info("--- CREATE COURSE: START --------------------------------");
OLAT1.startOlat(StartMacros.TestWebDriver.CHROME, olatUrl);
author.login(OLAT1.driver, LoginForms.OLATLOGIN, USER1, PASSWORD1);
author.lastSessionDialog(OLAT1.driver, Buttons.CANCEL, StartMacros.AskAgain.ASKAGAIN);
author.createCourse(OLAT1.driver, COURSETITLE);
author.openCourseInCourseEditor(OLAT1.driver, COURSETITLE);
author.setTitleAndDescription(OLAT1.driver, COURSETITLE, TitleAndDescription.DESCRIPTION, DESCRIPTION, true, true);
author.createFolder(OLAT1.driver, COURSETITLE, FOLDER);
author.setTitleAndDescription(OLAT1.driver, FOLDER, TitleAndDescription.DESCRIPTION, DESCRIPTION, true, false);
author.publishCourse(OLAT1.driver, Access.OLATUSER, Catalog.NOCATALOG);
author.closeActiveEditor(OLAT1.driver);
author.logout(OLAT1.driver);
OLAT1.stopOLAT(OLAT1.driver);
LOGGER.info("--- CREATE COURSE: DONE ---------------------------------");
}
private void startCourse() throws Exception {
LOGGER.info("--- START COURSE: START ---------------------------------");
OLAT2.startOlat(StartMacros.TestWebDriver.FIREFOX, olatUrl);
student.login(OLAT2.driver, LoginForms.OLATLOGIN, USER2, PASSWORD1);
student.lastSessionDialog(OLAT2.driver, Buttons.CANCEL, StartMacros.AskAgain.ASKAGAIN);
student.advencedSearchFromCourses(OLAT2.driver, true, COURSETITLE);
student.selectTreeNodeByTitle(OLAT2.driver, FOLDER);
student.closeActiveEditor(OLAT2.driver);
student.logout(OLAT2.driver);
OLAT2.stopOLAT(OLAT2.driver);
LOGGER.info("--- START COURSE: DONE ----------------------------------");
}
private void cleanUp() throws Exception {
LOGGER.info("--- CLEANUP: START --------------------------------------");
OLAT1.startOlat(StartMacros.TestWebDriver.FIREFOX, olatUrl);
TestUtil.cleanUpCourses(OLAT1, CLEANUP, USER1, PASSWORD1, COURSETITLE);
OLAT1.stopOLAT(OLAT1.driver);
LOGGER.info("--- CLEANUP: DONE ---------------------------------------");
}
private void removeInfoMessages() throws Exception {
LOGGER.info("--- REMOVE INFO MESSAGES - Regression-Session-Timeout ---");
OLAT1.startOlat(StartMacros.TestWebDriver.CHROME, olatUrl);
deleteInfoMessages(OLAT1, ADMIN, PASSWORD);
OLAT1.stopOLAT(OLAT1.driver);
LOGGER.info("--- REMOVE INFO MESSAGES: DONE --------------------------");
}
}
@@ -101,9 +101,9 @@ private void createCourseWithSWICHCastAsAdministrator() throws Exception {
administrator.checkConfigurationTabInCourseItem(OLAT1.driver, SWITCHCASTTITLE, ConfigurationsTabsInAuthoring.CONFIGURATION_SW, true);
administrator.checkConfigurationTabInCourseItem(OLAT1.driver, SWITCHCASTTITLE, ConfigurationsTabsInAuthoring.ADMINISTRATION, true);
LOGGER.info("--- Check Title and description");
administrator.setTitleAndDescription(OLAT1.driver, SWITCHCASTTITLE, TitleAndDescription.SHORTTITLE, SWITCHCASTTITLE2, false);
administrator.setTitleAndDescription(OLAT1.driver, SWITCHCASTTITLE, TitleAndDescription.TITLE, SWITCHCASTTITLE2, false);
administrator.setTitleAndDescription(OLAT1.driver, SWITCHCASTTITLE2, TitleAndDescription.DESCRIPTION, SWITCHCASTDESCRIPTION, false);
administrator.setTitleAndDescription(OLAT1.driver, SWITCHCASTTITLE, TitleAndDescription.SHORTTITLE, SWITCHCASTTITLE2, false,false);
administrator.setTitleAndDescription(OLAT1.driver, SWITCHCASTTITLE, TitleAndDescription.TITLE, SWITCHCASTTITLE2, false, false);
administrator.setTitleAndDescription(OLAT1.driver, SWITCHCASTTITLE2, TitleAndDescription.DESCRIPTION, SWITCHCASTDESCRIPTION, false,false);
LOGGER.info("--- Check Visibility");
administrator.setVisibilityAndAccessOfCourseItem(OLAT1.driver, ConfigurationsTabsInAuthoring.VISIBILITY, VisibilityAndAccess.BLOCKEDFORLEARNERS);
administrator.setVisibilityAndAccessOfCourseItem(OLAT1.driver, ConfigurationsTabsInAuthoring.VISIBILITY, VisibilityAndAccess.BLOCKEDFORLEARNERS);
@@ -140,9 +140,9 @@ private void createCourseWithSWICHCastAsAuthor() throws Exception {
author.checkConfigurationTabInCourseItem(OLAT1.driver, SWITCHCASTTITLE, ConfigurationsTabsInAuthoring.SERIES, true);
author.checkConfigurationTabInCourseItem(OLAT1.driver, SWITCHCASTTITLE, ConfigurationsTabsInAuthoring.ADMINISTRATION, false);
LOGGER.info("--- Check Title and description");
author.setTitleAndDescription(OLAT1.driver, SWITCHCASTTITLE, TitleAndDescription.SHORTTITLE, SWITCHCASTTITLE2, false);
author.setTitleAndDescription(OLAT1.driver, SWITCHCASTTITLE, TitleAndDescription.TITLE, SWITCHCASTTITLE2, false);
author.setTitleAndDescription(OLAT1.driver, SWITCHCASTTITLE2, TitleAndDescription.DESCRIPTION, SWITCHCASTDESCRIPTION, false);
author.setTitleAndDescription(OLAT1.driver, SWITCHCASTTITLE, TitleAndDescription.SHORTTITLE, SWITCHCASTTITLE2, false, false);
author.setTitleAndDescription(OLAT1.driver, SWITCHCASTTITLE, TitleAndDescription.TITLE, SWITCHCASTTITLE2, false, false);
author.setTitleAndDescription(OLAT1.driver, SWITCHCASTTITLE2, TitleAndDescription.DESCRIPTION, SWITCHCASTDESCRIPTION, false,false);
LOGGER.info("--- Check Visibility");
author.setVisibilityAndAccessOfCourseItem(OLAT1.driver, ConfigurationsTabsInAuthoring.VISIBILITY, VisibilityAndAccess.BLOCKEDFORLEARNERS);
author.setVisibilityAndAccessOfCourseItem(OLAT1.driver, ConfigurationsTabsInAuthoring.VISIBILITY, VisibilityAndAccess.BLOCKEDFORLEARNERS);
Oops, something went wrong.

0 comments on commit 5ac64e2

Please sign in to comment.