Проблема в том, что у меня были красивые отчеты с описанием шагов, но всякий раз, когда я пытался создать некоторые аспекты, я пропускал все шаги в своих отчетах.
Сейчас я думаю, что Возможно, проблема связана с конфликтами AspectJ и Allure, но я совершенно не уверен, в чем именно может быть проблема. Возможно, некоторые из вас знакомы с такой проблемой и могли бы указать мне, в каком направлении исследовать, поскольку я пытался перепроектировать файл pom.xml, отключив файл aop-ajc.xml, и всякий раз, когда я удаляю свой собственный файл aop.xml, проблема не возникает. присутствует, но я не могу ткать.
Вот пример моего файла pom.xml:
Код: Выделить всё
& l t ; p r o j e c t x m l n s = & q u o t ; h t t p : / / m a v e n . a p a c h e . o r g / P O M / 4 . 0 . 0 & q u o t ; < b r / > x m l n s : x s i = & q u o t ; h t t p : / / w w w . w 3 . o r g / 2 0 0 1 / X M L S c h e m a - i n s t a n c e & q u o t ; < b r / > x s i : s c h e m a L o c a t i o n = & q u o t ; h t t p : / / m a v e n . a p a c h e . o r g / P O M / 4 . 0 . 0 h t t p : / / m a v e n . a p a c h e . o r g / x s d / m a v e n - 4 . 0 . 0 . x s d & q u o t ; & g t ; < b r / > & l t ; m o d e l V e r s i o n & g t ; 4 . 0 . 0 & l t ; / m o d e l V e r s i o n & g t ; < b r / > < b r / > & l t ; g r o u p I d & g t ; o r g . e x a m p l e & l t ; / g r o u p I d & g t ; < b r / > & l t ; a r t i f a c t I d & g t ; A T P W & l t ; / a r t i f a c t I d & g t ; < b r / > & l t ; v e r s i o n & g t ; 1 . 0 - S N A P S H O T & l t ; / v e r s i o n & g t ; < b r / > < b r / > & l t ; p r o p e r t i e s & g t ; < b r / > & l t ; m a v e n . c o m p i l e r . s o u r c e & g t ; 2 2 & l t ; / m a v e n . c o m p i l e r . s o u r c e & g t ; < b r / > & l t ; m a v e n . c o m p i l e r . t a r g e t & g t ; 2 2 & l t ; / m a v e n . c o m p i l e r . t a r g e t & g t ; < b r / > & l t ; p r o j e c t . b u i l d . s o u r c e E n c o d i n g & g t ; U T F - 8 & l t ; / p r o j e c t . b u i l d . s o u r c e E n c o d i n g & g t ; < b r / > < b r / > & l t ; j a v a . v e r s i o n & g t ; 2 2 & l t ; / j a v a . v e r s i o n & g t ; < b r / > & l t ; p l a y w r i g h t . v e r s i o n & g t ; 1 . 4 1 . 2 & l t ; / p l a y w r i g h t . v e r s i o n & g t ; < b r / > & l t ; j u n i t . v e r s i o n & g t ; 5 . 1 0 . 2 & l t ; / j u n i t . v e r s i o n & g t ; < b r / > & l t ; a l l u r e . v e r s i o n & g t ; 2 . 2 5 . 0 & l t ; / a l l u r e . v e r s i o n & g t ; < b r / > & l t ; a l l u r e - m a v e n . v e r s i o n & g t ; 2 . 1 2 . 0 & l t ; / a l l u r e - m a v e n . v e r s i o n & g t ; < b r / > & l t ; a l l u r e - j u n i t 5 . v e r s i o n & g t ; 2 . 2 5 . 0 & l t ; / a l l u r e - j u n i t 5 . v e r s i o n & g t ; < b r / > & l t ; m a v e n - c o m p i l e r - p l u g i n . v e r s i o n & g t ; 3 . 8 . 1 & l t ; / m a v e n - c o m p i l e r - p l u g i n . v e r s i o n & g t ; < b r / > & l t ; a s p e c t j . v e r s i o n & g t ; 1 . 9 . 2 2 & l t ; / a s p e c t j . v e r s i o n & g t ; < b r / > & l t ; l o m b o k . v e r s i o n & g t ; 1 . 1 8 . 3 2 & l t ; / l o m b o k . v e r s i o n & g t ; < b r / > & l t ; l o g 4 j . v e r s i o n & g t ; 2 . 2 3 . 1 & l t ; / l o g 4 j . v e r s i o n & g t ; < b r / > & l t ; a s p e c t j . v e r s i o n & g t ; 1 . 9 . 2 2 & l t ; / a s p e c t j . v e r s i o n & g t ; < b r / > & l t ; / p r o p e r t i e s & g t ; < b r / > < b r / > & l t ; d e p e n d e n c i e s & g t ; < b r / > & l t ; d e p e n d e n c y & g t ; < b r / > & l t ; g r o u p I d & g t ; c o m . m i c r o s o f t . p l a y w r i g h t & l t ; / g r o u p I d & g t ; < b r / > & l t ; a r t i f a c t I d & g t ; p l a y w r i g h t & l t ; / a r t i f a c t I d & g t ; < b r / > & l t ; v e r s i o n & g t ; $ { p l a y w r i g h t . v e r s i o n } & l t ; / v e r s i o n & g t ; < b r / > & l t ; / d e p e n d e n c y & g t ; < b r / > & l t ; d e p e n d e n c y & g t ; < b r / > & l t ; g r o u p I d & g t ; o r g . j u n i t . j u p i t e r & l t ; / g r o u p I d & g t ; < b r / > & l t ; a r t i f a c t I d & g t ; j u n i t - j u p i t e r - e n g i n e & l t ; / a r t i f a c t I d & g t ; < b r / > & l t ; v e r s i o n & g t ; $ { j u n i t . v e r s i o n } & l t ; / v e r s i o n & g t ; < b r / > & l t ; s c o p e & g t ; t e s t & l t ; / s c o p e & g t ; < b r / > & l t ; / d e p e n d e n c y & g t ; < b r / > & l t ; d e p e n d e n c y & g t ; < b r / > & l t ; g r o u p I d & g t ; o r g . j u n i t . j u p i t e r & l t ; / g r o u p I d & g t ; < b r / > & l t ; a r t i f a c t I d & g t ; j u n i t - j u p i t e r - a p i & l t ; / a r t i f a c t I d & g t ; < b r / > & l t ; v e r s i o n & g t ; $ { j u n i t . v e r s i o n } & l t ; / v e r s i o n & g t ; < b r / > & l t ; / d e p e n d e n c y & g t ; < b r / > & l t ; d e p e n d e n c y & g t ; < b r / > & l t ; g r o u p I d & g t ; i o . q a m e t a . a l l u r e & l t ; / g r o u p I d & g t ; < b r / > & l t ; a r t i f a c t I d & g t ; a l l u r e - j u n i t 5 & l t ; / a r t i f a c t I d & g t ; < b r / > & l t ; v e r s i o n & g t ; $ { a l l u r e . v e r s i o n } & l t ; / v e r s i o n & g t ; < b r / > & l t ; / d e p e n d e n c y & g t ; < b r / >
org.apache.logging.log4j
log4j-api
${log4j.version}
org.apache.logging.log4j
log4j-core
${log4j.version}
org.aspectj
aspectjrt
${aspectj.version}
org.aspectj
aspectjweaver
${aspectj.version}
maven-surefire-plugin
3.2.5
junit.jupiter.execution.parallel.enabled=true
junit.jupiter.execution.parallel.mode.default=concurrent
listener
io.qameta.allure.junit5.AllureJunit5
allure.results.directory
${project.basedir}/target/allure-results
junit.jupiter.extensions.autodetection.enabled
true
**/*Tests.java
-javaagent:"${settings.localRepository}\org\aspectj\aspectjweaver\${aspectj.version}\aspectjweaver-${aspectj.version}.jar"
org.aspectj
aspectjweaver
${aspectj.version}
org.junit.jupiter
junit-jupiter-api
${junit.version}
org.junit.jupiter
junit-jupiter-engine
${junit.version}
io.qameta.allure
allure-maven
${allure-maven.version}
org.apache.maven.plugins
maven-compiler-plugin
${maven-compiler-plugin.version}
${java.version}
${java.version}
Код: Выделить всё
Код: Выделить всё
package utils.logging;
import constants.LoggingMessage;
import io.qameta.allure.Step;
import org.aspectj.lang.annotation.*;
import org.junit.jupiter.api.DisplayName;
@Aspect
public class LoggingAspect {
private static final String STEP_LOGGING_ANNOTATION_VALUE = "execution(* steps.*.*(..)) && @annotation(step)";
private static final String TEST_LOGGING_ANNOTATION_VALUE = "execution(* tests.*.*(..)) && @annotation(displayName)";
@Before(STEP_LOGGING_ANNOTATION_VALUE)
public void logBeforeStep(Step step) {
AllureLogger.info(String.format(LoggingMessage.StepsAction.STEP_EXECUTION_START, step.value()));
}
@After(STEP_LOGGING_ANNOTATION_VALUE)
public void logAfterStep(Step step) {
AllureLogger.info(String.format(LoggingMessage.StepsAction.STEP_EXECUTION_FINISH, step.value()));
}
@Before(TEST_LOGGING_ANNOTATION_VALUE)
public void logBeforeTest(DisplayName displayName) {
AllureLogger.info(String.format(LoggingMessage.TestsAction.TESTS_EXECUTION_START,
displayName.value()));
}
@After(TEST_LOGGING_ANNOTATION_VALUE)
public void logAfterTest(DisplayName displayName) {
AllureLogger.info(String.format(LoggingMessage.TestsAction.TESTS_EXECUTION_FINISH,
displayName.value()));
}
}
Код: Выделить всё
import io.qameta.allure.Step;
import pageobjects.pages.HomePage;
import static org.junit.jupiter.api.Assertions.*;
import static org.junit.jupiter.api.Assertions.assertTrue;
public class HomeSteps {
private final HomePage homePage = new HomePage();
@Step("Hover over Left Side menu")
public void hoverOverLeftSideMenu() {
homePage.leftSidePanelForm.hoverOverHomeContainer();
}
@Step("Select Call Center option from the container")
public void selectCallCenterOptionFromTheContainer() {
homePage.leftSidePanelForm.clickCallCenterButton();
}
@Step("Verify Left Side menu is displayed")
public void verifyLeftSideMenuIsDisplayed() {
assertTrue(homePage.leftSidePanelForm.isHomeContainerDisplayed(),
String.format(AssertMessage.ElementState.MENU_NOT_DISPLAYED, "Left Side", homePage.getName()));
}
}
Отчет с отключенным AspectJ
Подробнее здесь: https://stackoverflow.com/questions/787 ... with-aspec