cucumber.runtime.CucumberException: серверные ВМ не найдены. Убедитесь, что на вашем CLASSPATH есть серверный модуль. - PullRequest
0 голосов
/ 18 июня 2020

Вот мой класс testRunner: еще не завершен.

import cucumber.api.CucumberOptions;
import cucumber.api.junit.Cucumber;
import org.junit.runner.RunWith;

@RunWith(Cucumber.class)
@CucumberOptions(features= "src/test/resources/features/dhlcj", 
glue="dhl.gaqcjqa.fsApi.steps")
public class TestRunnerFsApi {

}

и мои зависимости: я не уверен, можно ли сопоставить версии.

<dependencies>

<!-- Junit -->
<dependency>
  <groupId>junit</groupId>
  <artifactId>junit</artifactId>
  <version>4.12</version>
</dependency>

<!-- Cucumber Junit -->
<dependency>
  <groupId>info.cukes</groupId>
  <artifactId>cucumber-junit</artifactId>
  <version>1.2.5</version>
</dependency>

<!-- Cucumber VM -->
<dependency>
  <groupId>io.cucumber</groupId>
  <artifactId>cucumber-java</artifactId>
  <version>4.1.1</version>
</dependency>

<!-- Gherkin -->
<dependency>
  <groupId>io.cucumber</groupId>
  <artifactId>gherkin</artifactId>
  <version>4.1.1</version>
</dependency>

<!-- Rest Assured -->
<dependency>
  <groupId>io.rest-assured</groupId>
  <artifactId>rest-assured</artifactId>
  <version>4.0.0</version>
</dependency>

<!-- Rest Assured Json Path -->
<dependency>
  <groupId>io.rest-assured</groupId>
  <artifactId>json-path</artifactId>
  <version>4.0.0</version>
</dependency>

<!-- Rest Assured Schema Validator -->
<dependency>
  <groupId>io.rest-assured</groupId>
  <artifactId>json-schema-validator</artifactId>
  <version>4.0.0</version>
</dependency>

<!-- Rest Assured Common -->
<dependency>
  <groupId>io.rest-assured</groupId>
  <artifactId>rest-assured-common</artifactId>
  <version>4.3.0</version>
</dependency>

вот изображение структуры моего проекта: enter image description here

Не могли бы вы объяснить, почему я получаю эту ошибку? Я использую Maven, но в то время я исключал код из класса тестового бегуна, щелкнув правой кнопкой мыши страницу и запустив!

1 Ответ

1 голос
/ 18 июня 2020

Множество проблем!

  1. Вы используете смешанные 3 разных версии Cucumber. Убедитесь, что все зависимости cucumber- имеют одинаковую версию. Последняя версия - v6.1.1

  2. Вы смешиваете cucumber-junit и cucumber-testng вместе. Удалите testng, cucumber-testng, а также любой импорт из io.cucumber.testng.

  3. Ваша версия junit должна быть 4.13, чтобы соответствовать версии из последней cucumber-junit.

  4. Клей должен иметь название пакета:

    @CucumberOptions(
       features = "src/test/resources/features/dhlcj",
       glue = "dhlcj.test.cucumber.steps"
    )
    
...