mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-09-20 04:35:32 +00:00
Bug 4693: Using a distinct file name for each screenshot to not override
existing images
This commit is contained in:
+4
-2
@@ -176,7 +176,7 @@ public abstract class AbstractSeleniumTest {
|
||||
@Override
|
||||
public void failed(Throwable cause, FrameworkMethod method) {
|
||||
try {
|
||||
captureScreenshot(UUID.randomUUID().toString());
|
||||
captureScreenshots();
|
||||
} catch (Exception exception) {
|
||||
exception.printStackTrace();
|
||||
}
|
||||
@@ -249,10 +249,12 @@ public abstract class AbstractSeleniumTest {
|
||||
* @throws IOException
|
||||
* if an I/O error occurs.
|
||||
*/
|
||||
protected void captureScreenshot(String filename) {
|
||||
protected void captureScreenshots() {
|
||||
File screenshotFolder = this.environment.getScreenshotFolder();
|
||||
if (screenshotFolder != null) {
|
||||
this.environment.getWindowManager().forEachOpenedWindow(window -> {
|
||||
final String filename = UUID.randomUUID().toString();
|
||||
|
||||
WebDriver driver = window.getWebDriver();
|
||||
if (RemoteWebDriver.class.equals(driver.getClass())) {
|
||||
driver = new Augmenter().augment(driver);
|
||||
|
||||
Reference in New Issue
Block a user