prashant-ramcharan / courgette-jvm

Multiprocess | Parallel Cucumber-JVM | Parallelize your Java Cucumber tests on a feature level or on a scenario level.
MIT License
134 stars 39 forks source link

After adding courgette-jvm and runner in Junit project , getting Tests run: 0, Failures: 0, Errors: 0, Skipped: 0 #294

Closed aravindkesavarapu closed 3 years ago

aravindkesavarapu commented 3 years ago

Hi @prashant-ramcharan,

I have integrated courgette-jvm with my old project and trying to run the maven command.

It is running good but after running the test cases maven does not recognising how many test cases it ran, fail, pass.

I have attached the screenshot of the maven log & pom.xml.

image

`<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

4.0.0
<groupId>com.testCompay</groupId>
<artifactId>project1</artifactId>
<name>TestProject</name>
<version>1.0-SNAPSHOT</version>

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <java.version>11</java.version>
    <selenium.version>3.141.59</selenium.version>
    <junit.version>4.13.2</junit.version>
    <cucumber.version>6.10.3</cucumber.version>
    <chrome.webdriver.manager.version>4.4.3</chrome.webdriver.manager.version>
    <maven.compiler.version>3.8.1</maven.compiler.version>
    <maven.surefire.version>3.0.0-M5</maven.surefire.version>
    <maven.failsafe.version>3.0.0-M1</maven.failsafe.version>
    <maven.compiler.source>11</maven.compiler.source>
    <maven.compiler.target>11</maven.compiler.target>
</properties>
<dependencies>

    <dependency>
        <groupId>org.seleniumhq.selenium</groupId>
        <artifactId>selenium-java</artifactId>
        <version>${selenium.version}</version>
    </dependency>

    <dependency>
        <groupId>io.cucumber</groupId>
        <artifactId>cucumber-java</artifactId>
        <version>${cucumber.version}</version>
    </dependency>

    <dependency>
        <groupId>commons-io</groupId>
        <artifactId>commons-io</artifactId>
        <version>2.7</version>
    </dependency>

    <dependency>
        <groupId>io.github.bonigarcia</groupId>
        <artifactId>webdrivermanager</artifactId>
        <version>${chrome.webdriver.manager.version}</version>
    </dependency>

    <dependency>
        <groupId>io.cucumber</groupId>
        <artifactId>cucumber-picocontainer</artifactId>
        <version>${cucumber.version}</version>
        <!--            <scope>test</scope>-->
    </dependency>

    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-simple</artifactId>
        <version>1.6.4</version>
    </dependency>

    <dependency>
        <groupId>ch.qos.logback</groupId>
        <artifactId>logback-core</artifactId>
        <version>1.3.0-alpha5</version>
    </dependency>

    <dependency>
        <groupId>ch.qos.logback</groupId>
        <artifactId>logback-classic</artifactId>
        <version>1.3.0-alpha5</version>
        <!--            <scope>test</scope>-->
    </dependency>

    <dependency>
        <groupId>io.cucumber</groupId>
        <artifactId>cucumber-junit</artifactId>
        <version>${cucumber.version}</version>
        <scope>test</scope>
    </dependency>

    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>${junit.version}</version>
        <scope>test</scope>
    </dependency>

    <dependency>
        <groupId>net.masterthought</groupId>
        <artifactId>cucumber-reporting</artifactId>
        <version>3.8.0</version>
    </dependency>

    <dependency>
        <groupId>log4j</groupId>
        <artifactId>log4j</artifactId>
        <version>1.2.17</version>
    </dependency>

    <dependency>
        <groupId>org.json</groupId>
        <artifactId>json</artifactId>
        <version>20210307</version>
    </dependency>

    <dependency>
        <groupId>io.github.prashant-ramcharan</groupId>
        <artifactId>courgette-jvm</artifactId>
        <version>5.11.0</version>
    </dependency>

    <dependency>
        <groupId>org.apache.poi</groupId>
        <artifactId>poi</artifactId>
        <version>5.0.0</version>
    </dependency>

    <dependency>
        <groupId>com.opencsv</groupId>
        <artifactId>opencsv</artifactId>
        <version>5.5.1</version>
    </dependency>

</dependencies>
<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>${maven.compiler.version}</version>
            <configuration>
                <encoding>UTF-8</encoding>
                <source>${java.version}</source>
                <target>${java.version}</target>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>${maven.surefire.version}</version>
            <configuration>
                <!-- Activate the use of TCP to transmit events to the plugin -->
                <forkNode implementation="org.apache.maven.plugin.surefire.extensions.SurefireForkNodeFactory"/>
            </configuration>
        </plugin>
        <plugin>
            <groupId>net.masterthought</groupId>
            <artifactId>maven-cucumber-reporting</artifactId>
            <version>5.0.0</version>
            <executions>
                <execution>
                    <id>execution</id>
                    <!-- <phase>verify</phase> -->
                    <goals>
                        <goal>generate</goal>
                    </goals>
                    <configuration>
                        <projectName>Test Project</projectName>
                        <inputDirectory>${project.build.directory}/target/cucumber-reports</inputDirectory>
                        <outputDirectory>${project.build.directory}/cucumber-report-html</outputDirectory>
                        <jsonFiles>
                            <!-- supports wildcard or name pattern -->
                            <param>**/cucumber.json</param>
                        </jsonFiles>
                    </configuration>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>

`

