From 6c0d7cd46e03f1c41e1108b6e629ecf57dafc594 Mon Sep 17 00:00:00 2001 From: "J. Koster" Date: Wed, 9 Oct 2024 19:16:20 +0200 Subject: [PATCH] STNG-165 Improve unit test error logging, on Selenium testing (#188) --- .../org/dcsa/conformance/frontend/SeleniumTestBase.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/spring-boot/src/test/java/org/dcsa/conformance/frontend/SeleniumTestBase.java b/spring-boot/src/test/java/org/dcsa/conformance/frontend/SeleniumTestBase.java index 0f1d71e6..b7d56fb8 100644 --- a/spring-boot/src/test/java/org/dcsa/conformance/frontend/SeleniumTestBase.java +++ b/spring-boot/src/test/java/org/dcsa/conformance/frontend/SeleniumTestBase.java @@ -3,6 +3,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; import static org.junit.jupiter.api.Assumptions.assumeFalse; import java.time.Duration; @@ -106,6 +107,7 @@ void runScenarioGroups() { log.info("Stopping after first scenario group"); break; } + log.info("Finished scenario group {}.", i + 1); } } @@ -125,6 +127,10 @@ private boolean handleJsonPromptForText() { promptText = fetchTransportDocument(promptText); } + if (driver.findElements(By.id("actionInput")).isEmpty()) { + log.error("Error: No actionInput element found, while a jsonForPromptText was displayed!"); + fail(); + } driver.findElement(By.id("actionInput")).sendKeys(promptText); driver.findElement(By.id("submitActionButton")).click(); waitForUIReadiness();