Skip to content

vibssingh/SpringBoot_Serenity_Cucumber_JUnit4_Demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SpringBoot_Serenity_Cucumber_JUnit4_Demo

SpringBoot Test Framework using Serenity, Cucumber, JUnit4

  1. RestController is created with the name of HelloController in src/main/java
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HelloController {
	
    @GetMapping(path="/")
    String hello() {
        return "Hello World, Spring Boot!";
    }
      
    @GetMapping(path="/qaautomation")
    String qaautomation() {
        return "Hello QA Automation!";
    }
}
  1. We don't want to run the application on port 8000, so we have configured port value in application.properties present in src/main/resources.
server.port=8090
  1. Run the below command to execute the tests and generate Serenity Report
mvn clean verify
  1. Serenity Report is generated in folder target/site/serenity/index.html

  2. Cucumber Report is generated by add publish=true to CucumberOptions in SpringRunnerTests

@CucumberOptions(features = "src/test/resources", tags = "",
        glue = "com.example.Springboot_Serenity_Demo.definitions", publish = true)

About

SpringBoot Test Framework using Serenity, Cucumber, JUnit4

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published