Forum Discussion

silver_tennis's avatar
silver_tennis
Occasional Visitor
2 years ago

Upgrading Cucumber from 4.2.5 to Latest (7.x)

Hi there,

 

We have inherited an old test automation framework that is using Cucumber 4.2.5, based on Java 1.8 and uses Maven 3.2.

We don't have the option to wholesale start over, but we should at least be able to upgrade the version of Cucumber to latest.

By going into the POM, and just changing the version, we lose the cucumber.api package, and start receiving the error package cucumber.api.java.en does not exist for things that should be built-in, such as the Scenario Java class.

Other than changing the value for the cucumber.version, is there something else that is missing that I'd need to do get this working again with the latest version?

 

Here is the relevant part of the pom.xml

 

<properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <maven.failsafe.plugin.version>2.22.2</maven.failsafe.plugin.version>
        <maven.build.helper.plugin.version>3.0.0</maven.build.helper.plugin.version>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
        <thread.count>1
        </thread.count> <!-- default value if no profile specified. Use profiles for parallel execution -->
        <cucumber.version>4.2.5</cucumber.version>
        <cucable-plugin.version>1.4.0</cucable-plugin.version>
        <maven.compiler.plugin.version>3.7.0</maven.compiler.plugin.version>
        <generated.runner.directory>${project.build.directory}/parallel/runners</generated.runner.directory>
        <generated.feature.directory>${project.build.directory}/parallel/features</generated.feature.directory>
        <runner.numberOfTestRuns>1</runner.numberOfTestRuns>
        <include.mandatory.tags>@BeforeAll,@AfterAll</include.mandatory.tags>
    </properties>

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

        <dependency>
            <groupId>org.apache.pdfbox</groupId>
            <artifactId>pdfbox</artifactId>
            <version>2.0.24</version>
        </dependency>

        <dependency>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>selenium-java</artifactId>
            <version>3.141.59</version>
        </dependency>
        <dependency>
            <groupId>io.cucumber</groupId>
            <artifactId>cucumber-java8</artifactId>
            <version>${cucumber.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.cucumber</groupId>
            <artifactId>cucumber-testng</artifactId>
            <version>${cucumber.version}</version>
        </dependency>
        <dependency>
            <groupId>io.cucumber</groupId>
            <artifactId>cucumber-picocontainer</artifactId>
            <version>${cucumber.version}</version>
        </dependency>
        <dependency>
            <groupId>net.lightbody.bmp</groupId>
            <artifactId>browsermob-core</artifactId>
            <version>2.1.5</version>
        </dependency>

 

 

No RepliesBe the first to reply