getappmap / getappmap/appmap-java

Feature Request: Add support for Cucumber for Java

Open
#308 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
88
Forks
17
Avg merge
2d 2h
Merged PRs (30d)
1

Description

Currently, the AppMap Java agent does not seem to recognize and record test executions run via Cucumber. When the AppMap Maven plugin is configured for a standard Cucumber for Java project, no .appmap.json files are generated, although the tests run successfully and the agent appears to attach to the process. This limits the ability to use AppMap's powerful debugging and analysis features in projects that rely on BDD with Cucumber.

Describe the solution you'd like

It would be highly beneficial for the AppMap Java agent to include support for Cucumber. This would likely involve hooking into the Cucumber test execution lifecycle (e.g., Before and After scenario hooks) to automatically start and stop AppMap recordings for each executed scenario. This would allow developers to generate AppMaps for their BDD tests seamlessly.

Describe alternatives you've considered

There are no clear alternatives at the moment. Without direct support, it's not possible to record AppMaps from our Cucumber test suites, which means we miss out on valuable insights during testing.

Additional context

A minimal, reproducible example can be created using the official cucumber/cucumber-java-skeleton project.

Steps to Reproduce:

  1. Clone the repository: git clone https://github.com/cucumber/cucumber-java-skeleton.git
  2. Navigate to the maven directory: cd cucumber-java-skeleton/maven
  3. Add the appmap-maven-plugin to the pom.xml:
    <plugin>
        <groupId>com.appland</groupId>
        <artifactId>appmap-maven-plugin</artifactId>
        <version>1.3.0</version>
        <executions>
            <execution>
                <goals>
                    <goal>prepare-agent</goal>
                </goals>
            </execution>
        </executions>
    </plugin>
    
  4. Run the tests: mvn test
  5. Expected behavior: An appmap directory containing .appmap.json files is created.
  6. Actual behavior: The tests pass, but no AppMap data is generated.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue in the cucumber/cucumber-java-skeleton repository from its maven directory, using the appmap-maven-plugin configuration shown in pom.xml and running mvn test. Done means the tests still pass and an appmap directory containing .appmap.json files is generated for the Cucumber scenarios.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
testing-qa
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.