DIGIT Test Automation framework majorly deals with various API services validation. It enables to test and validate back end services across all active environments and as well as tenant ids. For more details on framework architecture please refer the documentation. For guide on Kafka Producer Consumer approach, please refer to documentation
In this section we have listed down some of the major libraries which is being used by the test automation framework as a maven dependency
that is defined in pom.xml
.
karate-core
: To provide core features ofkarate
.karate-junit4
: To facilitateJUnit
testing this dependency is required.karate-gatling
: To perform API Performance test. For more details on performance test with karate, checkout herekarate-apache
: To make use of karate inmaven
project.karate-netty
: Tomock
API calls locally. For more details please checkout herecucumber-jvm-parallel-plugin
: To facilitateparallel execution
.poi
andpoi-ooxml
: To work with the latest and older versions ofexcel
file.log4j-api
: An interface that handles logs.allure-junit4
: To facilitateTest Reports
along withJUnit
runner.allure-cucumber4-jvm
: To facilitateTest Reports
along withCucumber JVM
and helps to logfeature
file steps into the test report.
This framework requires below prerequisites to be covered
To set up this framework, two mandatory softwares need to be installed into the system. Follow below step by step setup guidelines.
- Download JDK 8
- Download maven 3.6.3
- JDK Installation Guide
- maven Installation Guide
- Install Visual Studio Code
-
First install HomeBrew
-
To install OpenJDK 8 with brew, execute
$ brew cask install adoptopenjdk8
on terminal -
To install maven into the system, execute
$ brew install maven
on terminal
To clone the framework to your local, please follow the below step.
- Open git bash or any other terminal and execute the below command to clone the project repository in the system
git clone https://github.com/egovernments/test-automation.git
- Create role action mapping as per the requirement
- Create a new user as per the mapped role
- Disabled the resource creation rate limit for the environment where the automation scripts will be executed
- Configure and deploy Kafka REST Proxy tool in the environment with other services. Kafka Cluster can be accessed through proxy API created by kafka REST Proxy.
- Currently kafka related testcases will not run as we are waiting for the latest version of the tool to be releases officially.
Environment configuration files needs to be created in local
by following below steps.
- Create environment specific files with
.yaml
extension anywhere in the local directory - It is recommended to provide environment specific names to the files (like:
qa.yaml
,uat.yaml
,config.yaml
etc.) - Please keep the environment specific data in the config file as per below format.
host: <Host URL goes here>
# This parameter is used in authorization header
basicAuthorization: <Basic Authorization Encoded String goes here>
# This parameter will be removed once kafka rest proxy is accessible
localhost: http://localhost:8082/
# This parameter is used to mock kafka test cases until the kafka rest proxy 6.2 is released
mockHost: https://e5a23525-a2d2-42d3-b518-2761de88655c.mock.pstmn.io/
# This parameter is used to check the kafka offset movement threshold percentage
kafkaOffsetThresholdPercentage: 75
stateCode: pb
cityCode: amritsar
# Super User credentials for login(need to create user manually)
superUser:
userName: <username goes here>
password: <password goes here>
type: EMPLOYEE
# Employee username and password to update an existing user's profile (need to create user manually)
employee:
userName: <username goes here>
password: <password goes here>
type: EMPLOYEE
# Citizen's username and password needed for Property End to End flow (need to create user manually)
citizen:
userName: <username goes here>
password: <password goes here>
type: CITIZEN
# Alternate Citizen's username and password needed for Transfer Ownership of Property (need to create user manually)
alternateCitizen:
userName: <username goes here>
password: <password goes here>
type: CITIZEN
# Counter Employee's username and password, required for multiple use (need to create user manually)
counterEmployeeUser:
userName: <username goes here>
password: EMPLOYEE
type: <user type goes here>
citizenArchitect:
userName: <username goes here>
password: <username goes here>
type: CITIZEN
Please use the appropriate tags to execute tests based on the requirement.
Tags | Description |
---|---|
@reports | Reports tests |
@url_Shorterning_Invalid | Url Shortening |
@Searcher | Searcher tests |
@location | Location tests |
@localization | Loacalization tests |
@userotp | User OTP tests |
@eGovUser | User profile update tests |
@accessControl | Access control tests |
@mdmsService | MDMS tests |
@userAccountAfterLock | User Account After Lock tests |
@zuul | Zuul tests |
@eGovPdf | PDF Service tests |
@idGenerate | ID generation tests |
@egovWorkflowBusniessService | eGov Workflow tests |
@fileStore | File store tests |
@pgservices | PG Service tests |
@encService | Enc Service tests |
Tags | Description |
---|---|
@apportionService | Apportion tests |
@dashboardAnalytics | Dashboard Analytics tests |
@egfMaster | EGF Master tests |
@egfInstrument | EGF Instrument tests |
@dashboardIngest | Dashboard Ingest tests |
@hrms | HRMS tests |
@collectionServices | Collecetion Service tests |
@billingServiceDemand | Billing Demand tests |
@billingServiceBill | Billing Service tests |
Tags | Description |
---|---|
@propertyServices | Property Tax tests |
@bpaCalculator | BPA Calculator tests |
@bpaService | BPA tests |
@dcrService | DCR tests |
@eGovUserEvent | eGov User Event tests |
@fireNOCBillingFeature | FireNOC Calculator tests |
@fireNocService | FireNOC tests |
@landService | Land Service tests |
@NOCService | NOC Service tests |
@PGRService | PGR Service tests |
@propertyCalculator | Property Tax Calculator tests |
@fsmService | FSM Service tests |
@fsmBillingSlab | FSM Calculator tests |
Tags | Description |
---|---|
@coreServices | Runs all services under core services |
@businessServices | Runs all services under business services |
@municipalServices | Runs all services under municipal services |
@e2eServices | Runs all e2e service tests |
Tags | Description |
---|---|
@regression | Runs all regression tests across all services |
@smoke | Runs all smoke tests across all services (coming soon) |
Tags | Description |
---|---|
@propertyTaxEndToEnd | Property Tax and mCollect tests |
@tradeLicenseEndToEnd | Trade License mdms tests |
@wsEndToEnd | Water and Sewerage tests |
@fsmEndToEnd | FSM tests |
@pgrEndToEndFlow | PGR tests |
@firenocEndToEnd | FireNOC tests |
@bpae2eservice | BPA tests |
Tags | Description |
---|---|
@kafkaServices | Runs all kafka releated services(coming soon) |
To start the test execution in local
,
- Open command prompt or terminal
- Navigate to project folder and execute,
mvn clean test "-DconfigPath= <path of the environment config. file>" "-tags=@<tag1,tag2>"
mvn clean test "-DconfigPath= /User/apple/Documents/config.yaml" "-Dtags=@searchMdms,@eGovUser"
Follow below step to find location of reports generated post test execution to analyze the results.
- A folder with
timestamp
will be created under./target/
. - Navigate to
./target/<timestamp>/cucumber-html-reports
- Open
overview-features.html
- A folder with
extent-reports
will be created under./target/
. - Navigate to
./target/extent-reports/
- Open
eGov_Extent_Report_<timestamp>.html
- Dashboard View -
- Tagwise/Modulewise View -
- All Tests View -