Package allurium.aspects
Class TextFieldAspects
java.lang.Object
allurium.aspects.TextFieldAspects
Aspect for enhancing the behavior of the
TextField class by adding Allure reporting capabilities.
This aspect wraps specific methods in the `TextField` class to log their execution details as steps in Allure reports. It improves test reporting by providing detailed visibility into actions and assertions performed on text fields.
Features:
- Wraps common operations on text fields (e.g., writing text, clearing, pressing enter).
- Logs operations and assertions into Allure reports with context (e.g., text field name, value).
- Handles success and failure scenarios for assertions with appropriate status updates.
Purpose:
- Enhances test step visibility by logging text field interactions and validations in Allure reports.
- Standardizes the reporting of text field-related operations across test cases.
Usage Example:
// Interacting with a text field
TextField textField = new TextField("input#username");
textField.write("exampleUser"); // Logs "Write 'exampleUser' to text field" in Allure
textField.clear(); // Logs "Clear text field" in Allure
textField.pressEnter(); // Logs "Press Enter on text field" in Allure
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidstepAssertCurrentValue(org.aspectj.lang.ProceedingJoinPoint invocation) Logs the execution ofTextField.assertCurrentValue(String)as an Allure step.voidstepAssertCurrentValueContains(org.aspectj.lang.ProceedingJoinPoint invocation) Logs the execution ofTextField.assertCurrentValueContains(String)as an Allure step.voidstepAssertEmptyInjection(org.aspectj.lang.ProceedingJoinPoint invocation) Logs the execution ofTextField.assertEmpty()as an Allure step.voidstepAssertNotEmpty(org.aspectj.lang.ProceedingJoinPoint invocation) Logs the execution ofTextField.assertNotEmpty()as an Allure step.voidstepClearInjection(org.aspectj.lang.ProceedingJoinPoint invocation) Logs the execution ofTextField.clear()as an Allure step.voidstepPressEnterInjection(org.aspectj.lang.ProceedingJoinPoint invocation) Logs the execution ofTextField.pressEnter()as an Allure step.voidstepWriteInjection(org.aspectj.lang.ProceedingJoinPoint invocation) Logs the execution ofTextField.write(String)as an Allure step.
-
Constructor Details
-
TextFieldAspects
public TextFieldAspects()
-
-
Method Details
-
stepWriteInjection
Logs the execution ofTextField.write(String)as an Allure step.- Parameters:
invocation- the join point representing the method invocation- Throws:
Throwable- if the original method throws an exception
-
stepClearInjection
Logs the execution ofTextField.clear()as an Allure step.- Parameters:
invocation- the join point representing the method invocation- Throws:
Throwable- if the original method throws an exception
-
stepPressEnterInjection
public void stepPressEnterInjection(org.aspectj.lang.ProceedingJoinPoint invocation) throws Throwable Logs the execution ofTextField.pressEnter()as an Allure step.- Parameters:
invocation- the join point representing the method invocation- Throws:
Throwable- if the original method throws an exception
-
stepAssertEmptyInjection
public void stepAssertEmptyInjection(org.aspectj.lang.ProceedingJoinPoint invocation) throws Throwable Logs the execution ofTextField.assertEmpty()as an Allure step.- Parameters:
invocation- the join point representing the method invocation- Throws:
Throwable- if the original method throws an exception
-
stepAssertNotEmpty
Logs the execution ofTextField.assertNotEmpty()as an Allure step.- Parameters:
invocation- the join point representing the method invocation- Throws:
Throwable- if the original method throws an exception
-
stepAssertCurrentValue
public void stepAssertCurrentValue(org.aspectj.lang.ProceedingJoinPoint invocation) throws Throwable Logs the execution ofTextField.assertCurrentValue(String)as an Allure step.- Parameters:
invocation- the join point representing the method invocation- Throws:
Throwable- if the original method throws an exception
-
stepAssertCurrentValueContains
public void stepAssertCurrentValueContains(org.aspectj.lang.ProceedingJoinPoint invocation) throws Throwable Logs the execution ofTextField.assertCurrentValueContains(String)as an Allure step.- Parameters:
invocation- the join point representing the method invocation- Throws:
Throwable- if the original method throws an exception
-