I’m currently working on an automation framework and the feature I am implementing right now is the possibility to log the messages on start and the end of the methods annotated with @Step from allure.
The issue is that I had a good-looking reports with steps described but whenever I tried to create some aspects I am missing all the Steps in my reports.
Currently thinking that the issue is connected maybe with AssertJ and Allure conflicts but I am entirely not sure what could be the exact issue. Maybe some of you are familiar with such issue and could point me in what direction to investigate since I’ve tried redesigning pom.xml file, disabling aop-ajc.xml file and whenever I delete my own aop.xml file the issue is not present but I cannot weave.
Here’s my pom.xml file example:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.example</groupId>
<artifactId>ATPW</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
<maven.compiler.source>22</maven.compiler.source>
<maven.compiler.target>22</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>22</java.version>
<playwright.version>1.41.2</playwright.version>
<junit.version>5.10.2</junit.version>
<allure.version>2.25.0</allure.version>
<allure-maven.version>2.12.0</allure-maven.version>
<allure-junit5.version>2.25.0</allure-junit5.version>
<maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>
<aspectj.version>1.9.22</aspectj.version>
<lombok.version>1.18.32</lombok.version>
<log4j.version>2.23.1</log4j.version>
<aspectj.version>1.9.22</aspectj.version>
</properties>
<dependencies>
<dependency>
<groupId>com.microsoft.playwright</groupId>
<artifactId>playwright</artifactId>
<version>${playwright.version}</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>${junit.version}</version>
</dependency>
<dependency>
<groupId>io.qameta.allure</groupId>
<artifactId>allure-junit5</artifactId>
<version>${allure.version}</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>${log4j.version}</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>${log4j.version}</version>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId>
<version>${aspectj.version}</version>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<version>${aspectj.version}</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.2.5</version>
<configuration>
<properties>
<configurationParameters>
junit.jupiter.execution.parallel.enabled=true
junit.jupiter.execution.parallel.mode.default=concurrent
</configurationParameters>
<property>
<name>listener</name>
<value>io.qameta.allure.junit5.AllureJunit5</value>
</property>
</properties>
<systemProperties>
<property>
<name>allure.results.directory</name>
<value>${project.basedir}/target/allure-results</value>
</property>
<property>
<name>junit.jupiter.extensions.autodetection.enabled</name>
<value>true</value>
</property>
</systemProperties>
<includes>
<include>**/*Tests.java</include>
</includes>
<argLine>
-javaagent:"${settings.localRepository}orgaspectjaspectjweaver${aspectj.version}aspectjweaver-${aspectj.version}.jar"
</argLine>
</configuration>
<dependencies>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<version>${aspectj.version}</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>${junit.version}</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>${junit.version}</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>io.qameta.allure</groupId>
<artifactId>allure-maven</artifactId>
<version>${allure-maven.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven-compiler-plugin.version}</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
</configuration>
</plugin>
<!-- <plugin>-->
<!-- <groupId>dev.aspectj</groupId>-->
<!-- <artifactId>aspectj-maven-plugin</artifactId>-->
<!-- <version>1.14</version>-->
<!-- <dependencies>-->
<!-- <dependency>-->
<!-- <groupId>org.aspectj</groupId>-->
<!-- <artifactId>aspectjtools</artifactId>-->
<!-- <version>${aspectj.version}</version>-->
<!-- </dependency>-->
<!-- </dependencies>-->
<!-- <configuration>-->
<!-- <complianceLevel>22</complianceLevel>-->
<!-- <showWeaveInfo>true</showWeaveInfo>-->
<!-- <verbose>true</verbose>-->
<!-- <encoding>UTF-8</encoding>-->
<!-- </configuration>-->
<!-- <executions>-->
<!-- <execution>-->
<!-- <goals>-->
<!-- <goal>compile</goal>-->
<!-- <goal>test-compile</goal>-->
<!-- </goals>-->
<!-- </execution>-->
<!-- </executions>-->
<!-- </plugin>-->
</plugins>
</build>
</project>
aop.xml example:
<aspectj>
<weaver options="-verbose">
<include within="test.java.*"/>
</weaver>
<aspects>
<aspect name="utils.logging.LoggingAspect"/>
</aspects>
</aspectj>
Report with AssertJ enabled
Report with AssertJ disabled
Vanadium is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.