This project automates the hotel booking functionality on the Adactin platform using Selenium WebDriver, TestNG, and Java. It includes comprehensive test cases covering:
- Login
- Registration
- Room Booking
- Search Hotel
- Email verification
- Forgot Password
- Change Password
- Cancel Booking
- Login Automation: Validates user login functionality.
- Registration Automation: Automates the registration process and email verification.
- Room Booking Automation: Tests the hotel search, selection, and booking process.
- Search Hotel Automation: Validates the hotel search functionality.
- Email Verification Automation: Validates the email verification process after registration.
- Forgot Password Automation: Tests the forgot password functionality.
- Change Password Automation: Validates the change password functionality.
- Cancel Booking Automation: Validates the cancellation of hotel bookings.
- Extent Reports Integration: Generates detailed test execution reports.
- Data-Driven Testing: Uses JSON files for managing test data.
- Html Formatting: Provides a well-structured HTML report for test results.
Component | Technology |
---|---|
Programming Language | Java |
Build Tool | Maven |
Testing Framework | TestNG |
Web Automation | Selenium WebDriver |
Reporting Tool | Extent Reports |
JSON Parsing | Jackson Library |
AdactinHotelAutomation/
├── src/
│ ├── main/
│ │ ├── java/ # Page objects, utilities, constants
│ │ └── resources/ # Test data in JSON format
│ └── test/
│ ├── java/ # Test classes, TestNG listeners
│ └── resources/ # TestNG XML configuration
- Java: JDK 17 or higher
- Maven: Installed and configured
- Browser: Microsoft Edge (used by default)
- IDE: IntelliJ IDEA (recommended)
-
Clone the repository:
git clone https://github.com/mansigarg10/adactin-hotel-services.git
-
Open the project in IntelliJ IDEA.
-
Use Maven to install dependencies:
mvn clean install
-
Update JSON files in
src/main/resources/
with valid test data.
-
To run all tests via Maven:
mvn test
-
To run specific tests: Use corresponding TestNG XML files located in root directory.
Test data is maintained as JSON files:
File Name | Purpose |
---|---|
LoginDetails.json |
Login credentials |
BookingDetails.json |
Hotel booking details |
RegisterDetails.json |
User registration info |
Test execution reports are generated using Extent Reports and saved at:
/docs/index.html
Make sure the screenshot paths in the reports are valid and accessible.
You can view the latest test execution report hosted via GitHub Pages:
The report includes structured HTML output and embedded screenshots. Ensure paths are properly updated post-generation for accurate rendering.
LoginPage
– Handles login functionalitySearchHotelPage
– Automates hotel searchSelectHotelPage
– Automates hotel selectionBookHotelPage
– Automates booking detailsBookingConfirmationPage
– Validates booking confirmationRegisterPage
– Handles user registrationEmailVerificationPage
– Validates email verificationForgotPasswordPage
– Automates forgot password functionalityChangePasswordPage
– Automates change password functionalityCancelBookingPage
– Automates booking cancellationBookedItineraryPage
– Validates booked itinerary
RoomBookingTest
– Validates the end-to-end room booking flowRegisterTest
– Validates user registration functionality
AdactinConstants
– Contains constant values used across the frameworkBaseTest
– Handles common setup/teardown methods
- Ensure that the JSON test data files are properly formatted to avoid deserialization errors.
- Screenshot paths used in Extent Reports must be accessible to render properly.
Contributions are welcome! Feel free to open issues or submit pull requests.
For major changes, please open an issue first to discuss what you'd like to change.
You can also suggest enhancements for tests, reporting, or refactoring strategies.
This project is licensed under the MIT License.
Mansi Garg