Package co.verisoft.fw.asserts
Class SoftAssertsScreenShot
java.lang.Object
co.verisoft.fw.asserts.SoftAsserts
co.verisoft.fw.asserts.SoftAssertsScreenShot
public class SoftAssertsScreenShot
extends co.verisoft.fw.asserts.SoftAsserts
This class extends the SoftAsserts class and provides functionality to capture screenshots
when assertions fail. It is responsible for saving screenshots in a specified folder and
attaching them to the report.
-
Constructor Summary
ConstructorsConstructorDescriptionSoftAssertsScreenShot
(VerisoftDriver driver) SoftAssertsScreenShot
(VerisoftDriver driver, boolean isMultipleScreenShots) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
handleFailure
(String message, AssertionError e) Handles assertion failures by capturing a screenshot and attaching it to the report.void
Captures a screenshot and attaches it to the report.Methods inherited from class co.verisoft.fw.asserts.SoftAsserts
assertAll, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertDoesNotThrow, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertNotEquals, assertNotNull, assertNotSame, assertNull, assertSame, assertTrue, toString
-
Constructor Details
-
SoftAssertsScreenShot
-
SoftAssertsScreenShot
-
-
Method Details
-
takeScreenshotAndAttachedToReport
public void takeScreenshotAndAttachedToReport()Captures a screenshot and attaches it to the report. This method takes a screenshot using the provided driver, saves it in the designated folder with a unique name based on the current date and time, and attaches it to the report. If an error occurs during the process, an error message is logged to the report. -
handleFailure
Handles assertion failures by capturing a screenshot and attaching it to the report.- Overrides:
handleFailure
in classco.verisoft.fw.asserts.SoftAsserts
- Parameters:
message
- The message to include with the screenshot in the report.e
- The AssertionError that occurred.
-