A Web Test Framework for developing regression suites. The test cases can be run locally and in remote server.
- Download the latest docker-compose.yml
from here, a quicker way to download
this is to use below command
curl https://raw.githubusercontent.com/reportportal/reportportal/master/docker-compose.yml -o docker-compose.yml
- Once downloaded, execute the below command to pull the required images and start containers
docker-compose -p reportportal up -d --force-recreate
- Verify login http://localhost:8080/ui/#login with
default\1q2w3e
orsuperadmin\erebus
- Create a blank project and copy and paste the below config in
reportportal.properties
undersrc/test/resources
. See the table below. - Read these great posts written below by Automation Hacks to configure the Report portal. By far, these are the only posts with accurate steps.
Sl.No | Report portal Property Name | Report portal Property Value |
---|---|---|
1 | rp.endpoint | http://localhost:8080 |
2 | rp.api.key | <API_KEY> |
3 | rp.launch | Java launch |
4 | rp.project | web_tests |
![Web_Tests_ReportPortal_Launch](https://private-user-images.githubusercontent.com/29479534/319268385-51effb54-8318-4705-ab04-fe4431f7e040.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk3MTk0ODksIm5iZiI6MTczOTcxOTE4OSwicGF0aCI6Ii8yOTQ3OTUzNC8zMTkyNjgzODUtNTFlZmZiNTQtODMxOC00NzA1LWFiMDQtZmU0NDMxZjdlMDQwLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE2VDE1MTk0OVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTkyOGQxYzIxZDQ1ODIwODAyYWZlNWM5YTI4YzJjMzI0NjY0ZWUwMjEyZTM1NWExMzNhOTE4NDZmZDRkOGRlZDkmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.Aow1W5UQ_O8_7cmZOIlfSL2InmMIqZ__B5_LRuBY7Tc)
![Web_Tests_ReportPortal_Test_Methods](https://private-user-images.githubusercontent.com/29479534/319268426-ed758683-1e83-4020-acaa-97151941896d.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk3MTk0ODksIm5iZiI6MTczOTcxOTE4OSwicGF0aCI6Ii8yOTQ3OTUzNC8zMTkyNjg0MjYtZWQ3NTg2ODMtMWU4My00MDIwLWFjYWEtOTcxNTE5NDE4OTZkLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE2VDE1MTk0OVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWQ1YzFkNzZjMTM1NDcxNDA4ZjMyZmNhMDBlNWY1ZDA0N2IyYzU3YWM4OWQ4MzFiMDEzYjcyZWE1N2E1NTE3YmImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.nj6dE7O577cggjtxc3AomuV9xM7UsDq1MIew-sbvrTM)
![Web_Tests_ReportPortal_Failed](https://private-user-images.githubusercontent.com/29479534/319268446-979cfb69-5ba7-4560-b3dc-a4884f9da388.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk3MTk0ODksIm5iZiI6MTczOTcxOTE4OSwicGF0aCI6Ii8yOTQ3OTUzNC8zMTkyNjg0NDYtOTc5Y2ZiNjktNWJhNy00NTYwLWIzZGMtYTQ4ODRmOWRhMzg4LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE2VDE1MTk0OVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTcwZmQxYzI1ZWM0MDU0NzdjMjY0NWUyZDYyYTg0NWYyMTNkZTYxZjc3YzgxYThjN2NiNmJmNWU3MjAyMGRmZDUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.nonbDnK8SZrj--WuIt4YfBuwQxcj-qJqWbAdMKmu1gk)
- Create a discord account and follow the steps given here to configure a message channel and send the test reports after the test execution.
- Pass your channel's webhook token in the
SauceLabsPortalConstants
class. - Here we will send the Report Portal Launch URL along with test case metrics. So make sure that your report portal is up and running.
- You're ready to execute your tests now. Follow the below section.
![Web_Tests_Discord](https://private-user-images.githubusercontent.com/29479534/319268488-bb19fb36-6246-43b8-a8ab-5fbc1a373b7b.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk3MTk0ODksIm5iZiI6MTczOTcxOTE4OSwicGF0aCI6Ii8yOTQ3OTUzNC8zMTkyNjg0ODgtYmIxOWZiMzYtNjI0Ni00M2I4LWE4YWItNWZiYzFhMzczYjdiLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE2VDE1MTk0OVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWJmMThkMWQ4NGFlYzI0ODFkOWY2OGJmZTMwNjBlNGZhOGM3OTFhYWQ1YTkzOWNhY2FlODVlZjgzNjBkZGMzMDgmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.HjUWbvbDlRn37Hhqgwb1frhwx4IWnyNSsAkjmO3QrN8)
- git clone https://github.com/iamcharankumar/web_test_framework.git
- cd web_test_framework
- git pull
- mvn clean test -Dgroups=SAUCE_LABS_SMOKE,SAUCE_LABS_REGRESSION -Dtestng.parallel=methods -DthreadPoolSize=3 -Ddataproviderthreadcount=3
NOTE
- -Drunmode=remote or -Drunmode=local (default value is
local
) - -Dbrowser=chrome or -Drunmode=firefox (default value is
chrome
) - Run the above maven command (no testng.xml required) with the respective groups and thread counts. The screenshot listeners are configured in "pom.xml" under "< property >" tag.
- Run mode value can be 'local' or 'remote'
- You can configure it in the "config.properties" file.
- To run in remote server, follow the below docker setup instructions.
Make sure to have the docker desktop and docker compose installed on your machine.
NOTE: Since I'm running the docker-compose-v3.yml
on Apple Chip, I'm using docker-seleniarm
images.
More on the Docker images for Selenium (ARM/NON-ARM)
read this GitHub's README.
docker ps -a
docker rm -vf $(docker ps -aq)
docker-compose -f docker-compose-v3.yml up --scale chrome=10 -d --force-recreate
curl -X DELETE http://localhost:4444/wd/hub/session/{session_id}
![Selenium_Grid_Output](https://private-user-images.githubusercontent.com/29479534/320189767-c94df587-e4b5-4199-ab94-c9bbf327ae58.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk3MTk0ODksIm5iZiI6MTczOTcxOTE4OSwicGF0aCI6Ii8yOTQ3OTUzNC8zMjAxODk3NjctYzk0ZGY1ODctZTRiNS00MTk5LWFiOTQtYzliYmYzMjdhZTU4LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE2VDE1MTk0OVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTQ1N2NmMjZjMzRkOGZmNDFjZmFmNWIzMTBjMmJhNDQwODYzZGE1NmQ0NTM4M2Y0MzE4ZDIxZjcyMzlkMTJmYzQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.1sqnPRtrGPC6N3baddxQ9YAPv6-lHO4MW5T-ctNglso)