Web Application Automation
Framework Details:
- BDD with Cucumber
- Maven
- TestNG
- Page Factory Design Pattern
- Selenium Grid with parallel execution support
- Docker compose (Considering CI integration & Scaling)
- Allure for Reporting
Projection Execution: To execute this project there are two ways:-
- One is to setup selenium grid on your machine.
- If machine is running with a docker, simply run docker-compose.yml
A) Running Project with a selenium grid
Setup:
- Download the selenium grid folder from this link https://drive.google.com/drive/folders/1vz-cL0_8h-ch6Qni3k50MTKN2RcMEPCl?usp=sharing
- Place the SeleniumGrid folder in a directory
- Make sure you have below files in the folder a) hub.json b) node.json c) selenium-standalone.jar d) startgrid.command
- Open
startgrid.command
in a text editor, Replace the path ofSeleniumGrid
folder at Line no:4 and Line no:8, i.ecd /Users/SeleniumGrid
with yourlocalPath
. - Next is to add
geckodriver
andchromedriver
to the locals mentioned on Line no: 9. Both these drivers can be found undersrc/test/chromedriver
andsrc/test/geckodriver
in main project. - Add the above drivers to
/usr/local/bin/
of your machine. - Once this is done, Simply open terminal from your SeleniumGrid folder and run
./startgrid.command
. - If the set has configured correctly, then you should be able to see grid console listening on
port:4444
. - Test this setup by accessing your locahost at http://localhost:4444/grid/console
- At the end go to project folder and Run
mvn test
command.
Note: While running tests in local machine, you can see the execution on chrome browser
B) Running Project using Docker Compose
- Assuming that Docker is already running on a machine.
- Go to the main folder of Project Directory.
- Run the following command
docker-compose up -d --scale chrome=1
, Please note since there is only one scenario, therefore chrome value is set to 1. It's configurable based on scenarios we want to run in parallel. - Once docker compose is up and running, Run
mvn test
command. - After the test are finished, simply take the docker compose down using
docker-compose down
.
Note: While running tests in docker execution will be headless.
C) Report Generation
- Once the test execution is over,
allure-results
folder will be generated. You can see the allure reports as well. But to visualize that you need have allure installed on your machine.
Installation : brew install allure
- Once successfully installed, Go to the main project folder and run
allure-serve allure-result
- The above command should generate report on localhost http://192.168.0.170:49280/index.html
Please note: I've filled the booking form but didn't performed a submission to avoid submitting test data in production website.
Execution: