added ConfigTest for events
This commit is contained in:
parent
261d32f8e7
commit
22e3abdaa8
1 changed files with 52 additions and 0 deletions
|
@ -0,0 +1,52 @@
|
||||||
|
package org.keycloak.testsuite.console.events;
|
||||||
|
|
||||||
|
import org.jboss.arquillian.graphene.page.Page;
|
||||||
|
import org.junit.Before;
|
||||||
|
import org.junit.Test;
|
||||||
|
import org.keycloak.representations.idm.RealmRepresentation;
|
||||||
|
import org.keycloak.testsuite.console.AbstractConsoleTest;
|
||||||
|
import org.keycloak.testsuite.console.page.events.Config;
|
||||||
|
|
||||||
|
import static org.junit.Assert.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author mhajas
|
||||||
|
*/
|
||||||
|
public class ConfigTest extends AbstractConsoleTest {
|
||||||
|
|
||||||
|
@Page
|
||||||
|
private Config configPage;
|
||||||
|
|
||||||
|
@Before
|
||||||
|
public void beforeConfigTest() {
|
||||||
|
configPage.navigateTo();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void configLoginEventsTest() {
|
||||||
|
configPage.form().setSaveEvents(true);
|
||||||
|
configPage.form().removeSaveType("LOGIN");
|
||||||
|
configPage.form().addSaveType("REGISTER_NODE");
|
||||||
|
configPage.form().setExpiration("50", "Days");
|
||||||
|
configPage.form().save();
|
||||||
|
assertFlashMessageSuccess();
|
||||||
|
|
||||||
|
RealmRepresentation realm = testRealmResource().toRepresentation();
|
||||||
|
assertTrue(realm.isEventsEnabled());
|
||||||
|
assertFalse(realm.getEnabledEventTypes().contains("LOGIN"));
|
||||||
|
assertTrue(realm.getEnabledEventTypes().contains("REGISTER_NODE"));
|
||||||
|
assertEquals(4320000L, realm.getEventsExpiration().longValue());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void configAdminEventsTest() {
|
||||||
|
configPage.form().setSaveAdminEvents(true);
|
||||||
|
configPage.form().setIncludeRepresentation(true);
|
||||||
|
configPage.form().save();
|
||||||
|
assertFlashMessageSuccess();
|
||||||
|
|
||||||
|
RealmRepresentation realm = testRealmResource().toRepresentation();
|
||||||
|
assertTrue(realm.isAdminEventsEnabled());
|
||||||
|
assertTrue(realm.isAdminEventsDetailsEnabled());
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue