[KEYCLOAK-6808] fix for the WildflyConsoleProtectionTest

Access Control is not an 'a' tag, but rather 'span'
Also two tests do not behave correctly with a same
Before annotated initialization, so reduce number
of tests to one, which calls the other one
This commit is contained in:
wyvie 2018-04-05 00:32:35 +02:00 committed by Pavel Drozd
parent 2b14469a58
commit 943bd9e48e
2 changed files with 3 additions and 6 deletions

View file

@ -34,7 +34,7 @@ public class AppServerWelcomePage extends AppServerContextRoot {
@Page @Page
protected OIDCLogin loginPage; protected OIDCLogin loginPage;
@FindBy(xpath = "//a[text() = 'Access Control']") @FindBy(xpath = "//span[text() = 'Access Control']")
private WebElement accessControlLink; private WebElement accessControlLink;
@FindBy(xpath = "//a[text() = 'Manage user profile']") @FindBy(xpath = "//a[text() = 'Manage user profile']")

View file

@ -93,8 +93,7 @@ public class WildflyConsoleProtectionTest extends AbstractAdapterTest {
} }
} }
@Test private void testLogin() throws InterruptedException {
public void testLogin() throws InterruptedException {
appServerWelcomePage.navigateToConsole(); appServerWelcomePage.navigateToConsole();
appServerWelcomePage.login("admin", "admin"); appServerWelcomePage.login("admin", "admin");
WaitUtils.pause(2000); WaitUtils.pause(2000);
@ -103,9 +102,7 @@ public class WildflyConsoleProtectionTest extends AbstractAdapterTest {
@Test @Test
public void testUserCanAccessAccountService() throws InterruptedException { public void testUserCanAccessAccountService() throws InterruptedException {
appServerWelcomePage.navigateToConsole(); testLogin();
appServerWelcomePage.login("admin", "admin");
WaitUtils.pause(2000);
appServerWelcomePage.navigateToAccessControl(); appServerWelcomePage.navigateToAccessControl();
appServerWelcomePage.navigateManageProfile(); appServerWelcomePage.navigateManageProfile();
assertTrue(accountUpdateProfilePage.isCurrent()); assertTrue(accountUpdateProfilePage.isCurrent());