Please correct me if I have done any wrong thing.

Thanks, Aravind

prashant-ramcharan commented 3 years ago

Hi @aravindkesavarapu

Did you try updating your surefire plugin to include your Courgette runner?

Something like this:

          <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>3.0.0-M5</version>
                <configuration>
                    <includes>
                          <!-- Add the path to your Courgette runner here -->
                        <include>**/suites/ScenarioSuite.class</include>
                    </includes>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.apache.maven.surefire</groupId>
                        <artifactId>surefire-junit47</artifactId>
                        <version>3.0.0-M5</version>
                    </dependency>
                </dependencies>
            </plugin> 
aravindkesavarapu commented 3 years ago

Hi @prashant-ramcharan,

Thanks for the reply :),

I updated the surefire plugin in pom.xml as you suggested. If I run one test case it is working fine. but when I run more than one test case using the maven command it is not giving an exact report. I have attached the HTML & maven screenshots

I ran three test cases in that 1 passed & 2 failed. the same thing generating on html file image

But in maven it is showing test run as 2 in Running courgette.api.junit.Courgette & under results it is showing test run 1

image

Please let me know if you need any information.

Thanks, Aravind

aravindkesavarapu commented 3 years ago

Hi @prashant-ramcharan ,

I have observed that both the scenarios are in one feature file at that time the maven calculating only one test case failed.

example - 1: fileOne.feaure

In this above(example1) case Running courgette.api.junit.Courgette: Tests run: 2, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 2.014 s - in courgette.api.junit.Courgette

Maven: Tests run: 1, Failures: 0, Errors: 1, Skipped: 0


example - 2:

fileThree.feature:

fileFour.feature

fileFive.feature

In this above result Running courgette.api.junit.Courgette [ERROR] Tests run: 4, Failures: 0, Errors: 4, Skipped: 0, Time elapsed: 2.086 s <<< FAILURE! - in courgette.api.junit.Courgette Maven: [ERROR] Tests run: 3, Failures: 0, Errors: 3, Skipped: 0



And Stack trace is also not displaying. Instead of stack trace it is displaying {featureName} failed. Please find the below screenshot

image

Thanks, Aravind

prashant-ramcharan commented 3 years ago

Hi @aravindkesavarapu

This is as expected. Maven counts the number of feature files so in the below scenario:

feature1.feature (has 1 scenario)
feature2.feature (has 2 scenarios)
feature3.feature (has 3 scenarios)

With regards to the test failure stacktrace, this will be available in the Cucumber and Courgette reports. If Maven were to fail then it's stacktrace will be shown in the console and not the actual test failure stacktrace.

aravindkesavarapu commented 3 years ago

Hi @prashant-ramcharan,

Jenkins was not recording the correct failure test case stacktrace. please find the below screenshot.

image

I have observed that courgette-jvm generating different format of JSON for Scenario outline. is this expected?

Thanks, aravind

prashant-ramcharan commented 3 years ago

Hi @aravindkesavarapu

I'm not sure I follow. Can you please share a project to describe this issue ?

aravindkesavarapu commented 2 years ago

Hi @prashant-ramcharan

Sorry for the late reply.

I tried on the sample courgette-jvm-maven-example

Please find the attached courgette & cucumber JSON files.

couregette.zip

cucumber.zip

Courgette-JVM Json: What I have observed is for Scenario outline type json results. It is appending feature file details for every example at the end.

[
  {
    "line": 2,
    "elements": [
      {
        "line": 4,
        "name": "",
        "description": "",
        "type": "background",
        "keyword": "Background",
        "steps": [
          {
            "result": {
              "duration": 5575549900,
              "status": "passed"
            },
            "line": 5,
            "name": "I navigate to Stack Overflow",
            "match": {
              "location": "steps.TestSteps.iNavigateToStackOverflow()"
            },
            "keyword": "Given "
          }
        ]
      },
      {
        "start_timestamp": "2021-11-30T14:28:51.543Z",
        "before": [
          {
            "result": {
              "duration": 19986566000,
              "status": "passed"
            },
            "match": {
              "location": "steps.TestSteps.before()"
            }
          }
        ],
        "line": 14,
        "name": "Ensure that stack overflow question pages can be opened",
        "description": "",
        "id": "feature-with-examples;ensure-that-stack-overflow-question-pages-can-be-opened;;2",
        "after": [
          {
            "result": {
              "duration": 1836170600,
              "status": "passed"
            },
            "match": {
              "location": "steps.TestSteps.after(io.cucumber.java.Scenario)"
            }
          }
        ],
        "type": "scenario",
        "keyword": "Scenario Outline",
        "steps": [
          {
            "result": {
              "duration": 7700295500,
              "status": "passed"
            },
            "line": 9,
            "name": "I navigate to Stack Overflow question page 3",
            "match": {
              "arguments": [
                {
                  "val": "3",
                  "offset": 43
                }
              ],
              "location": "steps.TestSteps.i_navigate_to_Stack_Overflow_question_page(java.lang.Integer)"
            },
            "keyword": "When "
          },
          {
            "result": {
              "duration": 28402200,
              "status": "passed"
            },
            "line": 10,
            "name": "I verify Stack Overflow question page 3 is opened",
            "match": {
              "arguments": [
                {
                  "val": "3",
                  "offset": 38
                }
              ],
              "location": "steps.TestSteps.i_verify_Stack_Overflow_question_page_is_opened(java.lang.Integer)"
            },
            "keyword": "Then "
          }
        ],
        "tags": [
          {
            "name": "@regression"
          },
          {
            "name": "@testwithcourgette"
          }
        ]
      }
    ],
    "name": "Feature with Examples",
    "description": "",
    "id": "feature-with-examples",
    "keyword": "Feature",
    "uri": "file:src/test/resources/features/FeatureWithExamples.feature",
    "tags": [
      {
        "name": "@regression",
        "type": "Tag",
        "location": {
          "line": 1,
          "column": 1
        }
      }
    ]
  },
  {
    "line": 2,
    "elements": [
      {
        "line": 4,
        "name": "",
        "description": "",
        "type": "background",
        "keyword": "Background",
        "steps": [
          {
            "result": {
              "duration": 3750175200,
              "status": "passed"
            },
            "line": 5,
            "name": "I navigate to Stack Overflow",
            "match": {
              "location": "steps.TestSteps.iNavigateToStackOverflow()"
            },
            "keyword": "Given "
          }
        ]
      },
      {
        "start_timestamp": "2021-11-30T14:29:32.678Z",
        "before": [
          {
            "result": {
              "duration": 9484562200,
              "status": "passed"
            },
            "match": {
              "location": "steps.TestSteps.before()"
            }
          }
        ],
        "line": 16,
        "name": "Ensure that stack overflow question pages can be opened",
        "description": "",
        "id": "feature-with-examples;ensure-that-stack-overflow-question-pages-can-be-opened;;4",
        "after": [
          {
            "result": {
              "duration": 1488752300,
              "status": "passed"
            },
            "match": {
              "location": "steps.TestSteps.after(io.cucumber.java.Scenario)"
            }
          }
        ],
        "type": "scenario",
        "keyword": "Scenario Outline",
        "steps": [
          {
            "result": {
              "duration": 211613987900,
              "status": "passed"
            },
            "line": 9,
            "name": "I navigate to Stack Overflow question page 5",
            "match": {
              "arguments": [
                {
                  "val": "5",
                  "offset": 43
                }
              ],
              "location": "steps.TestSteps.i_navigate_to_Stack_Overflow_question_page(java.lang.Integer)"
            },
            "keyword": "When "
          },
          {
            "result": {
              "duration": 29911600,
              "status": "passed"
            },
            "line": 10,
            "name": "I verify Stack Overflow question page 5 is opened",
            "match": {
              "arguments": [
                {
                  "val": "5",
                  "offset": 38
                }
              ],
              "location": "steps.TestSteps.i_verify_Stack_Overflow_question_page_is_opened(java.lang.Integer)"
            },
            "keyword": "Then "
          }
        ],
        "tags": [
          {
            "name": "@regression"
          },
          {
            "name": "@testwithcourgette"
          }
        ]
      }
    ],
    "name": "Feature with Examples",
    "description": "",
    "id": "feature-with-examples",
    "keyword": "Feature",
    "uri": "file:src/test/resources/features/FeatureWithExamples.feature",
    "tags": [
      {
        "name": "@regression",
        "type": "Tag",
        "location": {
          "line": 1,
          "column": 1
        }
      }
    ]
  },
  {
    "line": 2,
    "elements": [
      {
        "line": 4,
        "name": "",
        "description": "",
        "type": "background",
        "keyword": "Background",
        "steps": [
          {
            "result": {
              "duration": 3910078700,
              "status": "passed"
            },
            "line": 5,
            "name": "I navigate to Stack Overflow",
            "match": {
              "location": "steps.TestSteps.iNavigateToStackOverflow()"
            },
            "keyword": "Given "
          }
        ]
      },
      {
        "start_timestamp": "2021-11-30T14:29:33.124Z",
        "before": [
          {
            "result": {
              "duration": 9130217500,
              "status": "passed"
            },
            "match": {
              "location": "steps.TestSteps.before()"
            }
          }
        ],
        "line": 15,
        "name": "Ensure that stack overflow question pages can be opened",
        "description": "",
        "id": "feature-with-examples;ensure-that-stack-overflow-question-pages-can-be-opened;;3",
        "after": [
          {
            "result": {
              "duration": 1178716500,
              "status": "passed"
            },
            "match": {
              "location": "steps.TestSteps.after(io.cucumber.java.Scenario)"
            }
          }
        ],
        "type": "scenario",
        "keyword": "Scenario Outline",
        "steps": [
          {
            "result": {
              "duration": 3380072000,
              "status": "passed"
            },
            "line": 9,
            "name": "I navigate to Stack Overflow question page 4",
            "match": {
              "arguments": [
                {
                  "val": "4",
                  "offset": 43
                }
              ],
              "location": "steps.TestSteps.i_navigate_to_Stack_Overflow_question_page(java.lang.Integer)"
            },
            "keyword": "When "
          },
          {
            "result": {
              "duration": 18475700,
              "status": "passed"
            },
            "line": 10,
            "name": "I verify Stack Overflow question page 4 is opened",
            "match": {
              "arguments": [
                {
                  "val": "4",
                  "offset": 38
                }
              ],
              "location": "steps.TestSteps.i_verify_Stack_Overflow_question_page_is_opened(java.lang.Integer)"
            },
            "keyword": "Then "
          }
        ],
        "tags": [
          {
            "name": "@regression"
          },
          {
            "name": "@testwithcourgette"
          }
        ]
      }
    ],
    "name": "Feature with Examples",
    "description": "",
    "id": "feature-with-examples",
    "keyword": "Feature",
    "uri": "file:src/test/resources/features/FeatureWithExamples.feature",
    "tags": [
      {
        "name": "@regression",
        "type": "Tag",
        "location": {
          "line": 1,
          "column": 1
        }
      }
    ]
  }
]

