Skip to content
Snippets Groups Projects
Commit 44c7cf83 authored by srosse's avatar srosse
Browse files

OO-3170: selenium test for reminder need a selectable license to save the...

OO-3170: selenium test for reminder need a selectable license to save the details page of the course
parent c3195765
No related branches found
No related tags found
No related merge requests found
......@@ -117,6 +117,7 @@ public class LicenseAdminConfigController extends FormBasicController {
FormLayoutContainer generalCont = FormLayoutContainer.createDefaultFormLayout("general", getTranslator());
generalCont.setFormTitle(translate("admin.menu.title"));
generalCont.setRootForm(mainForm);
generalCont.setElementCssClass("o_sel_license_general");
flc.add("general", generalCont);
String[] enabledHandlerKeys = licenseHandlers.stream()
......
......@@ -59,6 +59,13 @@ public class AdministrationPage {
return this;
}
public AdministrationPage selecCoreConfiguration() {
By coreConfigurationLinkBy = By.xpath("//div[contains(@class,'o_tree')]//a[contains(@onclick,'sysconfigParent')]");
browser.findElement(coreConfigurationLinkBy).click();
OOGraphene.waitBusy(browser);
return this;
}
public AdministrationPage selectModules() {
By systemLinkby = By.xpath("//div[contains(@class,'o_tree')]//a[contains(@onclick,'modulesParent')]");
browser.findElement(systemLinkby).click();
......@@ -144,4 +151,16 @@ public class AdministrationPage {
OOGraphene.waitBusy(browser);
return this;
}
public LicensesAdminstrationPage openLicenses() {
selecCoreConfiguration();
By licenseBy = By.cssSelector(".o_sel_license span.o_tree_level_label_leaf>a");
browser.findElement(licenseBy).click();
OOGraphene.waitBusy(browser);
By licenseAdminBy = By.cssSelector(".o_sel_license_general");
OOGraphene.waitElement(licenseAdminBy, browser);
return new LicensesAdminstrationPage(browser);
}
}
/**
* <a href="http://www.openolat.org">
* OpenOLAT - Online Learning and Training</a><br>
* <p>
* Licensed under the Apache License, Version 2.0 (the "License"); <br>
* you may not use this file except in compliance with the License.<br>
* You may obtain a copy of the License at the
* <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache homepage</a>
* <p>
* Unless required by applicable law or agreed to in writing,<br>
* software distributed under the License is distributed on an "AS IS" BASIS, <br>
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. <br>
* See the License for the specific language governing permissions and <br>
* limitations under the License.
* <p>
* Initial code contributed and copyrighted by<br>
* frentix GmbH, http://www.frentix.com
* <p>
*/
package org.olat.selenium.page.core;
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.interactions.Actions;
/**
*
* Initial date: 19 mars 2018<br>
* @author srosse, stephane.rosse@frentix.com, http://www.frentix.com
*
*/
public class LicensesAdminstrationPage {
private final WebDriver browser;
public LicensesAdminstrationPage(WebDriver browser) {
this.browser = browser;
}
public LicensesAdminstrationPage enableForResources(String license) {
By resourceCheckBy = By.xpath("//div[contains(@class,'o_table_flexi')]//tr[td[text()[contains(.,'" + license + "')]]]/td[10]/div/label/input[@type='checkbox']");
By resourceLabelBy = By.xpath("//div[contains(@class,'o_table_flexi')]//tr[td[text()[contains(.,'" + license + "')]]]/td[10]/div/label");
WebElement resourceCheckEl = browser.findElement(resourceCheckBy);
WebElement resourceLabelEl = browser.findElement(resourceLabelBy);
new Actions(browser).moveToElement(resourceLabelEl).build().perform();
OOGraphene.waitingALittleBit();
OOGraphene.check(resourceLabelEl, resourceCheckEl, Boolean.TRUE);
OOGraphene.waitBusy(browser);
return this;
}
}
......@@ -30,6 +30,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.support.ui.Select;
/**
*
......@@ -73,6 +74,18 @@ public class RepositoryEditDescriptionPage {
return this;
}
/**
* Set a license
*
* @return Itself
*/
public RepositoryEditDescriptionPage setLicense() {
By licenseBy = By.cssSelector("div.o_sel_repo_license select");
WebElement licenseEl = browser.findElement(licenseBy);
new Select(licenseEl).selectByIndex(1);
return this;
}
public RepositoryEditDescriptionPage save() {
By saveBy = By.cssSelector("div.o_sel_repo_save_details button.btn-primary");
OOGraphene.clickAndWait(saveBy, browser);
......
......@@ -25,7 +25,7 @@
<property name="dimensions">1024x800</property>
<!--
<property name="downloadBinaries">no</property>
<property name="chromeDriverBinary">target/drone/720f6f8ab16dd3fcc0d5928402ac9f92/chromedriver</property>
<property name="chromeDriverBinary">target/drone/312cd778e385a255c60caed5ffbaf6e5/chromedriver</property>
<property name="firefoxDriverBinary">target/drone/30f3fdc84d76c53de2916008a889d26f/geckodriver</property>
-->
<property name="firefoxUserPreferences">src/test/profile/firefox/prefs.js</property>
......
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