Skip to content

Commit f6d7d39

Browse files
Removed abstract for WebBaseTest & WebBasePage classes.
1 parent b4a29f4 commit f6d7d39

4 files changed

Lines changed: 7 additions & 7 deletions

File tree

src/main/java/io/swaglabs/portal/qa/commons/WebBasePage.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
import java.util.Objects;
99

10-
public abstract class WebBasePage {
10+
public class WebBasePage {
1111

1212
protected Page basePage;
1313
protected Locators locators;

src/main/java/io/swaglabs/portal/qa/utils/ScreenshotsUtils.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,14 @@ public static ScreenshotsUtils getInstance() {
3030
return instance;
3131
}
3232

33-
public ScreenshotContext takeFullPageScreenshotContext(Page page) {
33+
public void takeFullPageScreenshotContext(Page page, String filePath) {
3434
Objects.requireNonNull(page, "Page cannot be null.");
35-
return new ScreenshotContext(new FullPageScreenshotStrategy(page));
35+
new ScreenshotContext(new FullPageScreenshotStrategy(page)).captureScreenshot(filePath);
3636
}
3737

38-
public ScreenshotContext takeViewportScreenshotContext(Page page) {
38+
public void takeViewportScreenshotContext(Page page, String filePath) {
3939
Objects.requireNonNull(page, "Page cannot be null.");
40-
return new ScreenshotContext(new ViewportScreenshotStrategy(page));
40+
new ScreenshotContext(new ViewportScreenshotStrategy(page)).captureScreenshot(filePath);
4141
}
4242

4343
public void takeElementScreenshot(Locator locator, String fileName) {

src/test/java/io/swaglabs/portal/qa/commons/WebBaseTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
import java.util.Objects;
1919

2020
@Slf4j
21-
public abstract class WebBaseTest {
21+
public class WebBaseTest {
2222

2323
protected static ThreadLocal<Page> page = new ThreadLocal<>();
2424
private static final ThreadLocal<Playwright> PLAYWRIGHT = new ThreadLocal<>();

src/test/java/io/swaglabs/portal/qa/listeners/WebTestListeners.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ private void takeScreenshot(ITestResult testResult) {
7171
String filePath = Paths.get(dirPath, fileName).toString();
7272
try {
7373
Files.createDirectories(Paths.get(dirPath));
74-
WebPortalConstants.SCREENSHOTS_UTILS.takeFullPageScreenshotContext(currentPage).captureScreenshot(filePath);
74+
WebPortalConstants.SCREENSHOTS_UTILS.takeFullPageScreenshotContext(currentPage, filePath);
7575
} catch (IOException e) {
7676
log.error("Screenshot failed for {}: {}", testName, e.getMessage());
7777
}

0 commit comments

Comments
 (0)