Фукидид: установить архетип с нуля - все тесты пропущены

Я искал повсюду ответы на этот вопрос. Похоже, что документация thucydides очень ограничена, и/или они не ожидали, что у людей возникнут проблемы так рано. В основном я читаю http://thucydides.info/docs/thucydides-one-page/thucydides.html с этим процессом.

Я создаю новый проект через

mvn archetype:generate

и выберите net.thucydides:thucydides-simple-archetype

После его установки я иду к своему settings.xml, расположенному по адресу /home/user/.m2/settings.xml, и ввожу:

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

И беги

mvn test thucydides:aggregate

И я получаю:

[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] ------------------------------------------------------------------------

Ничего не происходит? Тесты настроены, и они не @Pending или что-то в этом роде, они просто полностью игнорируются. Это SearchByKeywordStoryTest.java, который поставляется по умолчанию:

@Story(Application.Search.SearchByKeyword.class)
@RunWith(ThucydidesRunner.class)
public class SearchByKeywordStoryTest {

    @Managed(uniqueSession = true)
    public WebDriver webdriver;

    @ManagedPages(defaultUrl = "http://en.wiktionary.org/wiki/Wiktionary:Main_Page")
    public Pages pages;

    @Steps
    public EndUserSteps endUser;

    @Issue("#WIKI-1")
    @Test
    public void searching_by_keyword_apple_should_display_the_corresponding_article() {
        endUser.is_the_home_page();
        endUser.looks_for("apple");
        endUser.should_see_definition("A common, round fruit produced by the tree Malus domestica, cultivated in temperate climates.");

    }

    @Test
    public void searching_by_keyword_banana_should_display_the_corresponding_article() {
        endUser.is_the_home_page();
        endUser.looks_for("pear");
        endUser.should_see_definition("An edible fruit produced by the pear tree, similar to an apple but elongated towards the stem.");
    }

    @Pending @Test
    public void searching_by_ambiguious_keyword_should_display_the_disambiguation_page() {
    }
} 

Я ценю любую помощь. Я понятия не имею, чего мне не хватает - я новичок в maven, selenium и thucydides, поэтому я уверен, что делаю что-то не так. Как только я запущу тесты JUnit, я буду готов к работе... Спасибо.


person ricky116    schedule 25.04.2014    source источник


Ответы (2)


Нашел - в моем 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>

Я не видел этого, когда задавал вопрос. Почему это должно быть стандартом в архетипе? Понятия не имею.

Спасибо.

person ricky116    schedule 25.04.2014

Архетип по умолчанию настраивает все для запуска как интеграционные, а не модульные тесты (т. е. отказоустойчивые, а не надежные).

Это означает, что они не запускаются на mvn:test, нужно сделать mvn:verify.

Видеть:

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

person soru    schedule 30.07.2014