This is a spring boot application, that makes a call to the testrail api and retrievs a list of all projects and within a table displays the total count of test cases, total count of automated test cases, and percentage of automated test cases. In order for the application to start up correctly it must first be configured.
In order to support a faster load time for project metrics when the home page is called, the data is stored into an instance of MySQL DB as part of a scheduled job call to the /loaddata
endpoint. The call to the endpoint is currently set to run on the following cron schedule:
0 0 */3 * * *
- “At minute 0 past every 3rd hour.”
it can be changed in the ScheduledTasks
class (currently not configurable via a properties file).
Start up an instance of MySQL and set up a database and credentials as follows:
create database testrailReporting;
create user 'reportuser'@'%' identified by '{specify_password}';
grant all on testrailReporting.* to 'reportuser'@'%';
# create a directory called conf
$ mkdir conf
$ cd conf
# within the directory create a file called application.properties
$ vim application.properties
Within the file the following content should be added:
testrail.baseurl={YOUR_URL_DOMAIN_FOR_TESTRAIL}
testrail.username={YOUR_USERNAME_FOR_TESTRAIL}
testrail.password={YOUR_PASSWORD_FOR_TESTRAIL}
page.logopath={PATH_TO_IMAGE_IN src.main.resources.static.img - i.e. img/images.png}
# Values for custom test case statuses
testrail.status.customstatus1={"Custom Status 1"}
testrail.status.customstatus2={"Custom Status 2"}
testrail.status.customstatus3={"Custom Status 3"}
testrail.status.customstatus4={"Custom Status 4"}
testrail.status.customstatus5={"Custom Status 5"}
testrail.status.customstatus6={"Custom Status 6"}
testrail.status.customstatus7={"Custom Status 7"}
spring.jpa.hibernate.ddl-auto=update
spring.datasource.url=jdbc:mysql://localhost:3306/testrailReporting?useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=PST
spring.datasource.username=reportuser
spring.datasource.password={specify_password}
Create an environment variable called TESTRAIL_REPORT_HOME
and point it to where the conf directory is located
$ vim ~/.bash_profile
export TESTRAIL_REPORT_HOME={PATH_TO_CONF_DIRECTORY}
$ . ~/.bash_profile
In order for this application to work optimally, the following configuration changes need to be made to your TestRail instance:
- within Administration > Customizations
- add a new field called "Automation"
- the type for this new field should be a Dropdown
- the options for this field should be:
1, Automated
2, Not Automated
3, Not Automatable
- default value should be set to: "Not Automated"
To start up the application:
mvn spring-boot:run
To build the application as a war file:
mvn clean package
To access the application, on your browser navigate to: http://localhost:8080
Broad Status Report: Provides graphical status of test runs for given testRunIds, i.e. pass/fail/untested. testRunIds are required. This method can be used for either a single or multiple test runs across different projects.
- URL:
/runallstatusreport?testRunIds={testRunId1,testRunId2,testRunId3}
- Method:
GET
Status Report: Provides graphical status of test run for a given testRunId, i.e. pass/fail/untested. testRunId is required.
- URL:
/runstatusreport?testRunId={testRunId}
- Method:
GET
Type Report: Provides graphical view of the different types of test cases for a given testRunId, i.e. manual/automated.
- URL:
/runtypereport?testRunId={testRunId}
- Method:
GET
View of the home page when the application is first started up: View of the 'Close Test Runs' page which can be used to close all test runs within a given project id: A call to the 'Broad Status Report' endpoint which can be used to get the status of test runs across different projects