Skip to content

secoro/hellocucumber

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Example Cucumber Integration Tests with Kotlin and Maven

This project demonstrates an example implementation of Cucumber integration tests using Kotlin and Maven. It utilizes multiple-cucumber-html-reporter to generate an HTML test report.

Prerequisites

Ensure you have the following installed:

Running the Project Locally

  1. Clone the repository:

    git clone git@gitlab.com:deroosean/hellocucumber.git
    cd hellocucumber
  2. Run tests with Maven:

    mvn clean test || true

    The || true ensures that even if tests fail, the pipeline continues.

  3. Generate the HTML report:

    node generateReport.js
  4. View the report:

    • Open the generated report in your browser:
      open reports/index.html  # MacOS
      xdg-open reports/index.html  # Linux
      start reports\index.html  # Windows

GitLab CI/CD Pipeline

This project includes a .gitlab-ci.yml file for automating the test execution and report generation.

Pipeline Steps:

  1. Run Tests:

    mvn clean test || true
    • Runs the Cucumber tests.
    • || true ensures that failures do not stop the pipeline.
  2. Generate HTML Report:

    node generateReport.js
    • Converts test results into an HTML report inside the /reports folder.

Project Structure

/
├── src/test/kotlin            # Cucumber step definitions & feature files
├── reports                    # Generated HTML reports
├── generateReport.js          # Script for generating the test report
├── pom.xml                    # Maven configuration
├── gitlab-ci.yml              # CI/CD pipeline definition
└── README.md                  # This file

Dependencies

This project uses the following main dependencies:

Troubleshooting

  • Tests are failing, but I still want the report?
    • The pipeline ensures the report is generated even if tests fail.
  • Reports folder is empty?
    • Ensure that generateReport.js is properly executed after running tests.
  • Node.js is not recognized?
    • Ensure Node.js is installed and added to your system PATH.

Contributing

Feel free to submit issues and pull requests to improve this project.


Happy testing! 🚀

Releases

No releases published

Packages

 
 
 

Contributors