diff --git a/openam-server/pom.xml b/openam-server/pom.xml index 1ea5df9f52..7603ea883b 100644 --- a/openam-server/pom.xml +++ b/openam-server/pom.xml @@ -13,7 +13,7 @@ * information: "Portions copyright [year] [name of copyright owner]". * * Copyright 2011-2016 ForgeRock AS. - * Portions copyright 2017-2025 3A Systems LLC. + * Portions copyright 2017-2026 3A Systems LLC. --> 4.0.0 @@ -104,7 +104,7 @@ ${test.config.path} ${basedir}/src/test/resources/logback-test.xml false - message + warning on false @@ -166,13 +166,13 @@ org.seleniumhq.selenium selenium-java - 4.13.0 + 4.43.0 test org.testcontainers testcontainers - 1.20.6 + 2.0.4 test diff --git a/openam-server/src/test/java/org/openidentityplatform/openam/test/integration/BaseTest.java b/openam-server/src/test/java/org/openidentityplatform/openam/test/integration/BaseTest.java index 0e1386d724..2ddb8428da 100644 --- a/openam-server/src/test/java/org/openidentityplatform/openam/test/integration/BaseTest.java +++ b/openam-server/src/test/java/org/openidentityplatform/openam/test/integration/BaseTest.java @@ -11,26 +11,31 @@ * Header, with the fields enclosed by brackets [] replaced by your own identifying * information: "Portions copyright [year] [name of copyright owner]". * - * Copyright 2025 3A Systems LLC. + * Copyright 2025-2026 3A Systems LLC. */ package org.openidentityplatform.openam.test.integration; +import org.apache.commons.io.FileUtils; import org.openqa.selenium.By; +import org.openqa.selenium.OutputType; import org.openqa.selenium.StaleElementReferenceException; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.chrome.ChromeDriver; import org.openqa.selenium.chrome.ChromeOptions; +import org.openqa.selenium.io.FileHandler; import org.openqa.selenium.support.ui.ExpectedCondition; import org.openqa.selenium.support.ui.ExpectedConditions; import org.openqa.selenium.support.ui.WebDriverWait; -import org.testcontainers.shaded.org.apache.commons.io.FileUtils; +import org.testng.ITestResult; import org.testng.annotations.AfterClass; +import org.testng.annotations.AfterMethod; import org.testng.annotations.BeforeClass; import org.testng.annotations.BeforeMethod; import java.io.BufferedReader; +import java.io.File; import java.io.FileReader; import java.io.IOException; import java.nio.file.Path; @@ -48,8 +53,9 @@ public abstract class BaseTest { @BeforeClass public void webdriverSetup() { ChromeOptions options = new ChromeOptions(); - options.addArguments("--remote-allow-origins=*","--headless", "--disable-dev-shm-usage", "--no-sandbox", "--verbose"); - //options.addArguments("--remote-allow-origins=*", "--verbose"); + options.addArguments("--remote-allow-origins=*","--headless", "--disable-dev-shm-usage", "--no-sandbox", + "--verbose", "--window-size=1920,1080", "--guest"); +// options.addArguments("--remote-allow-origins=*", "--verbose", "--guest"); driver = new ChromeDriver(options); wait = new WebDriverWait(driver, Duration.ofSeconds(10)); } @@ -71,6 +77,15 @@ public void cleanup() throws IOException { } } + //@AfterMethod //uncomment to debug + public void tearDown(ITestResult result) throws IOException { + if (result.getStatus() == ITestResult.FAILURE) { + WebElement element = driver.findElement(By.tagName("html")); + File source = element.getScreenshotAs(OutputType.FILE); + FileHandler.copy(source, new File("/tmp/element_screenshot.png")); + } + } + protected void printInstallLogFile() { String testConfigPath = System.getProperty("test.config.path"); Path installLog = Paths.get(testConfigPath, "install.log"); diff --git a/openam-server/src/test/java/org/openidentityplatform/openam/test/integration/IT_SetupWithOpenDJ.java b/openam-server/src/test/java/org/openidentityplatform/openam/test/integration/IT_SetupWithOpenDJ.java index ded46cc689..3ca09ce98e 100644 --- a/openam-server/src/test/java/org/openidentityplatform/openam/test/integration/IT_SetupWithOpenDJ.java +++ b/openam-server/src/test/java/org/openidentityplatform/openam/test/integration/IT_SetupWithOpenDJ.java @@ -11,7 +11,7 @@ * Header, with the fields enclosed by brackets [] replaced by your own identifying * information: "Portions copyright [year] [name of copyright owner]". * - * Copyright 2025 3A Systems LLC. + * Copyright 2025-2026 3A Systems LLC. */ package org.openidentityplatform.openam.test.integration; @@ -115,11 +115,16 @@ private void testOpenAmInstallation(String openamUrl, Integer opendjPort) throws wait.until(ExpectedConditions.elementToBeClickable(By.id("nextTabButton"))).click(); - waitForElement(By.id("loadBalancerDisable")); + waitForElementVisible(By.id("loadBalancerDisable")); + waitForElementVisible(By.id("loadBalancerHostName")); + + Thread.sleep(1000); + wait.until(ExpectedConditions.elementToBeClickable(By.id("nextTabButton"))).click(); waitForElement(By.id("agentPassword")).sendKeys(PA_PASSWORD); waitForElement(By.id("agentConfirm")).sendKeys(PA_PASSWORD); + wait.until(ExpectedConditions.elementToBeClickable(By.id("nextTabButton"))).click(); diff --git a/openam-server/src/test/resources/logback-test.xml b/openam-server/src/test/resources/logback-test.xml index 0e89885211..03edb42d1b 100644 --- a/openam-server/src/test/resources/logback-test.xml +++ b/openam-server/src/test/resources/logback-test.xml @@ -6,7 +6,7 @@ - +