trivago/cucable-plugin

Getting an error while running mvn verify for the runner class name: public class [CUCABLE:RUNNER]

VikTri05 opened this issue · 5 comments

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Create a scenario with...
  2. Run Cucable
  3. See error

Expected behavior
A clear and concise description of what you expected to happen.

Attachments
If applicable, add an attachment to help explain your problem.

Additional context
Add any other context about the problem here.

Below is my runner class:
package runnerClass;

import cucumber.api.CucumberOptions;

@CucumberOptions(
features = {"target/parallel/features/[CUCABLE:FEATURE].feature"},
plugin = {"json:target/cucumber-report/[CUCABLE:RUNNER].json"}
)
public class [CUCABLE:RUNNER] {
// Any value
}

Following is my pom file:

<modelVersion>4.0.0</modelVersion>
<groupId>com.edgewords</groupId>
<artifactId>maven_bdd</artifactId>
<version>1.0</version>
<name>Maven BDD Demo</name>

<properties>
	<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<dependencies>

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

	<dependency>
		<groupId>com.aventstack</groupId>
		<artifactId>extentreports</artifactId>
		<version>3.1.1</version>
	</dependency>

	<dependency>
		<groupId>com.vimalselvam</groupId>
		<artifactId>cucumber-extentsreport</artifactId>
		<version>3.0.2</version>
	</dependency>

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

	<dependency>
		<groupId>junit</groupId>
		<artifactId>junit</artifactId>
		<version>4.12</version>
	</dependency>

	<dependency>
		<groupId>org.seleniumhq.selenium</groupId>
		<artifactId>selenium-java</artifactId>
		<version>3.11.0</version>
	</dependency>


	<dependency>
		<groupId>io.cucumber</groupId>
		<artifactId>cucumber-core</artifactId>
		<version>4.5.4</version>
	</dependency>

	<dependency>
		<groupId>org.seleniumhq.selenium</groupId>
		<artifactId>selenium-server</artifactId>
		<version>2.5.0</version>
	</dependency>

	<dependency>
		<groupId>com.relevantcodes</groupId>
		<artifactId>extentreports</artifactId>
		<version>2.41.2</version>
	</dependency>


	<dependency>
		<groupId>org.apache.directory.studio</groupId>
		<artifactId>org.apache.commons.io</artifactId>
		<version>2.4</version>
	</dependency>
	<dependency>
		<groupId>org.apache.poi</groupId>
		<artifactId>poi</artifactId>
		<version>4.0.0</version>
	</dependency>
	<dependency>
		<groupId>org.apache.poi</groupId>
		<artifactId>poi-ooxml</artifactId>
		<version>4.0.0</version>
	</dependency>
	<dependency>
		<groupId>jcifs</groupId>
		<artifactId>jcifs</artifactId>
		<version>1.3.17</version>
	</dependency>
	<dependency>
		<groupId>org.apache.logging.log4j</groupId>
		<artifactId>log4j-core</artifactId>
		<version>2.11.1</version>
	</dependency>

	<dependency>
		<groupId>org.apache.commons</groupId>
		<artifactId>commons-lang3</artifactId>
		<version>3.4</version>
	</dependency>

	<dependency>
		<groupId>io.cucumber</groupId>
		<artifactId>cucumber-junit</artifactId>
		<version>4.2.6</version>
	</dependency>

	<dependency>
		<groupId>io.cucumber</groupId>
		<artifactId>cucumber-picocontainer</artifactId>
		<version>4.2.6</version>
	</dependency>

	<dependency>
		<groupId>com.trivago.rta</groupId>
		<artifactId>cucable-plugin</artifactId>
		<version>1.5.3</version>
	</dependency>



</dependencies>


<reporting>
	<plugins>
		<plugin>
			<groupId>org.apache.maven.plugins</groupId>
			<artifactId>maven-surefire-report-plugin</artifactId>
			<version>2.21.0</version>
		</plugin>
	</plugins>
</reporting>
<build>
	<pluginManagement>
		<plugins>
			<plugin>
				<groupId>com.trivago.rta</groupId>
				<artifactId>cucable-plugin</artifactId>
				<version>1.5.3</version>
				<executions>
					<execution>
						<id>generate-test-resources</id>
						<phase>generate-test-resources</phase>
						<goals>
							<goal>parallel</goal>
						</goals>
						<configuration>
							<!-- Required properties -->
							<sourceRunnerTemplateFile>src/test/resources/parallel/cucable.template</sourceRunnerTemplateFile>
							<sourceFeatures>src/test/resources/features</sourceFeatures>
							<generatedFeatureDirectory>src/test/resources/parallel/features</generatedFeatureDirectory>
							<generatedRunnerDirectory>src/test/java/parallel/runner</generatedRunnerDirectory>

							<!-- Optional properties -->
							<numberOfTestRuns>1</numberOfTestRuns>
							<includeScenarioTags>@Regression and @FFTP</includeScenarioTags>
							<logLevel>compact</logLevel>

							<desiredNumberOfRunners>2</desiredNumberOfRunners>
							<!-- or <desiredNumberOfFeaturesPerRunner>5</desiredNumberOfRunners> -->
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>build-helper-maven-plugin</artifactId>
				<version>3.0.0</version>
				<executions>
					<execution>
						<id>add-test-source</id>
						<phase>generate-test-sources</phase>
						<goals>
							<goal>add-test-source</goal>
						</goals>
						<configuration>
							<sources>
								<source>src/test/java/parallel</source>
							</sources>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-failsafe-plugin</artifactId>
				<version>3.0.0-M3</version>
				<executions>
					<execution>
						<id>Run parallel tests</id>
						<phase>integration-test</phase>
						<goals>
							<goal>integration-test</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<forkCount>2</forkCount>
					<testFailureIgnore>true</testFailureIgnore>
				</configuration>
			</plugin>
			<plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.8.1</version>
            <configuration>
                <source>8</source>
                <target>8</target>
            </configuration>
        </plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-jar-plugin</artifactId>
				<version>3.1.2</version>
				<executions>
					<execution>
						<id>default-jar</id>
						<phase>none</phase>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</pluginManagement>
</build>

image

@VikTri05 We also found this part of the README did not work. Fixed the problem by giving the runner class a legitimate name that matches the file name.

On re-reading the README, it does state that this is a text file example.

If the template is a java class (and not a text file), the correct class name should be used, not the placeholder.
This is described here:

https://github.com/trivago/cucable-plugin#using-a-java-file-as-a-runner-template

@VikTri05 does this help you?

Hi Benjamin,

It helped. Thank you!

Satisfied with the response