Upgrade Arquillian Graphene for WebAuthn tests

Closes #9330
This commit is contained in:
Martin Bartoš 2021-12-23 13:53:21 +01:00 committed by Pedro Igor
parent 422ae0b3db
commit 4700d21298
3 changed files with 14 additions and 19 deletions

View file

@ -13,8 +13,8 @@
<name>WebAuthn tests</name>
<properties>
<selenium.version>4.0.0</selenium.version>
<graphene.webdriver.version>3.0.0-alpha.1</graphene.webdriver.version>
<selenium.version>4.1.0</selenium.version>
<graphene.webdriver.version>3.0.0-alpha.2</graphene.webdriver.version>
<htmlunit.driver.version>3.55.0</htmlunit.driver.version>
<arquillian.drone.version>3.0.0-alpha.2</arquillian.drone.version>
</properties>

View file

@ -20,17 +20,15 @@ package org.keycloak.testsuite.webauthn.pages;
import com.webauthn4j.data.AttestationConveyancePreference;
import com.webauthn4j.data.AuthenticatorAttachment;
import com.webauthn4j.data.UserVerificationRequirement;
import org.jboss.arquillian.graphene.elements.GrapheneSelect;
import org.jboss.arquillian.graphene.page.Page;
import org.keycloak.testsuite.console.page.authentication.Authentication;
import org.keycloak.testsuite.console.page.fragment.OnOffSwitch;
import org.keycloak.testsuite.console.page.idp.mappers.MultivaluedStringProperty;
import org.keycloak.testsuite.page.AbstractPatternFlyAlert;
import org.keycloak.testsuite.webauthn.utils.PropertyRequirement;
import org.openqa.selenium.NoSuchElementException;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.support.ui.ISelect;
import org.openqa.selenium.support.ui.Select;
import java.util.List;
import java.util.function.Supplier;
@ -51,22 +49,22 @@ public class WebAuthnPolicyPage extends Authentication {
private WebElement rpEntityName;
@FindBy(xpath = "//select[@id='sigalg']")
private GrapheneSelect signatureAlgorithms;
private Select signatureAlgorithms;
@FindBy(id = "rpid")
private WebElement rpEntityId;
@FindBy(id = "attpref")
private GrapheneSelect attestationConveyancePreference;
private Select attestationConveyancePreference;
@FindBy(id = "authnatt")
private GrapheneSelect authenticatorAttachment;
private Select authenticatorAttachment;
@FindBy(id = "reqresident")
private GrapheneSelect requireResidentKey;
private Select requireResidentKey;
@FindBy(id = "usrverify")
private GrapheneSelect userVerification;
private Select userVerification;
@FindBy(id = "timeout")
private WebElement timeout;
@ -106,10 +104,8 @@ public class WebAuthnPolicyPage extends Authentication {
/* Signature Algorithms */
public ISelect getSignatureAlgorithms() {
GrapheneSelect select = checkElement(() -> signatureAlgorithms);
select.setIsMulti(true);
return select;
public Select getSignatureAlgorithms() {
return checkElement(() -> signatureAlgorithms);
}
/* Relaying Party Entity ID */
@ -174,7 +170,7 @@ public class WebAuthnPolicyPage extends Authentication {
// If parameter state is null, the requirement is considered as not set up
public void requireResidentKey(PropertyRequirement requiresProperty) {
if (requiresProperty == null) return;
GrapheneSelect select = checkElement(() -> requireResidentKey);
Select select = checkElement(() -> requireResidentKey);
select.selectByVisibleText(requiresProperty.getValue());
}

View file

@ -29,13 +29,12 @@ import org.keycloak.testsuite.AssertEvents;
import org.keycloak.testsuite.console.AbstractConsoleTest;
import org.keycloak.testsuite.page.AbstractPatternFlyAlert;
import org.keycloak.testsuite.util.UIUtils;
import org.keycloak.testsuite.util.WaitUtils;
import org.keycloak.testsuite.webauthn.pages.WebAuthnPolicyPage;
import org.keycloak.testsuite.webauthn.updaters.AbstractWebAuthnRealmUpdater;
import org.keycloak.testsuite.webauthn.utils.PropertyRequirement;
import org.openqa.selenium.NoSuchElementException;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.ui.ISelect;
import org.openqa.selenium.support.ui.Select;
import java.io.IOException;
import java.util.Collections;
@ -155,7 +154,7 @@ public abstract class AbstractWebAuthnPolicySettingsTest extends AbstractConsole
getPolicyPage().navigateTo();
waitForPageToLoad();
ISelect selectedAlg = getPolicyPage().getSignatureAlgorithms();
Select selectedAlg = getPolicyPage().getSignatureAlgorithms();
assertThat(selectedAlg, notNullValue());
try {
@ -170,7 +169,7 @@ public abstract class AbstractWebAuthnPolicySettingsTest extends AbstractConsole
protected void checkSignatureAlgorithms() {
getPolicyPage().assertCurrent();
final ISelect algorithms = getPolicyPage().getSignatureAlgorithms();
final Select algorithms = getPolicyPage().getSignatureAlgorithms();
assertThat(algorithms, notNullValue());
algorithms.selectByValue("ES256");