Selenide:魅力报告中缺少@Step注释

时间:2019-06-10 08:11:43

标签: java selenium allure selenide

我有以下问题:

这是我的仓库:https://github.com/mtpx/N

在页面类中,我使用@Step注释,在魅力报告中执行测试后,我们看到:enter image description here

我想看到我的@Steps而不是:      $(By.xpath:// div [@ id ='messages_container'] // span [@ class ='ui-growl-title'] [0])get text()

您知道该怎么做吗? 我尝试使用https://automated-testing.info/t/pomogite-razobratsya-s-otobrazheniem-step-v-allure-otchete/12045/5的解决方案,将pom.xml更改为

<?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>com</groupId>
    <artifactId>nawa</artifactId>
    <version>1.0-SNAPSHOT</version>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <aspectj.version>1.9.4</aspectj.version>

            <maven.compiler.source>1.6</maven.compiler.source>
            <maven.compiler.target>1.6</maven.compiler.target>

    </properties>
    <dependencies>
        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <version>7.0.0-beta4</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.github.javafaker</groupId>
            <artifactId>javafaker</artifactId>
            <version>0.2</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>io.github.bonigarcia</groupId>
            <artifactId>webdrivermanager</artifactId>
            <version>3.6.1</version>
        </dependency>
        <dependency>
            <groupId>com.codeborne</groupId>
            <artifactId>selenide</artifactId>
            <version>5.2.3</version>
        </dependency>
        <!-- https://mvnrepository.com/artifact/io.qameta.allure/allure-testng -->
       <dependency>
            <groupId>io.qameta.allure</groupId>
            <artifactId>allure-testng</artifactId>
            <version>2.12.1</version>
        </dependency>


        <dependency>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>selenium-java</artifactId>
            <version>3.141.59</version>
     </dependency>
      <!--        <dependency>
            <groupId>io.qameta.allure</groupId>
            <artifactId>allure-selenide</artifactId>
            <version>2.12.1</version>
            <scope>test</scope>
        </dependency>-->
             <dependency>
                      <groupId>ru.yandex.qatools.allure</groupId>
                      <artifactId>allure-testng-adaptor</artifactId>
                      <version>1.5.4</version>
                  </dependency>
        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <version>7.0.0-beta4</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <version>6.14.3</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.qameta.allure</groupId>
            <artifactId>allure-selenide</artifactId>
            <version>2.12.1</version>
            <scope>test</scope>
        </dependency>

    </dependencies>
         <build>
             <plugins>
                 <plugin>
                     <groupId>org.apache.maven.plugins</groupId>
                     <artifactId>maven-compiler-plugin</artifactId>
                     <version>3.6.1</version>
                     <configuration>
                         <source>1.8</source>
                         <target>1.8</target>
                     </configuration>
                 </plugin>
                 <plugin>
                     <groupId>org.apache.maven.plugins</groupId>
                     <artifactId>maven-surefire-plugin</artifactId>
                     <version>2.20</version>
                     <configuration>
                         <argLine>
                             -javaagent:"${settings.localRepository}/org/aspectj/aspectjweaver/${aspectj.version}/aspectjweaver-${aspectj.version}.jar"
                         </argLine>
                     </configuration>
                     <dependencies>
                         <dependency>
                             <groupId>org.aspectj</groupId>
                             <artifactId>aspectjweaver</artifactId>
                             <version>${aspectj.version}</version>
                         </dependency>
                     </dependencies>
                 </plugin>
             </plugins>
         </build>

     </project>

但是现在我无法编译我的项目,日志:

  

[错误]无法执行目标   org.apache.maven.plugins:maven-surefire-plugin:2.20:test   (默认测试)在项目nawa上:存在测试失败。 [错误]   [错误]请参阅   C:\ Users \ mkrasny \ IdeaProjects \ nawa \ target \ surefire-reports   个别测试结果。 [错误]请参考转储文件(如果有)   存在)[date] -jvmRun [N] .dump,[date] .dumpstream和   [date] -jvmRun [N] .dumpstream。 [ERROR]分叉中存在错误   进程[ERROR] javax / xml / bind / ValidationEventLocator [ERROR]   org.apache.maven.surefire.booter.SurefireBooterForkException:存在   是分叉过程中的错误[ERROR]   javax / xml / bind / ValidationEventLocator [ERROR]位于   org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:665)   在[ERROR]   org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:533)   在[ERROR]   org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:279)   在[ERROR]   org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:243)   在[ERROR]   org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeProvider(AbstractSurefireMojo.java:1077)   在[ERROR]   org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked(AbstractSurefireMojo.java:907)   在[ERROR]   org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute(AbstractSurefireMojo.java:785)   在[ERROR]   org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:137)   在[ERROR]   org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:210)   在[ERROR]   org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:156)   在[ERROR]   org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:148)   在[ERROR]   org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)   在[ERROR]   org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)   在[ERROR]   org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:56)   在[ERROR]   org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)   在[ERROR]   org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:305)[错误]   在org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:192)   在[ERROR]   org.apache.maven.DefaultMaven.execute(DefaultMaven.java:105)[错误]   在org.apache.maven.cli.MavenCli.execute(MavenCli.java:956)处[错误]在   org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)在[错误]   org.apache.maven.cli.MavenCli.main(MavenCli.java:192)在[错误]   java.base / jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(本机   方法)处的[错误]   java.base / jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)   在[ERROR]   java.base / jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)   java.base / java.lang.reflect.Method.invoke上的[错误](Method.java:564)   在[ERROR]   org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:282)   在[ERROR]   org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:225)   在[ERROR]   org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:406)   在[ERROR]   org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:347)   [错误] [错误]-> [帮助1] [错误] [错误]查看完整堆栈   跟踪错误,使用-e开关重新运行Maven。 [ERROR]重新运行   Maven使用-X开关启用完整的调试日志记录。 [错误]   [ERROR]有关错误和可能的解决方案的详细信息,   请阅读以下文章:[错误] [帮助1]   http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

1 个答案:

答案 0 :(得分:0)

从pom.xml中删除allure-selenide依赖项:

<dependency>
    <groupId>io.qameta.allure</groupId>
    <artifactId>allure-selenide</artifactId>
    <version>2.12.1</version>
    <scope>test</scope>
</dependency>