Перейти к содержимому

Фотография

группирование тестов

selenium selenide JUnit5

  • Авторизуйтесь для ответа в теме
Сообщений в теме: 5

#1 dmitrijbuckov

dmitrijbuckov

    Новый участник

  • Members
  • Pip
  • 7 сообщений
  • ФИО:Dmitruj.B

Отправлено 14 февраля 2020 - 07:49

добрый день, пытаюсь сделать запуск тестов по группам.

пытался использовать аннотацию @Tag("link")

при запуске через IDE, командой "-Dtag=secondPriority clean test" запускает все тесты с аннотацией @Test

при запуске через IDE, командой "-Dtag=secondPriority" не запускает тесты вообще.

Также пробовал через аннотацию  @TestGroup("link")    библиотеки JUnit Test Groups, командой  "- Dtestgroup=link" результат такой же (без test тесты не стартуют, с test стартуют все с @Test)

Подскажите как быть?

 

 

 


  • 0

#2 BabyRoot

BabyRoot

    Специалист

  • Members
  • PipPipPipPipPip
  • 833 сообщений


Отправлено 14 февраля 2020 - 08:30

Судя по доке https://junit.org/ju...auncher-options

надо использовать

-t, --include-tag=TAG

  • 0

#3 dmitrijbuckov

dmitrijbuckov

    Новый участник

  • Members
  • Pip
  • 7 сообщений
  • ФИО:Dmitruj.B

Отправлено 14 февраля 2020 - 09:43

Если я правильно понял, то команда выглядит так: mvn -Dtag=secondPriority clean test -t

и такой вариант не работает

Unable to parse command line options: Missing argument for option: t

 

 

 


  • 0

#4 BabyRoot

BabyRoot

    Специалист

  • Members
  • PipPipPipPipPip
  • 833 сообщений


Отправлено 14 февраля 2020 - 11:56

pom ваш покажите.

Если вы используете maven-surefire-plugin - это по другому делается.

Я привёл пример для https://junit.org/ju...onsole-launcher


  • 0

#5 dmitrijbuckov

dmitrijbuckov

    Новый участник

  • Members
  • Pip
  • 7 сообщений
  • ФИО:Dmitruj.B

Отправлено 14 февраля 2020 - 12:34

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/20...chema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache....aven-4.0.0.xsd" >
<modelVersion>4.0.0</modelVersion>

<groupId>com.ostin</groupId>
<artifactId>autotestOstin</artifactId>
<version>1.0-SNAPSHOT</version>

<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<aspectj.version>1.8.10</aspectj.version>
</properties>

<dependencies>
<dependency>
<groupId>io.rest-assured</groupId>
<artifactId>rest-assured</artifactId>
<version>3.1.0</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.5.2</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<version>5.5.2</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.5.2</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-launcher</artifactId>
<version>1.2.0</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>io.qameta.allure</groupId>
<artifactId>allure-junit5</artifactId>
<version>2.7.0</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>com.codeborne</groupId>
<artifactId>selenide</artifactId>
<version>5.2.3</version>
</dependency>

<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-all</artifactId>
<version>1.3</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.7.25</version>
</dependency>

<!-- нужен для того что бы все листнеры отработали-->
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.3.0</version>
</dependency>
<dependency>
<groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId>
<version>13.0</version>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.14.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit-pioneer</groupId>
<artifactId>junit-pioneer</artifactId>
<version>0.5.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.github.ferstl</groupId>
<artifactId>junit-testgroups</artifactId>
<version>1.0.1</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>

<resources>
<resource>
<directory>src/test/resources</directory>
<filtering>true</filtering>
</resource>
</resources>

<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.19.1</version>
<configuration>
<parallel>methods</parallel>
<threadCount>2</threadCount>
<properties>
<includeTags>link</includeTags>
</properties>
</configuration>
<dependencies>
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-surefire-provider</artifactId>
<version>1.1.0</version>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<version>${aspectj.version}</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>io.qameta.allure</groupId>
<artifactId>allure-maven</artifactId>
<version>2.9</version>
<configuration>
<resultsDirectory>${basedir}/target/allure-results</resultsDirectory>
<reportDirectory>${basedir}/target/allurereport</reportDirectory>
</configuration>
</plugin>
</plugins>
</build>
</project>

 


  • 0

#6 dmitrijbuckov

dmitrijbuckov

    Новый участник

  • Members
  • Pip
  • 7 сообщений
  • ФИО:Dmitruj.B

Отправлено 14 февраля 2020 - 13:51

Вопрос закрыт.

Решение:

перед методом аннотация @Tag("groupID")

а в pom.xml

 

<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.19.1</version>
<configuration>
<parallel>methods</parallel>
<threadCount>2</threadCount>
<groups>GroupID</groups>
<excludedGroups>link</excludedGroups>
</configuration><
</plugin>


  • 0



Темы с аналогичным тегами selenium, selenide, JUnit5

Количество пользователей, читающих эту тему: 0

0 пользователей, 0 гостей, 0 анонимных