Thucydides:从头开始安装archetype - 跳过所有测试

时间:2014-04-25 15:50:51

标签: java maven selenium thucydides

我到处寻找答案。看起来thucydides的文档非常有限和/或他们并没有期望人们这么早就遇到问题。我主要关注http://thucydides.info/docs/thucydides-one-page/thucydides.html这个过程。

我通过

创建了一个新项目
mvn archetype:generate

并选择net.thucydides:thucydides-simple-archetype

安装完毕后,我会转到位于settings.xml的{​​{1}}并输入:

/home/user/.m2/settings.xml

然后运行

<pluginGroups>
  <pluginGroup>net.thucydides.maven.plugins</pluginGroup>
</pluginGroups>

我得到了:

mvn test thucydides:aggregate

什么都没发生?测试已经设置好,它们不是@Pending或任何东西,它们只是被完全忽略了。这是默认提供的SearchByKeywordStoryTest.java:

[INFO] ------------------------------------------------------------------------
[INFO] Building Sample Thucydides project 1
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ .thucydides ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /opt/AM_Thucydides/thucydides/src/main/resources
[INFO] 
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ .thucydides ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ .thucydides ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /opt/AM_Thucydides/thucydides/src/test/resources
[INFO] 
[INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) @ .thucydides ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-surefire-plugin:2.12:test (default-test) @ .thucydides ---
[INFO] Tests are skipped.
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building Sample Thucydides project 1
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-thucydides-plugin:0.9.229:aggregate (default-cli) @ .thucydides ---
[INFO] LOADING LOCAL THUCYDIDES PROPERTIES FROM /home/user/thucydides.properties 
[INFO] LOADING LOCAL THUCYDIDES PROPERTIES FROM /opt/AM_Thucydides/thucydides/thucydides.properties 
[INFO] LOADING LOCAL THUCYDIDES PROPERTIES FROM /opt/AM_Thucydides/thucydides/thucydides.properties 
[INFO] Using requirements providers: [net.thucydides.core.statistics.service.AnnotationBasedTagProvider@40712ee9, net.thucydides.core.statistics.service.FeatureStoryTagProvider@2e53b094, net.thucydides.core.requirements.FileSystemRequirementsTagProvider@39fa8ad2, net.thucydides.core.requirements.AnnotationBasedTagProvider@76ddd61a]
[INFO] ADDING REQUIREMENTS PROVIDER net.thucydides.core.requirements.FileSystemRequirementsTagProvider@39fa8ad2
[INFO] ADDING REQUIREMENTS PROVIDER net.thucydides.core.requirements.AnnotationBasedTagProvider@76ddd61a
[INFO] Reading requirements from net.thucydides.core.requirements.FileSystemRequirementsTagProvider@39fa8ad2
[INFO] Reading requirements from net.thucydides.core.requirements.AnnotationBasedTagProvider@76ddd61a
[INFO] Requirements found:[]
log4j:WARN No appenders could be found for logger (freemarker.cache).
log4j:WARN Please initialize the log4j system properly.
[INFO] Generating release reports for: []
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 18.164 s
[INFO] Finished at: 2014-04-25T11:38:33-05:00
[INFO] Final Memory: 16M/120M
[INFO] ------------------------------------------------------------------------

我感谢任何帮助。我不知道自己错过了什么 - 我是maven,selenium和thucydides的新手,所以我确定我做错了什么。一旦我实际运行了JUnit测试,我就会很高兴...谢谢。

2 个答案:

答案 0 :(得分:1)

找到它 - 在我的POM中我有:

    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>2.12</version>
            <configuration>
                <skip>true</skip>
            </configuration>
        </plugin>
        ...
    </plugins>

当我问这个问题时,我没有看到。为什么这是原型的标准?我不知道。

感谢。

答案 1 :(得分:0)

默认原型将所有内容配置为作为集成测试运行,而不是单元测试(即故障安全而不是确定无误)。

这意味着他们不会在mvn:test上运行,需要做mvn:verify。

请参阅:

http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html