Package allurium.aspects
Class ImageAspects
java.lang.Object
allurium.aspects.ImageAspects
Aspect for intercepting methods in the
Image
class to enhance Allure reporting.
This aspect specifically targets methods of the `Image` class to provide step-level reporting in Allure, capturing methods details and outcomes (pass/fail).
Features:
- Intercepts the
Image.assertSrcUrl(String)
method. - Generates detailed Allure steps with information about the element, its type, and the expected source URL.
- Handles both successful and failed assertions, updating the Allure step status accordingly.
Purpose:
- Enhances test reporting by integrating aspect-oriented programming with Allure.
- Provides detailed insights into assertion checks performed on image elements.
Usage:
// In a test, asserting the source URL of an image:
Image image = $image("img.logo");
image.assertSrcUrl("https://example.com/logo.png");
// Allure will capture the step with relevant details through this aspect.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
stepAssertSrcUrl
(org.aspectj.lang.ProceedingJoinPoint invocation) Intercepts theImage.assertSrcUrl(String)
method to log an Allure step.
-
Constructor Details
-
ImageAspects
public ImageAspects()
-
-
Method Details
-
stepAssertSrcUrl
Intercepts theImage.assertSrcUrl(String)
method to log an Allure step.Captures the expected source URL and details about the image element, and logs the step status (PASSED or FAILED) in Allure.
- Parameters:
invocation
- the join point representing the intercepted method- Throws:
Throwable
- if the intercepted method throws any exception
-