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