In above JSON file this block is repeating 3 times(based upon the examples in scenario):

"name": "Feature with Examples",
    "description": "",
    "id": "feature-with-examples",
    "keyword": "Feature",
    "uri": "file:src/test/resources/features/FeatureWithExamples.feature",
    "tags": [
      {
        "name": "@regression",
        "type": "Tag",
        "location": {
          "line": 1,
          "column": 1
        }
      }

Cucumber JSON: where as in cucumber json file it is appending at the end of all example.


[
  {
    "line": 2,
    "elements": [
      {
        "line": 4,
        "name": "",
        "description": "",
        "type": "background",
        "keyword": "Background",
        "steps": [
          {
            "result": {
              "duration": 2539442700,
              "status": "passed"
            },
            "line": 5,
            "name": "I navigate to Stack Overflow",
            "match": {
              "location": "steps.TestSteps.iNavigateToStackOverflow()"
            },
            "keyword": "Given "
          }
        ]
      },
      {
        "start_timestamp": "2021-11-30T14:44:38.169Z",
        "before": [
          {
            "result": {
              "duration": 5447818200,
              "status": "passed"
            },
            "match": {
              "location": "steps.TestSteps.before()"
            }
          }
        ],
        "line": 14,
        "name": "Ensure that stack overflow question pages can be opened",
        "description": "",
        "id": "feature-with-examples;ensure-that-stack-overflow-question-pages-can-be-opened;;2",
        "after": [
          {
            "result": {
              "duration": 959684700,
              "status": "passed"
            },
            "match": {
              "location": "steps.TestSteps.after(io.cucumber.java.Scenario)"
            }
          }
        ],
        "type": "scenario",
        "keyword": "Scenario Outline",
        "steps": [
          {
            "result": {
              "duration": 4597411800,
              "status": "passed"
            },
            "line": 9,
            "name": "I navigate to Stack Overflow question page 3",
            "match": {
              "arguments": [
                {
                  "val": "3",
                  "offset": 43
                }
              ],
              "location": "steps.TestSteps.i_navigate_to_Stack_Overflow_question_page(java.lang.Integer)"
            },
            "keyword": "When "
          },
          {
            "result": {
              "duration": 50150400,
              "status": "passed"
            },
            "line": 10,
            "name": "I verify Stack Overflow question page 3 is opened",
            "match": {
              "arguments": [
                {
                  "val": "3",
                  "offset": 38
                }
              ],
              "location": "steps.TestSteps.i_verify_Stack_Overflow_question_page_is_opened(java.lang.Integer)"
            },
            "keyword": "Then "
          }
        ],
        "tags": [
          {
            "name": "@regression"
          },
          {
            "name": "@testwithoutcourgette"
          }
        ]
      },
      {
        "line": 4,
        "name": "",
        "description": "",
        "type": "background",
        "keyword": "Background",
        "steps": [
          {
            "result": {
              "duration": 1867556700,
              "status": "passed"
            },
            "line": 5,
            "name": "I navigate to Stack Overflow",
            "match": {
              "location": "steps.TestSteps.iNavigateToStackOverflow()"
            },
            "keyword": "Given "
          }
        ]
      },
      {
        "start_timestamp": "2021-11-30T14:44:51.968Z",
        "before": [
          {
            "result": {
              "duration": 4283871300,
              "status": "passed"
            },
            "match": {
              "location": "steps.TestSteps.before()"
            }
          }
        ],
        "line": 15,
        "name": "Ensure that stack overflow question pages can be opened",
        "description": "",
        "id": "feature-with-examples;ensure-that-stack-overflow-question-pages-can-be-opened;;3",
        "after": [
          {
            "result": {
              "duration": 1054660900,
              "status": "passed"
            },
            "match": {
              "location": "steps.TestSteps.after(io.cucumber.java.Scenario)"
            }
          }
        ],
        "type": "scenario",
        "keyword": "Scenario Outline",
        "steps": [
          {
            "result": {
              "duration": 1676526700,
              "status": "passed"
            },
            "line": 9,
            "name": "I navigate to Stack Overflow question page 4",
            "match": {
              "arguments": [
                {
                  "val": "4",
                  "offset": 43
                }
              ],
              "location": "steps.TestSteps.i_navigate_to_Stack_Overflow_question_page(java.lang.Integer)"
            },
            "keyword": "When "
          },
          {
            "result": {
              "duration": 30865900,
              "status": "passed"
            },
            "line": 10,
            "name": "I verify Stack Overflow question page 4 is opened",
            "match": {
              "arguments": [
                {
                  "val": "4",
                  "offset": 38
                }
              ],
              "location": "steps.TestSteps.i_verify_Stack_Overflow_question_page_is_opened(java.lang.Integer)"
            },
            "keyword": "Then "
          }
        ],
        "tags": [
          {
            "name": "@regression"
          },
          {
            "name": "@testwithoutcourgette"
          }
        ]
      },
      {
        "line": 4,
        "name": "",
        "description": "",
        "type": "background",
        "keyword": "Background",
        "steps": [
          {
            "result": {
              "duration": 2439281500,
              "status": "passed"
            },
            "line": 5,
            "name": "I navigate to Stack Overflow",
            "match": {
              "location": "steps.TestSteps.iNavigateToStackOverflow()"
            },
            "keyword": "Given "
          }
        ]
      },
      {
        "start_timestamp": "2021-11-30T14:45:00.912Z",
        "before": [
          {
            "result": {
              "duration": 4031735400,
              "status": "passed"
            },
            "match": {
              "location": "steps.TestSteps.before()"
            }
          }
        ],
        "line": 16,
        "name": "Ensure that stack overflow question pages can be opened",
        "description": "",
        "id": "feature-with-examples;ensure-that-stack-overflow-question-pages-can-be-opened;;4",
        "after": [
          {
            "result": {
              "duration": 1063712000,
              "status": "passed"
            },
            "match": {
              "location": "steps.TestSteps.after(io.cucumber.java.Scenario)"
            }
          }
        ],
        "type": "scenario",
        "keyword": "Scenario Outline",
        "steps": [
          {
            "result": {
              "duration": 1397006000,
              "status": "passed"
            },
            "line": 9,
            "name": "I navigate to Stack Overflow question page 5",
            "match": {
              "arguments": [
                {
                  "val": "5",
                  "offset": 43
                }
              ],
              "location": "steps.TestSteps.i_navigate_to_Stack_Overflow_question_page(java.lang.Integer)"
            },
            "keyword": "When "
          },
          {
            "result": {
              "duration": 18974800,
              "status": "passed"
            },
            "line": 10,
            "name": "I verify Stack Overflow question page 5 is opened",
            "match": {
              "arguments": [
                {
                  "val": "5",
                  "offset": 38
                }
              ],
              "location": "steps.TestSteps.i_verify_Stack_Overflow_question_page_is_opened(java.lang.Integer)"
            },
            "keyword": "Then "
          }
        ],
        "tags": [
          {
            "name": "@regression"
          },
          {
            "name": "@testwithoutcourgette"
          }
        ]
      }
    ],
    "name": "Feature with Examples",
    "description": "",
    "id": "feature-with-examples",
    "keyword": "Feature",
    "uri": "file:src/test/resources/features/FeatureWithExamples.feature",
    "tags": [
      {
        "name": "@regression",
        "type": "Tag",
        "location": {
          "line": 1,
          "column": 1
        }
      }
    ]
  }
]

Where as in cucumber json file it is appending at the end of the scenario result. It means at the end of the result

 "name": "Feature with Examples",
    "description": "",
    "id": "feature-with-examples",
    "keyword": "Feature",
    "uri": "file:src/test/resources/features/FeatureWithExamples.feature",
    "tags": [
      {
        "name": "@regression",
        "type": "Tag",
        "location": {
          "line": 1,
          "column": 1
        }
      }
aravindkesavarapu commented 2 years ago

Hi @prashant-ramcharan

Cucumber Project: cucumber.zip

prashant-ramcharan commented 2 years ago

Hi @aravindkesavarapu

This is how Courgette is intended to work.

In the example above, you running using CourgetteRunLevel.SCENARIO which means Courgette extracts each scenario from the feature file and runs it separately. The end result is you will have each scenario reported separately in the cucumber reports.

Use CourgetteRunLevel.FEATURE if you need the Cucumber reports to show as one feature result instead of separate scenarios results.

This is the feature file with 3 examples - Courgette will run each example separately (in parallel) if using CourgetteRunLevel.SCENARIO

Screenshot 2021-12-05 at 11 36 58

This shows as 3 separate runs / results in the Cucumber reports.

Notice the green tick next to each scenario example. This directly corresponds to the data in cucumber.json

Screenshot 2021-12-05 at 11 36 44
Newvamshi commented 1 year ago

I have integrated courgette-jvm with my project and trying to run the maven command.

It is running good but after running the test cases maven does not recognizing how many test cases it ran, fail, pass. This is running well in my local machine with jenkins getting below error.

java.io.IOException: Cannot run program "java": CreateProcess error=206, The filename or extension is too long at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1128) at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1071) at courgette.runtime.CourgetteFeatureRunner.run(CourgetteFeatureRunner.java:33) at courgette.runtime.CourgetteRunner.runFeature(CourgetteRunner.java:231) at courgette.runtime.CourgetteRunner.lambda$run$3(CourgetteRunner.java:82) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:834)

finally getting [INFO] Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.632 s - in a.TestR [INFO] [INFO] Results: [INFO] [INFO] Tests run: 0, Failures: 0, Errors: 0, Skipped: 0 [INFO] [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 29.408 s

pom <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

4.0.0 org.example project 1.0-SNAPSHOT jar project http://maven.apache.org UTF-8 org.seleniumhq.selenium selenium-java 4.8.1 io.cucumber cucumber-java 7.11.1 io.cucumber cucumber-junit 7.11.1 tech.grasshopper extentreports-cucumber7-adapter 1.13.0 org.projectlombok lombok 1.18.28 provided com.aventstack extentreports 5.0.9 org.apache.poi poi 5.2.3 org.apache.poi poi-ooxml 5.2.3 io.github.prashant-ramcharan courgette-jvm 6.10.0 org.apache.maven.plugins maven-compiler-plugin 3.8.1 1.8 1.8 org.apache.maven.plugins maven-surefire-plugin 3.0.0-M5 **/*Test.java