A code base for headspin hackathon
From terminal run
./gradlew build
./gradlew runTests
./gradlew runTests -Dbrowser=firefox
./gradlew runTests -Dtarget=headless
./gradlew runTests -Dtarget=headspin
You can find report in path
build/reports/allure-report/index.html
Logs are captured per test, these can be found in below path
logs/*.log
Category | Value |
---|---|
Language | Java, Groovy |
BuildTool | Gradle |
Reporting | Allure |
DI | Guice |
TestFramework | TestNG |
Environments | dev |
OS | Browsers | Run Modes | Screenshots | Parallelism |
---|---|---|---|---|
Mac | Chrome | UI | On every click and type | Yes |
Linux | Firefox | Headless | On Test Failure | Yes |
Windows | Headspin | No |
- Make a hotel booking
Brief description on some of the important packages.
This is a pre-check to verify if the site up, we make an api call to get the app state. This avoids lazy test failures.
All pages are built as a group of components which are reusable across applications.
- UserSectionComponent : This covers the header section of homepage
- Menu Component : This covers the various mmt offerings
- Planner
- HotelBookingPlannerComponent
- Filters
- PricePerNightBookingFilterComponent *UserRatingBookingFilterComponent
This approach helps when the site has lot of moving pieces and refactoring is easy.
All data is modeled as a business entity
- Site => Global entity, keeps a track of all site details, like title etc
- Customer
- Booking
All assertions are part of the model itself.
This approach helps in validation business data easily
Eg:
public void assertThatSiteIsUp() {
assertThat(title).startsWith(siteTitle);
}
public void assertHotelNameIsCorrect(String hotelName) {
assertThat(this.hotelName).isEqualTo(hotelName);
}
Framework captures screenshot on below actions to build test timeline
- Click
- Type
Framework also capture screenshot at the time of test failure
These approaches are pointers of how the solution can be taken forward. You can read more about the framework from Wiki