Тесты не выполняются для TestNG - PullRequest
0 голосов
/ 02 октября 2019

пытается запустить все мои тесты на огурец с TestNG. Однако мой набор не найден.

Я видел несколько вопросов о стековом потоке, но ни один из них не решил мою проблему.

Runner - junitRunner.java

package testRunner;

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

//@RunWith(Cucumber.class)
@CucumberOptions(
features = "src/test/resources/features/",
glue = "br.mysteps.steps"
)

public class junitRunner {

}

testng.xml

<suite name="SeleniumSuite">
<test name="testAll">
       <classes>
          <class name="testRunner.junitRunner"/>
       </classes>
</test>
</suite>

pom.xml

<dependencies>
    <dependency>
    <groupId>info.cukes</groupId>
    <artifactId>cucumber-java</artifactId>
    <version>1.2.5</version>
</dependency>

    <dependency>
        <groupId>org.testng</groupId>       
        <artifactId>testng</artifactId>
        <version>6.11</version>
    </dependency>
</dependencies>

Когда я запускаю файл testng.xml как TestNG, тесты не обнаруживаются, как показано ниже

[RemoteTestNG] detected TestNG version 6.11.0
[TestNGContentHandler] [WARN] It is strongly recommended to add "<!DOCTYPE 
suite SYSTEM "http://testng.org/testng-1.0.dtd" >" at the top of your 
file, otherwise TestNG may fail or not work as expected.

===============================================
SeleniumSuite
Total tests run: 0, Failures: 0, Skips: 0
===============================================

1 Ответ

1 голос
/ 02 октября 2019

Если вы хотите в основном использовать TestNG для запуска тестов на огурец, вам потребуется расширить cucumber.api.testng.AbstractTestNGCucumberTests.

Для получения более подробных примеров использования TestNG для запуска тестов на огурец см. к примерам здесь .

...