use of org.olat.selenium.page.core.AdministrationMessagesPage in project OpenOLAT by OpenOLAT.
the class LoginTest method maintenanceMessage.
/**
* An administrator set a maintenance message. A first user
* logs in before and wait until the message appears. A second
* user load the login page, check that the message is visible,
* logs in and check that the message is visible too.
*
* @param loginPage
* @param reiBrowser
* @param kanuBrowser
* @throws IOException
* @throws URISyntaxException
*/
@Test
@RunAsClient
public void maintenanceMessage(@InitialPage LoginPage loginPage, @Drone @Participant WebDriver reiBrowser, @Drone @Student WebDriver kanuBrowser) throws IOException, URISyntaxException {
UserVO rei = new UserRestClient(deploymentUrl).createRandomUser("Rei");
UserVO kanu = new UserRestClient(deploymentUrl).createRandomUser("Kanu");
// a first user log in
LoginPage kanuLogin = LoginPage.getLoginPage(kanuBrowser, deploymentUrl).loginAs(kanu).resume();
// administrator come in, and set a maintenance message
loginPage.assertOnLoginPage().loginAs("administrator", "openolat").resume();
String message = "Hello - " + UUID.randomUUID();
AdministrationMessagesPage messagesPage = new NavigationPage(browser).openAdministration().selectInfoMessages().newMaintenanceMessage(message);
// A new user see the login page
LoginPage.getLoginPage(reiBrowser, deploymentUrl).waitOnMaintenanceMessage(message).loginAs(rei).resume().assertOnMaintenanceMessage(message);
kanuLogin.waitOnMaintenanceMessage(message);
// administrator remove the message
messagesPage.clearMaintenanceMessage();
// we wait it disappears
kanuLogin.waitOnMaintenanceMessageCleared();
}
use of org.olat.selenium.page.core.AdministrationMessagesPage in project openolat by klemens.
the class LoginTest method maintenanceMessage.
/**
* An administrator set a maintenance message. A first user
* logs in before and wait until the message appears. A second
* user load the login page, check that the message is visible,
* logs in and check that the message is visible too.
*
* @param loginPage
* @param reiBrowser
* @param kanuBrowser
* @throws IOException
* @throws URISyntaxException
*/
@Test
@RunAsClient
public void maintenanceMessage(@InitialPage LoginPage loginPage, @Drone @Participant WebDriver reiBrowser, @Drone @Student WebDriver kanuBrowser) throws IOException, URISyntaxException {
UserVO rei = new UserRestClient(deploymentUrl).createRandomUser("Rei");
UserVO kanu = new UserRestClient(deploymentUrl).createRandomUser("Kanu");
// a first user log in
LoginPage kanuLogin = LoginPage.getLoginPage(kanuBrowser, deploymentUrl).loginAs(kanu).resume();
// administrator come in, and set a maintenance message
loginPage.assertOnLoginPage().loginAs("administrator", "openolat").resume();
String message = "Hello - " + UUID.randomUUID();
AdministrationMessagesPage messagesPage = new NavigationPage(browser).openAdministration().selectInfoMessages().newMaintenanceMessage(message);
// A new user see the login page
LoginPage.getLoginPage(reiBrowser, deploymentUrl).waitOnMaintenanceMessage(message).loginAs(rei).resume().assertOnMaintenanceMessage(message);
kanuLogin.waitOnMaintenanceMessage(message);
// administrator remove the message
messagesPage.clearMaintenanceMessage();
// we wait it disappears
kanuLogin.waitOnMaintenanceMessageCleared();
}
Aggregations