Skip to content

Commit

Permalink
fix: correcting test-cases involving selenium
Browse files Browse the repository at this point in the history
Signed-off-by: Arnab Dutta <[email protected]>
  • Loading branch information
duttarnab committed Mar 25, 2024
1 parent dd9502c commit c52d337
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 43 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ private static AuthorizationResponse loginGluuServer(
//navigate to opHost

String authzUrl = getAuthorizationUrl(authenticationDetails, responseTypes, scopes);
System.out.println(authzUrl);
driver.navigate().to(authzUrl);

//driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
Expand Down Expand Up @@ -84,43 +83,6 @@ public WebElement apply(WebDriver d) {

}

/*private static AuthorizationResponse acceptAuthorization(WebDriver driver) {
String authorizationResponseStr = driver.getCurrentUrl();
AuthorizationResponse authorizationResponse = null;
// Check for authorization form if client has no persistent authorization
if (!authorizationResponseStr.contains("#")) {
Wait<WebDriver> wait = new FluentWait<WebDriver>(driver)
.withTimeout(Duration.ofSeconds(WAIT_OPERATION_TIMEOUT))
.pollingEvery(Duration.ofMillis(500))
.ignoring(NoSuchElementException.class);
WebElement allowButton = wait.until(new Function<WebDriver, WebElement>() {
public WebElement apply(WebDriver d) {
//System.out.println(d.getCurrentUrl());
//System.out.println(d.getPageSource());
return d.findElement(By.id("authorizeForm:allowButton"));
}
});
// We have to use JavaScript because target is link with onclick
JavascriptExecutor jse = (JavascriptExecutor) driver;
jse.executeScript("scroll(0, 1000)");
String previousURL = driver.getCurrentUrl();
Actions actions = new Actions(driver);
actions.click(allowButton).perform();
authorizationResponseStr = driver.getCurrentUrl();
authorizationResponse = new AuthorizationResponse(authorizationResponseStr);
LOG.info("Authorization Response url is: " + driver.getCurrentUrl());
} else {
fail("The authorization form was expected to be shown.");
}
return authorizationResponse;
}*/

private static WebDriver initWebDriver(boolean enableJavascript, boolean cleanupCookies) {
WebDriver currentDriver = new HtmlUnitDriver();
((HtmlUnitDriver) currentDriver).setJavascriptEnabled(enableJavascript);
Expand Down
5 changes: 0 additions & 5 deletions oxd-server/src/test/java/org/gluu/oxd/server/Tester.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,6 @@ public static String getAuthorization(RegisterSiteResponse site) {
params.setOpHost(site.getOpHost());
params.setClientId(site.getClientId());
params.setClientSecret(site.getClientSecret());
System.out.println("========================================================"+site.getOpHost());
System.out.println("========================================================"+site.getClientId());
System.out.println("========================================================"+site.getClientSecret());
System.out.println("========================================================"+HOST);
System.out.println("========================================================"+params.toString());
GetClientTokenResponse resp = Tester.newClient(HOST).getClientToken(params);
assertNotNull(resp);
assertTrue(!Strings.isNullOrEmpty(resp.getAccessToken()));
Expand Down

0 comments on commit c52d337

Please sign in to comment.