Search in sources :

Example 6 with IgnoreBrowserDriver

use of org.keycloak.testsuite.arquillian.annotation.IgnoreBrowserDriver in project keycloak by keycloak.

the class WebAuthnPropertyTest method timeout.

@Test
@IgnoreBrowserDriver(FirefoxDriver.class)
public void timeout() throws IOException {
    // seconds
    final Integer TIMEOUT = 3;
    registerDefaultUser();
    logout();
    getVirtualAuthManager().removeAuthenticator();
    try (Closeable u = getWebAuthnRealmUpdater().setWebAuthnPolicyCreateTimeout(TIMEOUT).update()) {
        WebAuthnRealmData realmData = new WebAuthnRealmData(testRealm().toRepresentation(), isPasswordless());
        assertThat(realmData.getCreateTimeout(), is(TIMEOUT));
        authenticateDefaultUser(false);
        WaitUtils.pause((TIMEOUT + 2) * 1000);
        webAuthnErrorPage.assertCurrent();
        assertThat(webAuthnErrorPage.getError(), containsString("Failed to authenticate by the Security key."));
    }
}
Also used : Closeable(java.io.Closeable) WebAuthnRealmData(org.keycloak.testsuite.webauthn.utils.WebAuthnRealmData) Test(org.junit.Test) IgnoreBrowserDriver(org.keycloak.testsuite.arquillian.annotation.IgnoreBrowserDriver)

Aggregations

IgnoreBrowserDriver (org.keycloak.testsuite.arquillian.annotation.IgnoreBrowserDriver)6 Test (org.junit.Test)5 Closeable (java.io.Closeable)4 WebAuthnRealmData (org.keycloak.testsuite.webauthn.utils.WebAuthnRealmData)4 AnnotatedElement (java.lang.reflect.AnnotatedElement)1 Method (java.lang.reflect.Method)1 Arrays (java.util.Arrays)1 Predicate (java.util.function.Predicate)1 Instance (org.jboss.arquillian.core.api.Instance)1 Inject (org.jboss.arquillian.core.api.annotation.Inject)1 ExecutionDecision (org.jboss.arquillian.test.spi.execution.ExecutionDecision)1 TestExecutionDecider (org.jboss.arquillian.test.spi.execution.TestExecutionDecider)1 RealmRepresentation (org.keycloak.representations.idm.RealmRepresentation)1 UserRepresentation (org.keycloak.representations.idm.UserRepresentation)1 TestContext (org.keycloak.testsuite.arquillian.TestContext)1 IgnoreBrowserDrivers (org.keycloak.testsuite.arquillian.annotation.IgnoreBrowserDrivers)1 RealmAttributeUpdater (org.keycloak.testsuite.updaters.RealmAttributeUpdater)1 BrowserDriverUtil.isDriverInstanceOf (org.keycloak.testsuite.util.BrowserDriverUtil.isDriverInstanceOf)1 AbstractWebAuthnVirtualTest (org.keycloak.testsuite.webauthn.AbstractWebAuthnVirtualTest)1 WebAuthnAuthenticatorsList (org.keycloak.testsuite.webauthn.pages.WebAuthnAuthenticatorsList)1