Improved screenshots

This commit is contained in:
2023-02-24 16:03:33 -06:00
parent 1b3b26bdbb
commit be6d4bb657
3 changed files with 9 additions and 3 deletions

View File

@ -6,6 +6,7 @@ import io.github.bonigarcia.wdm.WebDriverManager;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.TestInfo;
import org.openqa.selenium.Dimension;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
@ -23,6 +24,8 @@ public class QBaseSeleniumTest
protected QSeleniumJavalin qSeleniumJavalin;
protected QSeleniumLib qSeleniumLib;
private int screenshotIndex = 1;
/*******************************************************************************
@ -81,9 +84,9 @@ public class QBaseSeleniumTest
**
*******************************************************************************/
@AfterEach
void afterEach()
void afterEach(TestInfo testInfo)
{
qSeleniumLib.takeScreenshotToFile();
qSeleniumLib.takeScreenshotToFile(getClass().getSimpleName() + "/" + testInfo.getDisplayName());
if(driver != null)
{