Selenium-cucumber is a behavior driven development (BDD) approach to write automation test script to test Web.
Page Factory is an inbuilt Page Object Model concept for Selenium WebDriver but it is very optimized.Here we follow the concept of separation of Page Object Repository and Test Methods.
Additionally, with the help of PageFactory class, we use annotations @FindBy to find WebElement. We use initElements method to initialize web elements.
For UI Tests : Selenium-cucumber-Maven with PageFactory Design Pattern.
For API Tests : RestAssured with Junit
- IntelliJ IDEA 2016
- Java-8
- Maven-3.5.3
- Enable cucumber-java plugin in IntelliJ
- Git
- Required driver versions (Chrome-v2.38 & Gecko-v0.20.1)
- Required browsers (Chrome-v66.0 & Firefox-v60.0)
- Windows 64bit
Configure JAVA_HOME and MAVEN_HOM in the Environmental Variables : Follow the setup instructions specified in here https://www.mkyong.com/maven/how-to-install-maven-in-windows/
HotelBookingSystem
|manualTestReports
| |ManualAcceptance.md
|src/test/java
| |HelpersTests
| | |ApiHelper
| | |UiHelper
| | |Utils
| |pageobjects
| | |BookingHomePage
| |StepDefinitions
| | |ApiStepDefinitions
| | |Hooks
| | |StepDefinitions
| |RuApiTest
| |RunUITest
|src/test/resources
| |Drivers
| |Features
| | |HotelBooking.feature
| | |ApiTests.feature
| |jsonFiles
| | |Post.json
| |config.Properties
Please make sure to have all the tools and libraries mentioned in the "Tools And Environment" section.
Step-1: Clone the repository from https://github.com/nirmalaC/HotelBookingSystem.git
Step-2: Use the following maven commands to run the tests.
"mvn test" executes both UI and API tests
mvn test -Dcucumber.options="--tags @ui" to run the UI tests
mvn test -Dcucumber.options="--tags @api" to run the api tests