Merge pull request #3872 from mhajas/KEYCLOAK-4179

KEYCLOAK-4179
This commit is contained in:
Pavel Drozd 2017-02-20 15:44:29 +01:00 committed by GitHub
commit ec32acec27

View file

@ -35,6 +35,7 @@ import org.keycloak.testsuite.auth.page.login.OAuthGrant;
import org.keycloak.testsuite.console.page.events.Config;
import org.keycloak.testsuite.console.page.events.LoginEvents;
import org.openqa.selenium.By;
import org.openqa.selenium.TimeoutException;
import org.openqa.selenium.WebElement;
import java.io.File;
@ -414,6 +415,30 @@ public abstract class AbstractJSConsoleExampleAdapterTest extends AbstractExampl
assertTrue("TimeSkew was: " + timeSkew + ", but should be ~-40", timeSkew + 40 <= TIME_SKEW_TOLERANCE);
}
// KEYCLOAK-4179
@Test
public void testOneSecondTimeSkewTokenUpdate() {
setTimeOffset(1);
logInAndInit("standard");
jsConsoleTestAppPage.refreshToken();
waitUntilElement(jsConsoleTestAppPage.getEventsElement()).text().contains("Auth Refresh Success");
waitUntilElement(jsConsoleTestAppPage.getOutputElement()).text().not().contains("Failed to refresh token");
try {
// The events element should contain "Auth logout" but we need to wait for it
// and text().not().contains() doesn't wait. With KEYCLOAK-4179 it took some time for "Auth Logout" to be present
waitUntilElement(jsConsoleTestAppPage.getEventsElement()).text().contains("Auth Logout");
throw new RuntimeException("The events element shouldn't contain \"Auth Logout\" text");
} catch (TimeoutException e) {
// OK
}
}
@Test
public void testLocationHeaderInResponse() {
logInAndInit("standard");