Showroom microservices and a shopping web application under test
Category | Value |
---|---|
Language | Java 17 |
Build Tool | Maven |
Test Tool | Selenium WebDriver |
BDD | cucumber |
DI | SpringBoot |
Test Framework | jUnit5 and TestNG |
Reporting | cucumber and surefire report |
- Showroom Car Service suppose to return list of car details based on car type
- Car type is passed as path variable as input for the service and
- Data were maintained using H2 in memory database
- Spring JPA used to interact and perform DB operation
- microservice were developed in layers such as controller, repository, data and service layer.
- Swagger file is implemented for the service developed.
mvn spring-boot:run
Launch Swagger:
http://localhost:8020/swagger-ui/index.html
Retrieve Cars endpoint:
http://localhost:8020/api/cars/{type}
- GET showroom cars based on model type for example Suv, Saloon and Hatchback
- To demonstrate unit testing practices on different layers
- Controller Layer
- Data layer
- Service Layer
- To demonstrate Integration testing using Rest-assured in BDD style of test
- Validate API with complete data sets
- json-schema validations
- positive and negative tests
- To demonstrate Acceptance test using Selenium WebDriver.
- Used Cucumber BDD Style of test to demonstrate business specification
- Most Critical User journey were tested
OS | Browsers | Run Modes | Screenshots | Parallelism |
---|---|---|---|---|
Mac | Chrome/Firefox | UI | On every test step | Yes |
Windows | Chrome/Firefox | UI | On every test step | Yes |
- Filter Products
- Products added to Cart
- A complete product purchase journey
Brief description on the important packages.
- Spring SimpleThreadScope is leveraged to achieve parallel test.
- All data are model as a business entity
- Page objects and interactions are maintained ui_layer package
- Java Reflections is used for grouping and abstractions.
- All pages are built as a group of components which are reusable across applications.
Tests can be run on local and support for selenium grid execution.
Support parallel execution -
feature tags - @e2e, @regression
browser option - chrome, firefox
spring profiles -
- default - application.properties
Run tests in local:
mvn clean test -Dbrowser=chrome -Dcucumber.filter.tags="@e2e"
Cucumber reports generated after tests run: refer to report path : target>>cucumber-report.html
- Logs generated at target>>logs>> test-execution.log