Skip to content

A Backend Test Framework for developing regression suites.

Notifications You must be signed in to change notification settings

iamcharankumar/api_test_framework

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 

Repository files navigation

ABOUT

A REST API Test Framework for developing the regression suites. The test cases can be run locally or through CI/CD.

STEPS FOR INTEGRATING TESTNG & REPORT PORTAL

  1. 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
  2. Once downloaded, execute the below command to pull the required images and start containers docker-compose -p reportportal up -d --force-recreate
  3. Verify login http://localhost:8080/ui/#login with default\1q2w3e or superadmin\erebus
  4. Create a blank project and copy and paste the below config in reportportal.properties under src/test/resources. See the table below.
  5. Read these great posts written below by Automation Hacks to configure the Report portal. By far, these are the only posts with accurate steps.
    1. Further reading on setting up the reportportal is here.
    2. Further reading on configuring logback with reportportal to push logs is here.
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 api_tests

REPORT PORTAL OUTPUTS

Test_Logs_MVN_CMD Test_Logs_Pushed_Report_Portal Test_Suite_Launches_Report_Portal

STEPS FOR INTEGRATING TEST REPORTS [REPORT PORTAL URL] WITH DISCORD MESSAGE SERVICE

  1. Create a discord account and follow the steps given here to configure a message channel and send the test reports after the test execution.
  2. Pass your channel's webhook token in the ApiConstants class.
  3. 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.
  4. You're ready to execute your tests now. Follow the below section.

DISCORD OUTPUTS

Discord_Test_Report

STEPS FOR THE TEST EXECUTION

The TestNG has a default value of thread = 5 for parallel testing. To override the thread values use -DthreadPoolSize=3 -Ddataproviderthreadcount=3 in the below maven command

1. git clone https://github.com/iamcharankumar/api_test_framework.git

2. cd api_test_framework

3. git pull

4. mvn clean test -Dgroups=ALL_SMOKE,ALL_REGRESSION -Dtestng.parallel=methods

Note:

  • To run specific test cases, use appropriate Test groups present in the 'TestGroups' class.