Skip to content
Snippets Groups Projects
Commit 3d2924a4 authored by srosse's avatar srosse
Browse files

Merge remote-tracking branch 'origin/OpenOLAT_12.5'

parents 1d57275d 4c371d1c
No related branches found
No related tags found
No related merge requests found
Showing
with 47 additions and 11 deletions
......@@ -175,6 +175,7 @@ public class MessageEditController extends FormBasicController {
titleEl.setNotEmptyCheck("error.field.not.empty");
bodyEl = uifactory.addRichTextElementForStringData("msgBody", "msg.body", message.getBody(), 15, -1, true, null, null,
formLayout, ureq.getUserSession(), getWindowControl());
bodyEl.setElementCssClass("o_sel_forum_message_body");
bodyEl.setMandatory(true);
bodyEl.setNotEmptyCheck("error.field.not.empty");
bodyEl.setMaxLength(MAX_BODY_LENGTH);
......
......@@ -180,6 +180,7 @@ public class AdministrationPage {
selectModules();
By taxonomyBy = By.cssSelector(".o_sel_taxonomy span.o_tree_level_label_leaf>a");
OOGraphene.waitElement(taxonomyBy, browser);
browser.findElement(taxonomyBy).click();
OOGraphene.waitBusy(browser);
......
......@@ -31,6 +31,8 @@ import org.olat.selenium.page.graphene.OOGraphene;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.interactions.Actions;
import org.openqa.selenium.support.ui.Select;
/**
......@@ -256,7 +258,11 @@ public class CalendarPage {
public CalendarPage openDetails(String subject) {
By titleBy = By.xpath("//div[@class='o_cal']//span[contains(text(),'" + subject + "')]");
OOGraphene.waitElement(titleBy, 5, browser);
browser.findElement(titleBy).click();
if(browser instanceof FirefoxDriver) {
new Actions(browser).click(browser.findElement(titleBy)).click().build().perform();
} else {
browser.findElement(titleBy).click();
}
OOGraphene.waitCallout(browser);
return this;
}
......@@ -265,9 +271,13 @@ public class CalendarPage {
LocalDate date = LocalDate.now().withDayOfMonth(day);
String dateString = date.format(oocurenceIdFormatter);
By titleBy = By.xpath("//div[@class='o_cal']//div[contains(@id,'xOccOOccOx_" + dateString + "')]//span[contains(text(),'" + subject + "')]");
By titleBy = By.xpath("//div[@class='o_cal']//div[contains(@id,'xOccOOccOx_" + dateString + "')][div/span[contains(text(),'" + subject + "')]]");
OOGraphene.waitElement(titleBy, 5, browser);
browser.findElement(titleBy).click();
if(browser instanceof FirefoxDriver) {
new Actions(browser).click(browser.findElement(titleBy)).click().build().perform();
} else {
browser.findElement(titleBy).click();
}
OOGraphene.waitCallout(browser);
return this;
}
......
......@@ -23,6 +23,7 @@ import org.olat.selenium.page.graphene.OOGraphene;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.interactions.Actions;
/**
......@@ -45,8 +46,10 @@ public class LicensesAdminstrationPage {
WebElement resourceCheckEl = browser.findElement(resourceCheckBy);
WebElement resourceLabelEl = browser.findElement(resourceLabelBy);
new Actions(browser).moveToElement(resourceLabelEl).build().perform();
OOGraphene.waitingALittleBit();
if(browser instanceof ChromeDriver) {
new Actions(browser).moveToElement(resourceLabelEl).build().perform();
OOGraphene.waitingALittleBit();
}
OOGraphene.check(resourceLabelEl, resourceCheckEl, Boolean.TRUE);
OOGraphene.waitBusy(browser);
......
......@@ -212,10 +212,7 @@ public class AssessmentToolPage {
}
public AssessmentToolPage makeAllVisible() {
By selectAll = By.xpath("//div[contains(@class,'o_table_checkall')]/label/a[i[contains(@class,'o_icon_check_on')]]");
OOGraphene.waitElement(selectAll, browser);
browser.findElement(selectAll).click();
OOGraphene.waitBusy(browser);
OOGraphene.flexiTableSelectAll(browser);
By bulkBy = By.cssSelector("a.btn.o_sel_assessment_bulk_visible");
browser.findElement(bulkBy).click();
......
......@@ -35,6 +35,7 @@ import org.openqa.selenium.JavascriptExecutor;
import org.openqa.selenium.TimeoutException;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
/**
*
......@@ -354,6 +355,17 @@ public class OOGraphene {
timeEls.get(1).sendKeys(Integer.toString(minute));
}
public static final void flexiTableSelectAll(WebDriver browser) {
By selectAll = By.xpath("//div[contains(@class,'o_table_checkall')]/label/a[i[contains(@class,'o_icon_check_on')]]/span");
waitElement(selectAll, browser);
if(browser instanceof FirefoxDriver) {
OOGraphene.waitingALittleLonger();// link is obscured by the scroll bar
}
browser.findElement(selectAll).click();
waitBusy(browser);
}
public static final Locale getLocale(WebDriver browser) {
String cssLanguage = browser.findElement(By.id("o_body")).getAttribute("class");
if(cssLanguage.contains("o_lang_de")) {
......
......@@ -27,6 +27,7 @@ import org.olat.user.restapi.UserVO;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
/**
* Drive the wizard to add members
......@@ -94,8 +95,12 @@ public class MembersWizardPage {
By searchBy = By.cssSelector(".o_sel_usersearch_searchform a.btn-default");
OOGraphene.clickAndWait(searchBy, browser);
// select all
By selectAll = By.xpath("//div[contains(@class,'modal')]//div[contains(@class,'o_table_checkall')]/label/a[i[contains(@class,'o_icon_check_on')]]");
OOGraphene.waitElement(selectAll, browser);
if(browser instanceof FirefoxDriver) {
OOGraphene.waitingALittleLonger();// link is obscured by the scroll bar
}
browser.findElement(selectAll).click();
OOGraphene.waitBusy(browser);
return this;
......
......@@ -104,6 +104,7 @@ public class QTI21CorrectionPage {
OOGraphene.waitElement(confirmButtonBy, browser);
browser.findElement(confirmButtonBy).click();
OOGraphene.waitBusy(browser);
OOGraphene.waitModalDialogDisappears(browser);
return this;
}
}
......@@ -197,6 +197,7 @@ public class AuthoringEnvPage {
if(saveButton.isEnabled()) {
saveButton.click();
OOGraphene.waitBusy(browser);
OOGraphene.waitModalDialogDisappears(browser);
OOGraphene.waitElement(RepositoryEditDescriptionPage.generaltabBy, browser);
}
return this;
......@@ -227,8 +228,8 @@ public class AuthoringEnvPage {
* @return
*/
public CoursePageFragment clickToolbarRootCrumb() {
OOGraphene.closeBlueMessageWindow(browser);
By toolbarBackBy = By.xpath("//li[contains(@class,'o_breadcrumb_back')]/following-sibling::li/a");
By toolbarBackBy = By.xpath("//div[contains(@class,'o_breadcrumb')]/ol[contains(@class,'breadcrumb')]/li/a[contains(@onclick,'crumb_0')]");
OOGraphene.waitingALittleBit();// firefox will click the button without effect
browser.findElement(toolbarBackBy).click();
OOGraphene.waitBusy(browser);
return new CoursePageFragment(browser);
......
......@@ -87,6 +87,11 @@ public class UserRestClient {
return createAuthor("Selena");
}
public UserVO createRandomAuthor()
throws IOException, URISyntaxException {
return createAuthor("Selena-" + UUID.randomUUID());
}
public UserVO createAuthor(String name)
throws IOException, URISyntaxException {
RestConnection restConnection = new RestConnection(deploymentUrl);
......
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