openvidu-test-e2e: add screenshot logging on timeout in E2E tests

pull/882/head
pabloFuente 2026-04-07 16:04:24 +02:00
parent 266e30cd1f
commit 16bc1ad5bd
1 changed files with 7 additions and 0 deletions

View File

@ -46,6 +46,7 @@ import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.openqa.selenium.By;
import org.openqa.selenium.Keys;
import org.openqa.selenium.TakesScreenshot;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;
@ -73,6 +74,8 @@ import io.openvidu.test.e2e.annotations.OnlyPion;
import livekit.LivekitIngress.IngressInfo;
import livekit.LivekitIngress.IngressState;
import static org.openqa.selenium.OutputType.BASE64;
/**
* E2E tests for openvidu-testapp.
*
@ -2815,6 +2818,10 @@ public class OpenViduTestAppE2eTest extends AbstractOpenViduTestappE2eTest {
try {
Thread.sleep(retryIntervalMillis);
} catch (InterruptedException e) {
// Print screenshot
String screenshot = "data:image/png;base64," + ((TakesScreenshot) user.getDriver()).getScreenshotAs(BASE64);
System.out.println("TIMEOUT WAITING FOR ELEMENT TO BE CLICKABLE: " + cssSelector);
System.out.println(screenshot);
Thread.currentThread().interrupt();
throw new RuntimeException("Thread interrupted while waiting for backdrop to clear", e);
}