KEYCLOAK-5986 Fix token javacsript tests

This commit is contained in:
mhajas 2017-11-21 15:12:30 +01:00
parent 35e60e0aa4
commit 896e216f99

View file

@ -35,6 +35,7 @@ import org.keycloak.testsuite.auth.page.account.Applications;
import org.keycloak.testsuite.auth.page.login.OAuthGrant; import org.keycloak.testsuite.auth.page.login.OAuthGrant;
import org.keycloak.testsuite.console.page.events.Config; import org.keycloak.testsuite.console.page.events.Config;
import org.keycloak.testsuite.console.page.events.LoginEvents; import org.keycloak.testsuite.console.page.events.LoginEvents;
import org.keycloak.testsuite.util.OAuthClient;
import org.keycloak.testsuite.util.RealmBuilder; import org.keycloak.testsuite.util.RealmBuilder;
import org.openqa.selenium.By; import org.openqa.selenium.By;
import org.openqa.selenium.TimeoutException; import org.openqa.selenium.TimeoutException;
@ -483,8 +484,11 @@ public abstract class AbstractJSConsoleExampleAdapterTest extends AbstractExampl
oauth.doLogin("user", "password"); oauth.doLogin("user", "password");
String code = oauth.getCurrentQuery().get(OAuth2Constants.CODE); String code = oauth.getCurrentQuery().get(OAuth2Constants.CODE);
String token = oauth.doAccessTokenRequest(code, "password").getAccessToken(); OAuthClient.AccessTokenResponse tokenResponse = oauth.doAccessTokenRequest(code, "password");
String refreshToken = oauth.doRefreshTokenRequest(token, "password").getRefreshToken(); String token = tokenResponse.getAccessToken();
String refreshToken = tokenResponse.getRefreshToken();
//String refreshToken = oauth.doRefreshTokenRequest(token, "password").getRefreshToken();
jsConsoleTestAppPage.navigateTo(); jsConsoleTestAppPage.navigateTo();
jsConsoleTestAppPage.setInput(token); jsConsoleTestAppPage.setInput(token);
@ -507,8 +511,9 @@ public abstract class AbstractJSConsoleExampleAdapterTest extends AbstractExampl
oauth.doLogin("user", "password"); oauth.doLogin("user", "password");
String code = oauth.getCurrentQuery().get(OAuth2Constants.CODE); String code = oauth.getCurrentQuery().get(OAuth2Constants.CODE);
String token = oauth.doAccessTokenRequest(code, "password").getAccessToken(); OAuthClient.AccessTokenResponse tokenResponse = oauth.doAccessTokenRequest(code, "password");
String refreshToken = oauth.doRefreshTokenRequest(token, "password").getRefreshToken(); String token = tokenResponse.getAccessToken();
String refreshToken = tokenResponse.getRefreshToken();
jsConsoleTestAppPage.navigateTo(); jsConsoleTestAppPage.navigateTo();
jsConsoleTestAppPage.setInput(token); jsConsoleTestAppPage.setInput(token);