Merge pull request #3805 from mhajas/KEYCLOAK-3841

KEYCLOAK-3841 Fix tests on windows
This commit is contained in:
Pavel Drozd 2017-02-13 10:37:32 +01:00 committed by GitHub
commit 4ede1174b7
2 changed files with 20 additions and 0 deletions

View file

@ -0,0 +1,11 @@
set NOPAUSE=true
cd %JBOSS_HOME%
start javaw -jar %FUSE_INSTALLER_NAME%
ping 127.0.0.1 -n 40 > nul
del %FUSE_INSTALLER_NAME%
set JBOSS_HOME=%JBOSS_HOME:/=\%
ren %JBOSS_HOME%\standalone\deployments\hawtio*.war hawtio.war
exit 0

View file

@ -7,12 +7,15 @@ import org.junit.Test;
import org.keycloak.representations.idm.RealmRepresentation;
import org.keycloak.testsuite.adapter.AbstractExampleAdapterTest;
import org.keycloak.testsuite.adapter.page.HawtioPage;
import org.openqa.selenium.By;
import java.util.List;
import static org.keycloak.testsuite.auth.page.AuthRealm.DEMO;
import static org.keycloak.testsuite.util.IOUtil.loadRealm;
import static org.keycloak.testsuite.util.URLAssert.assertCurrentUrlStartsWith;
import static org.keycloak.testsuite.util.WaitUtils.pause;
import static org.keycloak.testsuite.util.WaitUtils.waitUntilElement;
/**
* @author mhajas
@ -32,15 +35,21 @@ public abstract class AbstractHawtioAdapterTest extends AbstractExampleAdapterTe
testRealmLoginPage.setAuthRealm(DEMO);
hawtioPage.navigateTo();
waitUntilElement(By.xpath("//body")).is().present();
assertCurrentUrlStartsWith(testRealmLoginPage);
testRealmLoginPage.form().login("root", "password");
waitUntilElement(By.xpath("//body")).is().present();
assertCurrentUrlStartsWith(hawtioPage.getDriver(), hawtioPage.toString() + "/welcome");
hawtioPage.logout();
pause(1000);
waitUntilElement(By.xpath("//body")).is().present();
assertCurrentUrlStartsWith(testRealmLoginPage);
hawtioPage.navigateTo();
waitUntilElement(By.xpath("//body")).is().present();
assertCurrentUrlStartsWith(testRealmLoginPage);
}
}