damianszczepanik/maven-cucumber-reporting

basedir does not exist

Closed this issue · 4 comments

Hello. I ran into a problem running tests. In jenkins and eclipse on Windows there are no problems running the project. But in Ubuntu 23.10, IntelliJ IDEA 2022.1.2. I'm facing the same problem. Plugin problem:

Failed to execute goal net.masterthought:maven-cucumber-reporting:5.7.6:generate (execution) on project test_automation: Execution execution of goal net.masterthought:maven-cucumber-reporting:5.7.6:generate failed: basedir /home/user/github/automation/target/cucumber-reports does not exist -> [Help 1]

Here is my pom.xml:

<build>
	<plugins>
		<plugin>
			<groupId>org.apache.maven.plugins</groupId>
			<artifactId>maven-compiler-plugin</artifactId>
			<version>3.11.0</version>
			<configuration>
				<encoding>UTF-8</encoding>
				<source>1.8</source>
				<target>1.8</target>
				<compilerArgument>-Werror</compilerArgument>
				<systemPropertyVariables>
					<property>
						<name>browser</name>
						<value>${browser}</value>
					</property>
					<property>
						<name>cloud_config</name>
						<value>${cloud_config}</value>
					</property>
				</systemPropertyVariables>
			</configuration>
		</plugin>
		<plugin>
			<groupId>org.apache.maven.plugins</groupId>
			<artifactId>maven-surefire-plugin</artifactId>
			<version>3.1.2</version>
			<configuration>
				<testFailureIgnore>false</testFailureIgnore>
			</configuration>
		</plugin>
		<plugin>
			<groupId>net.masterthought</groupId>
			<artifactId>maven-cucumber-reporting</artifactId>
			<version>5.7.6</version>
			<executions>
				<execution>
					<id>execution</id>
					<phase>verify</phase>
					<goals>
						<goal>generate</goal>
					</goals>
					<configuration>
						<projectName>test_automation</projectName>
						<outputDirectory>${project.build.directory}</outputDirectory>
						<inputDirectory>${project.build.directory}/cucumber-reports/</inputDirectory>
						<jsonFiles>
							<param>**/CucumberTestReport.json</param>
						</jsonFiles>
					</configuration>
				</execution>
			</executions>
		</plugin>
	</plugins>
</build>

And my java test class:

  @RunWith(Cucumber.class)
  @CucumberOptions(
	      plugin = {"pretty","json:target/cucumber-reports/CucumberTestReport.json","html:target/cucumber-reports/CucumberTestReport.html"},
	      features = "classpath:features",
	      glue = {"com.test.automation.stepdefinitions", "com.test.automation.hooks"},
	      tags = "@smoke",
	      monochrome = true,
	      stepNotifications = true,
	      dryRun = false
  )
  public class RunCukesTest {}

Command for run:

mvn clean verify -X -DWebDriver=Firefox -DremoteWebdriver=http://127.0.0.1:4444/wd/hub -Dcucumber.filter.tags="@smoke" -Dcucumber.env="LOCAL"

Apache Maven 3.8.1
Java version: 1.8.0_382, vendor: Amazon.com Inc.
OS name: "linux", version: "6.5.0-17-generic", arch: "amd64", family: "unix"

Can you tell me what could be wrong?

Looks like output path is not same as input so i cannot find JSON file or maybe JSON file is not generated at all

Yes you are right. In my case the JSON file is not generated. Any guesses why this is so? This situation seems strange to me, since everything is working for my colleague(

I solved the problem. It was all the fault of the maven version in idea. I installed maven 3.9 separately - everything works.

I solved the problem