KEYCLOAK-8568 DemoServletsAdapterTest.testVersion is unstable on travis

This commit is contained in:
mposolda 2018-10-11 23:10:04 +02:00 committed by Stian Thorgersen
parent 066bef744f
commit f254675a5e

View file

@ -654,22 +654,7 @@ public class DemoServletsAdapterTest extends AbstractServletsAdapterTest {
@Test
public void testVersion() {
jsDriver.navigate().to(suiteContext.getAuthServerInfo().getContextRoot().toString() + "/auth");
WaitUtils.waitForPageToLoad();
jsDriver.navigate().to(suiteContext.getAuthServerInfo().getContextRoot().toString() +
"/auth/admin/master/console/#/server-info");
WaitUtils.waitForPageToLoad();
jsDriverTestRealmLoginPage.form().login("admin", "admin");
WaitUtils.waitUntilElement(By.tagName("body")).is().visible();
Pattern pattern = Pattern.compile("<td [^>]+>Server Version</td>" +
"\\s+<td [^>]+>([^<]+)</td>");
Matcher matcher = pattern.matcher(jsDriver.getPageSource());
String serverVersion = null;
if (matcher.find()) {
serverVersion = matcher.group(1);
}
String serverVersion = adminClient.serverInfo().getInfo().getSystemInfo().getVersion();
assertNotNull(serverVersion);