У меня настройка, как показано ниже. при запуске тестов с -Dgroups
я получаю следующую ошибку. что не так с моей настройкой? Мне нужно передать, какие тестовые группы будут запускаться с помощью моей команды maven. Любая помощь по этому поводу очень заметна.
testng. xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "https://testng.org/testng-1.0.dtd">
<suite name="Suite">
<listeners>
<listener class-name="Utilities.CustomTestListener"/>
</listeners>
<test name="RegressionTests">
<method-selectors>
<method-selector>
<script language="beanshell">
<![CDATA[whatGroup = System.getProperty("groups");
groups.containsKey(whatGroup);
]]>
</script>
</method-selector>
</method-selectors>
<classes>
<class name="Tests.test_sampleTests"/>
</classes>
</test> <!-- Test -->
</suite> <!-- Suite -->
sampleTests. java
@Test(groups = {"low"})
public void samplePositiveTest() throws Throwable {
System.out.println("Test run under low group");
}
пом. xml
<dependencies>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>7.0.0</version>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>4.0.0-alpha-6</version>
</dependency>
<dependency>
<groupId>org.apache-extras.beanshell</groupId>
<artifactId>bsh</artifactId>
<version>2.0b6</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M5</version>
<configuration>
<suiteXmlFiles>
<suiteXmlFile>${testngFile}</suiteXmlFile>
</suiteXmlFiles>
<!--<groups>low</groups>-->
</configuration>
</plugin>
</plugins>
</build>
команда выполнения maven
mvn clean install -Dbrowser="chrome" -Denv="qa" -Dsurefire.suiteXmlFiles="regress.xml" -Dgroups="low"
ошибка при выполнении
[ERROR] Please refer to /opt/TestProjects/target/surefire-reports for the individual test results.
[ERROR] Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.
[ERROR] There was an error in the forked process
[ERROR] org.apache.maven.surefire.booter.SurefireBooterForkException: There was an error in the forked process
[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:733)
[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:305)
[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:265)
[ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeProvider(AbstractSurefireMojo.java:1314)