Giter Site home page Giter Site logo

Comments (6)

prashant-ramcharan avatar prashant-ramcharan commented on June 1, 2024

Hi @albertolopez55 , can you provide a sample project to demonstrate this?

from courgette-jvm.

FranciscoAAR avatar FranciscoAAR commented on June 1, 2024

Hi @prashant-ramcharan, I'm facing the same issue when trying to execute my test suite from within a JAR. I've created a small project with just one feature and one test scenario in it, the path to the feature files that I'm using is the same as recommended by "java io.cucumber.core.cli.Main" using the "classpath:resources/" format. The problem happens when courgette tries to check feature re-runs, at this point the classpath URI does not contain any path and when the condition tries to retrieve that value fails.

Feature URI with no path
image

Attempt to retrieve path from URI
image

Below is my runner and main configuration trying to emulate the cucumber CLI feature:

package com.test.courgette;

import courgette.api.CourgetteOptions;
import courgette.api.CucumberOptions;
import org.junit.runner.RunWith;
import courgette.api.CourgetteTestOutput;
import courgette.api.CourgetteRunLevel;
import courgette.api.junit.Courgette;
import org.junit.runner.notification.RunNotifier;
import org.junit.runners.model.InitializationError;


@RunWith(Courgette.class)
@CourgetteOptions(
    threads = 1,
    runLevel = CourgetteRunLevel.SCENARIO,
    testOutput = CourgetteTestOutput.CONSOLE,
    rerunFailedScenarios = true,
    rerunAttempts = 1,
    excludeFeatureFromRerun = "",
    excludeTagFromRerun = "",
    reportTitle = "Courgette test execution",
    reportTargetDir = "build/reports/html/chartReport",
    environmentInfo = "",
    cucumberOptions =
    @CucumberOptions(
        features = "src/test/resources/features/",
        glue = "com.test.courgette.steps",
        tags = "@test",
        plugin = {
            "pretty",
            "json:build/reports/json/cucumber.json",
            "html:build/reports/html/cucumber.html",
            "junit:build/reports/cucumber.xml"
        }))
public class TestRunner {

  public static void main(String[] args) throws InitializationError {
    System.setProperty("cucumber.features", "classpath:features/");
    new Courgette(TestRunner.class).run(new RunNotifier());
    System.out.println("\n+++++++++++++++++++++++++\n");
    System.out.println("\n++++EXECUTION FINISHED+++\n");
    System.out.println("\n+++++++++++++++++++++++++\n");
  }
}

Project directory tree
image

I don't know if more problems will arise beyond this point, thanks!

from courgette-jvm.

prashant-ramcharan avatar prashant-ramcharan commented on June 1, 2024

Hi @FranciscoAAR Thanks for that.

Do you mind sharing the project so I can debug further, please?

from courgette-jvm.

FranciscoAAR avatar FranciscoAAR commented on June 1, 2024

Courgette jar runner sample

from courgette-jvm.

FranciscoAAR avatar FranciscoAAR commented on June 1, 2024

Hi @prashant-ramcharan - Just following up to see if you need anything else from my side to continue working on this.

from courgette-jvm.

prashant-ramcharan avatar prashant-ramcharan commented on June 1, 2024

@FranciscoAAR Just had a look into your sample project.

This seems to work however you should not set the cucumber.features to a classpath.

Courgette and Cucumber should resolve the features using the file system instead.

Screenshot 2024-06-01 at 10 00 30

from courgette-jvm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.