KEYCLOAK-3841 Unignore and fix fuse on eap test

This commit is contained in:
mhajas 2017-01-06 14:39:24 +01:00
parent fb6a8da863
commit 86c49f5e89
4 changed files with 32 additions and 4 deletions

View file

@ -9,4 +9,6 @@ cd $JBOSS_HOME
java -jar $FUSE_INSTALLER_NAME java -jar $FUSE_INSTALLER_NAME
rm $FUSE_INSTALLER_NAME rm $FUSE_INSTALLER_NAME
mv standalone/deployments/hawtio*.war standalone/deployments/hawtio.war
exit 0 exit 0

View file

@ -23,7 +23,7 @@
<fuse.installer.groupId>com.redhat.fuse.eap</fuse.installer.groupId> <fuse.installer.groupId>com.redhat.fuse.eap</fuse.installer.groupId>
<fuse.installer.artifactId>fuse-eap-installer</fuse.installer.artifactId> <fuse.installer.artifactId>fuse-eap-installer</fuse.installer.artifactId>
<fuse.installer.version>6.3.0.redhat-187</fuse.installer.version> <fuse.installer.version>6.3.0.redhat-224</fuse.installer.version>
<app.server.oidc.adapter.artifactId>keycloak-eap6-adapter-dist</app.server.oidc.adapter.artifactId> <app.server.oidc.adapter.artifactId>keycloak-eap6-adapter-dist</app.server.oidc.adapter.artifactId>
</properties> </properties>

View file

@ -1,9 +1,13 @@
package org.keycloak.testsuite.adapter.page; package org.keycloak.testsuite.adapter.page;
import org.keycloak.testsuite.page.AbstractPage; import org.keycloak.testsuite.page.AbstractPage;
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import javax.ws.rs.core.UriBuilder; import javax.ws.rs.core.UriBuilder;
import java.net.URL;
import static org.keycloak.testsuite.util.WaitUtils.waitUntilElement;
/** /**
* @author mhajas * @author mhajas
@ -21,4 +25,20 @@ public class HawtioPage extends AbstractPage {
public UriBuilder createUriBuilder() { public UriBuilder createUriBuilder() {
return UriBuilder.fromUri(getUrl()); return UriBuilder.fromUri(getUrl());
} }
@FindBy(xpath = "//a[@class='dropdown-toggle' and @data-original-title='Preferences and log out']")
private WebElement dropDownMenu;
@FindBy(xpath = "//a[@ng-click='logout()']")
private WebElement logoutButton;
public void logout() {
waitUntilElement(dropDownMenu).is().visible();
dropDownMenu.click();
waitUntilElement(logoutButton).is().visible();
logoutButton.click();
By modal = By.xpath("//input[@type='submit' and @value='Yes']");
waitUntilElement(modal).is().visible();
driver.findElement(modal).click();
}
} }

View file

@ -1,6 +1,7 @@
package org.keycloak.testsuite.adapter.example; package org.keycloak.testsuite.adapter.example;
import org.jboss.arquillian.graphene.page.Page; import org.jboss.arquillian.graphene.page.Page;
import org.junit.Before;
import org.junit.Ignore; import org.junit.Ignore;
import org.junit.Test; import org.junit.Test;
import org.keycloak.representations.idm.RealmRepresentation; import org.keycloak.representations.idm.RealmRepresentation;
@ -27,14 +28,19 @@ public abstract class AbstractHawtioAdapterTest extends AbstractExampleAdapterTe
} }
@Test @Test
@Ignore //Waiting for PATCH-1446 public void hawtioLoginAndLogoutTest() {
public void hawtioTest() {
testRealmLoginPage.setAuthRealm(DEMO); testRealmLoginPage.setAuthRealm(DEMO);
hawtioPage.navigateTo(); hawtioPage.navigateTo();
assertCurrentUrlStartsWith(testRealmLoginPage); assertCurrentUrlStartsWith(testRealmLoginPage);
testRealmLoginPage.form().login("root", "password"); testRealmLoginPage.form().login("root", "password");
assertCurrentUrlStartsWith(hawtioPage.getDriver(), hawtioPage.toString() + "/welcome"); assertCurrentUrlStartsWith(hawtioPage.getDriver(), hawtioPage.toString() + "/welcome");
hawtioPage.logout();
assertCurrentUrlStartsWith(testRealmLoginPage);
hawtioPage.navigateTo();
assertCurrentUrlStartsWith(testRealmLoginPage);
} }
} }