Package allurium.aspects
Class UploadFileInputAspects
java.lang.Object
allurium.aspects.UploadFileInputAspects
Aspect for adding Allure reporting capabilities to the
UploadField
class.
This aspect provides enhanced logging and reporting for file upload actions performed on UploadField
elements. It wraps specific methods to log their execution details as steps in Allure reports.
Features:
- Wraps the file upload methods of the
UploadField
class. - Logs detailed information about file upload actions in Allure reports, including file path and field name.
- Handles both success and failure scenarios, updating the Allure report with the appropriate status.
Purpose:
- Enhances test visibility by logging file upload actions and their results in Allure.
- Standardizes reporting for file upload interactions across test cases.
Usage Example:
// File upload interaction in a test
UploadField uploadField = new UploadField("input[type='file']");
uploadField.uploadFile("path/to/file.txt"); // Logs "Upload file: path/to/file.txt" in Allure
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
stepUploadFile
(org.aspectj.lang.ProceedingJoinPoint invocation) Wraps theUploadField.uploadFile(File)
method to log the file upload action in Allure.void
stepUploadFileViaPath
(org.aspectj.lang.ProceedingJoinPoint invocation) Wraps theUploadField.uploadFile(String)
method to log the file upload action in Allure.
-
Constructor Details
-
UploadFileInputAspects
public UploadFileInputAspects()
-
-
Method Details
-
stepUploadFileViaPath
Wraps theUploadField.uploadFile(String)
method to log the file upload action in Allure.- Parameters:
invocation
- the join point representing the method invocation- Throws:
Throwable
- if the original method throws an exception
-
stepUploadFile
Wraps theUploadField.uploadFile(File)
method to log the file upload action in Allure.- Parameters:
invocation
- the join point representing the method invocation- Throws:
Throwable
- if the original method throws an exception
-