Fix events tests stability
This commit is contained in:
parent
b413bcb41d
commit
244848afc4
2 changed files with 17 additions and 13 deletions
|
@ -4,6 +4,7 @@ import org.jboss.arquillian.graphene.page.Page;
|
|||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.keycloak.representations.idm.ClientRepresentation;
|
||||
import org.keycloak.representations.idm.RealmRepresentation;
|
||||
import org.keycloak.testsuite.admin.ApiUtil;
|
||||
import org.keycloak.testsuite.console.AbstractConsoleTest;
|
||||
import org.keycloak.testsuite.console.clients.AbstractClientTest;
|
||||
|
@ -13,11 +14,11 @@ import org.keycloak.testsuite.console.page.events.Config;
|
|||
import org.openqa.selenium.By;
|
||||
import org.openqa.selenium.WebElement;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import javax.ws.rs.core.Response;
|
||||
import java.util.List;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
|
||||
/**
|
||||
* @author mhajas
|
||||
|
@ -37,10 +38,12 @@ public class AdminEventsTest extends AbstractConsoleTest {
|
|||
|
||||
@Before
|
||||
public void beforeAdminEventsTest() {
|
||||
configPage.navigateTo();
|
||||
configPage.form().setSaveAdminEvents(true);
|
||||
configPage.form().setIncludeRepresentation(true);
|
||||
configPage.form().save();
|
||||
RealmRepresentation realm = testRealmResource().toRepresentation();
|
||||
|
||||
realm.setAdminEventsEnabled(true);
|
||||
realm.setAdminEventsDetailsEnabled(true);
|
||||
|
||||
testRealmResource().update(realm);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -3,6 +3,7 @@ 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.admin.Users;
|
||||
import org.keycloak.testsuite.console.AbstractConsoleTest;
|
||||
import org.keycloak.testsuite.console.page.events.Config;
|
||||
|
@ -10,6 +11,7 @@ import org.keycloak.testsuite.console.page.events.LoginEvents;
|
|||
import org.openqa.selenium.By;
|
||||
import org.openqa.selenium.WebElement;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
@ -26,13 +28,12 @@ public class LoginEventsTest extends AbstractConsoleTest {
|
|||
|
||||
@Before
|
||||
public void beforeLoginEventsTest() {
|
||||
configPage.navigateTo();
|
||||
configPage.form().setSaveEvents(true);
|
||||
configPage.form().waitForClearEventsButtonPresent();
|
||||
configPage.form().addSaveType("LOGIN");
|
||||
configPage.form().addSaveType("LOGIN_ERROR");
|
||||
configPage.form().addSaveType("LOGOUT");
|
||||
configPage.form().save();
|
||||
RealmRepresentation realm = testRealmResource().toRepresentation();
|
||||
|
||||
realm.setEventsEnabled(true);
|
||||
realm.setEnabledEventTypes(Arrays.asList("LOGIN", "LOGIN_ERROR", "LOGOUT"));
|
||||
|
||||
testRealmResource().update(realm);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
Loading…
Reference in a new issue