Use clickLink in delete credential page

Closes #33505

Signed-off-by: rmartinc <rmartinc@redhat.com>
This commit is contained in:
rmartinc 2024-10-08 09:37:40 +02:00 committed by Marek Posolda
parent e8dfc06f5c
commit 467e881725

View file

@ -20,6 +20,7 @@
package org.keycloak.testsuite.pages; package org.keycloak.testsuite.pages;
import org.junit.Assert; import org.junit.Assert;
import org.keycloak.testsuite.util.UIUtils;
import org.openqa.selenium.WebElement; import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy; import org.openqa.selenium.support.FindBy;
@ -37,15 +38,16 @@ public class DeleteCredentialPage extends AbstractPage {
@FindBy(id = "kc-delete-text") @FindBy(id = "kc-delete-text")
private WebElement message; private WebElement message;
@Override
public boolean isCurrent() { public boolean isCurrent() {
return PageUtils.getPageTitle(driver).startsWith("Delete "); return PageUtils.getPageTitle(driver).startsWith("Delete ");
} }
public void confirm() { public void confirm() {
submitButton.click(); UIUtils.clickLink(submitButton);
} }
public void cancel() { public void cancel() {
cancelButton.click(); UIUtils.clickLink(cancelButton);
} }
public void assertCredentialInMessage(String expectedLabel) { public void assertCredentialInMessage(String expectedLabel) {