mirror of https://github.com/OpenVidu/openvidu.git
openvidu-test-e2e: add screenshot logging on timeout in E2E tests
parent
266e30cd1f
commit
16bc1ad5bd
|
|
@ -46,6 +46,7 @@ import org.junit.jupiter.api.Test;
|
||||||
import org.junit.jupiter.api.extension.ExtendWith;
|
import org.junit.jupiter.api.extension.ExtendWith;
|
||||||
import org.openqa.selenium.By;
|
import org.openqa.selenium.By;
|
||||||
import org.openqa.selenium.Keys;
|
import org.openqa.selenium.Keys;
|
||||||
|
import org.openqa.selenium.TakesScreenshot;
|
||||||
import org.openqa.selenium.WebElement;
|
import org.openqa.selenium.WebElement;
|
||||||
import org.openqa.selenium.support.ui.ExpectedConditions;
|
import org.openqa.selenium.support.ui.ExpectedConditions;
|
||||||
import org.openqa.selenium.support.ui.WebDriverWait;
|
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.IngressInfo;
|
||||||
import livekit.LivekitIngress.IngressState;
|
import livekit.LivekitIngress.IngressState;
|
||||||
|
|
||||||
|
import static org.openqa.selenium.OutputType.BASE64;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* E2E tests for openvidu-testapp.
|
* E2E tests for openvidu-testapp.
|
||||||
*
|
*
|
||||||
|
|
@ -2815,6 +2818,10 @@ public class OpenViduTestAppE2eTest extends AbstractOpenViduTestappE2eTest {
|
||||||
try {
|
try {
|
||||||
Thread.sleep(retryIntervalMillis);
|
Thread.sleep(retryIntervalMillis);
|
||||||
} catch (InterruptedException e) {
|
} 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();
|
Thread.currentThread().interrupt();
|
||||||
throw new RuntimeException("Thread interrupted while waiting for backdrop to clear", e);
|
throw new RuntimeException("Thread interrupted while waiting for backdrop to clear", e);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue