CN114546880A - Test report display method and device - Google Patents

Test report display method and device Download PDF

Info

Publication number
CN114546880A
CN114546880A CN202210286867.2A CN202210286867A CN114546880A CN 114546880 A CN114546880 A CN 114546880A CN 202210286867 A CN202210286867 A CN 202210286867A CN 114546880 A CN114546880 A CN 114546880A
Authority
CN
China
Prior art keywords
test
test result
configuration file
displaying
result data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210286867.2A
Other languages
Chinese (zh)
Inventor
杨广锦
侯慧
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
XCMG Hanyun Technologies Co Ltd
Original Assignee
XCMG Hanyun Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by XCMG Hanyun Technologies Co Ltd filed Critical XCMG Hanyun Technologies Co Ltd
Priority to CN202210286867.2A priority Critical patent/CN114546880A/en
Publication of CN114546880A publication Critical patent/CN114546880A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Prevention of errors by analysis, debugging or testing of software
    • G06F11/3668Testing of software
    • G06F11/3672Test management
    • G06F11/3692Test management for test results analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Prevention of errors by analysis, debugging or testing of software
    • G06F11/3668Testing of software
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention discloses a method and a device for displaying a test report, wherein the method comprises the following steps: reading a test configuration file at regular time; formatting the test configuration file into a test result query request to obtain test result data pre-filled in the test configuration file; persistently storing the test result data and generating an aggregated report; outputting and displaying the aggregation report through a user interaction interface; and the test configuration file is newly built on a test server of the test framework. The device comprises a timing task module, a timing task module and a timing task module, wherein the timing task module is used for reading a test configuration file at regular time, formatting the test configuration file into a test result query request and acquiring test result data of a pre-filled test task in the test configuration file; the data processing module is used for persistently storing the test result data; and the display module is used for generating an aggregation report according to the test result data and outputting display through a user interaction interface.

Description

Test report display method and device
Technical Field
The invention relates to a method and a device for displaying a test report, and belongs to the technical field of automatic testing.
Background
With the continuous development of companies, more and more software system projects are developed, and in order to save time cost and improve testing efficiency, a testing department establishes an automatic testing continuous integration flow for the software systems so as to realize the regression verification of the functions of the software systems at regular intervals and ensure the stability of the functions of the software systems during version upgrading.
At present, mature automatic test frames in the market comprise RobotFramework, Jenkins + Ant + Jemeter, Python + pytest + Allore and the like, but most of the test frames are one-time automatic test for a certain version of a certain project, and when a management layer wants to check the test quality of each version of a certain software system project from a time dimension or wants to check the automatic test results of all software system projects of a company, the automatic test frames cannot be realized, so that a method capable of supporting the display of a plurality of visual test reports needs to be designed to meet the management needs of the software projects of the company.
Disclosure of Invention
The invention aims to overcome the defects in the prior art, and provides a method and a device for displaying a test report, which support the aggregate display of multiple software projects and multiple versions of test reports and fully meet the software project management requirements of companies.
In order to achieve the purpose, the invention is realized by adopting the following technical scheme:
in a first aspect, the present invention provides a method for displaying a test report, including the following steps:
reading a test configuration file at regular time;
formatting the test configuration file into a test result query request so as to obtain pre-filled test result data of each test task from the test configuration file;
persistently storing the test result data, and generating an aggregation report according to the test result data;
outputting and displaying the aggregation report through a user interaction interface;
and the test configuration file is newly built on a test server of the test framework.
The test profile is a config.yaml profile.
Formatting the test configuration file into a test result query request is realized by a scheduling task defined by python, and the method comprises the following steps:
calling a yaml.
Importing a json module to format test result data in the config.yaml configuration file;
and the import requests module assembles the test result data after the formatting processing so as to obtain a test result query request.
The scheduling task is started by a scheduler timing call developed by python, and comprises the following steps:
importing an APScheduler module, and calling a background scheduler to add a new background scheduler by a background group scheduler method;
defining an add _ jobmethod to load a scheduling task into a memory as a job, setting a trigger of the job as cron, and assigning a value to the trigger time of the cron;
and when the trigger time set by the cron is reached, starting a scheduling task by using a background scheduler.
The method for acquiring the test result data comprises the following steps:
calling a first url resolving routing method, resolving a url address in the test structure query request, comparing the url address obtained by resolving with a pre-declared url address, and forwarding the test result query request to a first view function if the two url addresses are matched;
and the first view function judges the request mode of the test result query request through the request.
The method for persistently storing the test result data comprises the following steps:
judging the field type in the test result query request by an if method defined in the first view function;
corresponding to each category field, respectively creating a corresponding data model so as to describe each category field;
a table structure corresponding to the data model is established in the database by calling a management.
Calling a create method of the data model to add test result data to the database table;
calling a save method of the data model to finish the storage of test result data;
the data model includes: the TestTask data model comprises a TestTask data model used for describing field information of the test task, a TestProject data model used for describing project information corresponding to the test task and a TestReport data model used for describing test result information executed by the test task.
The method for outputting and displaying the aggregation report comprises the following steps:
forwarding the test result query request to a second view function through a second url resolution route;
calling the TestReport data model through a second view function to inquire test result data matched with the test result inquiry request;
rendering the inquired test result data by calling a webpage template;
and displaying the rendered test result data in a test result report form through a network browser.
The method for outputting and displaying the aggregation report further comprises the following steps:
a response method of importing echarts.js visualization framework and rewriting the second view function;
and transmitting the data packet of the TestReport data model to a test result query request initiated by echarts.
In a second aspect, the present invention provides a device for displaying a test report, the device comprising:
the timing task module is used for reading the test configuration file at regular time, formatting the test configuration file into a test result query request and acquiring pre-filled test result data of each test task from the test configuration file;
the data processing module is used for persistently storing the test result data;
the display module is used for generating an aggregation report according to the test result data and outputting and displaying the aggregation report through a user interaction interface;
and the test configuration file is newly built on a test server of the test framework.
The test configuration file is a config.yaml configuration file;
the timing task module comprises:
the scheduling task unit is used for calling a yaml. Importing a json module to format test result data in the config.yaml configuration file; the import requests module assembles the formatted test result data to obtain a test result query request;
and the scheduler is used for starting the scheduling task unit at regular time, reading the test result data in the test configuration file and initiating an interface request to the data processing module.
Compared with the prior art, the invention has the following beneficial effects:
the method and the device realize the result aggregation display of the test reports of multiple software projects and multiple versions, improve the management capability of a company on the test quality of each project under the condition that the software projects are continuously expanded, and fully meet the requirement of the company on the management of the software projects.
Drawings
Fig. 1 is a flowchart illustrating a test report according to an embodiment of the present invention.
Detailed Description
The technical solutions of the present invention are described in detail below with reference to the drawings and specific embodiments, and it should be understood that the specific features in the embodiments and examples of the present invention are described in detail in the technical solutions of the present application, and are not limited to the technical solutions of the present application, and the technical features in the embodiments and examples of the present application may be combined with each other without conflict.
The term "and/or" herein is merely an association relationship describing an associated object, and means that there may be three relationships, for example, a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the character "/" herein generally indicates that the former and latter related objects are in an "or" relationship.
The first embodiment is as follows:
fig. 1 is a flowchart of a method for displaying a test report according to a first embodiment of the present invention. The method for displaying the test report provided by this embodiment may be applied to a terminal, and may be executed by a device for displaying the test report, where the device may be implemented by software and/or hardware, and the device may be integrated in the terminal, for example: any smart phone, tablet computer or computer device with a communication function. Referring to fig. 1, the method of the present embodiment specifically includes the following steps:
s10, reading the test configuration file at regular time;
s20, formatting the test configuration file into a test result query request so as to obtain pre-filled test result data of each test task from the test configuration file;
s30, persistently storing the test result data and generating an aggregation report according to the test result data;
s40, outputting and displaying the aggregation report through a user interaction interface;
and the test configuration file is newly built on a test server of the test framework.
Optionally, the test result data includes item information, a test output log path, a test result report path record, and the like corresponding to each test task.
The embodiment of the invention provides a test report display method, which realizes result display of a test report of multiple software projects and multiple versions, improves the management capability of a company on the test quality of each project under the condition of continuous expansion of the software projects, and fully meets the requirement of company software project management.
Example two:
in an embodiment of the present invention, the test profile is a config.
Formatting the test configuration file into a test result query request is realized by a scheduling task defined by python, and the method comprises the following steps:
calling a yaml.
Importing a json module to format test result data in the config.yaml configuration file;
and the import requests module assembles the test result data after the formatting processing so as to obtain a test result query request.
Further, the scheduling task is started by a scheduler timing call developed by python, and comprises:
importing an APScheduler module, and calling a background scheduler to add a new background scheduler by a background group scheduler method;
defining an add _ job method to load a scheduling task into a memory as a job, setting a trigger of the job as cron, and assigning a value to the trigger time of the cron;
when the trigger time set by the cron is reached, a scheduling task is started by using a background scheduler.
The method for acquiring the test result data comprises the following steps:
calling a first url resolving routing method, resolving a url address in the test structure query request, comparing the url address obtained by resolving with a pre-declared url address, and forwarding the test result query request to a first view function if the two url addresses are matched;
and the first view function judges the request mode of the test result query request through the request.
The method for persistently storing the test result data comprises the following steps:
judging the field type in the test result query request by an if method defined in the first view function;
corresponding to each category field, respectively creating a corresponding data model so as to describe each category field;
a table structure corresponding to the data model is established in the database by calling a management.
Calling a create method of the data model to add the test result data to the database table;
calling a save method of the data model to finish the storage of test result data;
optionally, the data model includes: the TestTask data model comprises a TestTask data model used for describing field information of the test task, a TestProject data model used for describing project information corresponding to the test task and a TestReport data model used for describing test result information executed by the test task.
The method for outputting and displaying the aggregation report comprises the following steps:
forwarding the test result query request to a second view function through a second url resolution route;
calling the TestReport data model through a second view function to inquire test result data matched with the test result inquiry request;
rendering the inquired test result data by calling a webpage template;
and displaying the rendered test result data in a test result report form through a network browser.
It should be noted that the webpage template is developed by html language, a link label is defined in the head to designate layui as a front-end display style, and a table label is defined in the body to display query conditions and basic information of a project test report;
optionally, in the embodiment of the present invention, by defining an if method and a for method, information such as test items, a total number of test cases, a number of failed test cases, a number of successful test cases, a success rate of test cases, a mean response time, and test time corresponding to the query condition in the TestReport data model is displayed to the user.
The method for outputting and displaying the aggregation report further comprises the following steps:
a response method of importing echarts.js visualization framework and rewriting the second view function;
and transmitting the data packet of the TestReport data model to a test result query request initiated by echarts.
The embodiment of the invention is realized on the basis of the first embodiment, the characteristics of each method step are further limited, the regression verification of the software system function is realized regularly, the stability of the software system function during version upgrading is ensured, and meanwhile, the test quality conditions of all software projects and all versions can be known through the query and access of a user interaction interface, so that the requirement of company software project management is fully met.
Example three:
the test report display device provided by the embodiment of the invention can execute the test report display method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.
A test report display apparatus, comprising:
the timing task module is used for reading the test configuration file at regular time, formatting the test configuration file into a test result query request and acquiring pre-filled test result data of each test task from the test configuration file;
the data processing module is used for persistently storing the test result data;
the display module is used for generating an aggregation report according to the test result data and outputting and displaying the aggregation report through a user interaction interface;
and the test configuration file is newly built on a test server of the test framework.
The test configuration file is a config.yaml configuration file;
the timing task module comprises:
the scheduling task unit is used for calling a yaml. Importing a json module to format test result data in the config.yaml configuration file; the import requests module assembles the formatted test result data to obtain a test result query request;
and the scheduler is used for starting the scheduling task unit at regular time, reading the test result data in the test configuration file and initiating an interface request to the data processing module.
The embodiment of the invention periodically executes regression verification on the functions of the software system through the timing task module, acquires and persistently stores test result data through the data processing module, generates a multi-dimensional aggregation report through the display module, and provides a front-end interactive page for a user to inquire the test quality conditions of all software projects and all versions, thereby meeting the requirement of company software project management.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The above description is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, several modifications and variations can be made without departing from the technical principle of the present invention, and these modifications and variations should also be regarded as the protection scope of the present invention.

Claims (10)

1. A method for displaying a test report is characterized by comprising the following steps:
reading a test configuration file at regular time;
formatting the test configuration file into a test result query request so as to obtain pre-filled test result data of each test task from the test configuration file;
persistently storing the test result data, and generating an aggregation report according to the test result data;
outputting and displaying the aggregation report through a user interaction interface;
and the test configuration file is newly built on a test server of the test framework.
2. The method for displaying a test report according to claim 1, wherein: the test profile is a config.yaml profile.
3. The method for displaying the test report according to claim 2, wherein formatting the test configuration file into the test result query request is implemented by a scheduling task defined by python, and comprises:
calling a yaml.
Importing a json module to format test result data in the config.yaml configuration file;
and the import requests module assembles the test result data after the formatting processing so as to obtain a test result query request.
4. The method for displaying the test report according to claim 3, wherein the scheduling task is started by a scheduler timing call developed by python, and comprises:
importing an APScheduler module, and calling a background scheduler to add a new background scheduler by a background group scheduler method;
defining an add _ job method to load a scheduling task into a memory as a job, setting a trigger of the job as cron, and assigning a value to the trigger time of the cron;
and when the trigger time set by the cron is reached, starting a scheduling task by using a background scheduler.
5. The method for displaying the test report according to claim 1, wherein the method for acquiring the test result data comprises the following steps:
calling a first url analyzing routing method, and analyzing a url address in the test structure query request; comparing the url address obtained by analysis with the url address which is declared in advance, and if the two url addresses are matched, forwarding the test result query request to the first view function;
and the first view function judges the request mode of the test result query request through the request.
6. The method for displaying a test report according to claim 5, wherein said method for persistently storing said test result data comprises the steps of:
judging the field type in the test result query request by an if method defined in the first view function;
corresponding to each category field, respectively creating a corresponding data model so as to describe each category field;
a table structure corresponding to the data model is established in the database by calling a management.
Calling a create method of the data model to add the test result data to the database table;
calling a save method of the data model to finish the storage of test result data;
the data model includes: the TestTask data model comprises a TestTask data model used for describing field information of the test task, a TestProject data model used for describing project information corresponding to the test task and a TestReport data model used for describing test result information executed by the test task.
7. The method for displaying the test report according to claim 6, wherein the method for displaying the aggregate report is output, and comprises the following steps:
forwarding the test result query request to a second view function through a second url resolution route;
calling the TestReport data model through a second view function to inquire test result data matched with the test result inquiry request;
rendering the inquired test result data by calling a webpage template;
and displaying the rendered test result data in a test result report form through a network browser.
8. The method for displaying a test report according to claim 7, wherein the method for displaying the aggregate report is output, further comprising the steps of:
a response method of importing echarts.js visualization framework and rewriting the second view function;
and transmitting the data packet of the TestReport data model to a test result query request initiated by echarts.
9. An apparatus for displaying a test report, the apparatus comprising:
the timing task module is used for reading the test configuration file at regular time, formatting the test configuration file into a test result query request and acquiring pre-filled test result data of each test task from the test configuration file;
the data processing module is used for persistently storing the test result data;
the display module is used for generating an aggregation report according to the test result data and outputting and displaying the aggregation report through a user interaction interface;
and the test configuration file is newly built on a test server of the test framework.
10. The apparatus for displaying the test report according to claim 9, wherein the test configuration file is config.yaml configuration file;
the timing task module comprises:
the scheduling task unit is used for calling a yaml. Importing a json module to format test result data in the config.yaml configuration file; the import requests module assembles the formatted test result data to obtain a test result query request;
and the scheduler is used for starting the scheduling task unit at regular time, reading the test result data in the test configuration file and initiating an interface request to the data processing module.
CN202210286867.2A 2022-03-23 2022-03-23 Test report display method and device Pending CN114546880A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210286867.2A CN114546880A (en) 2022-03-23 2022-03-23 Test report display method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210286867.2A CN114546880A (en) 2022-03-23 2022-03-23 Test report display method and device

Publications (1)

Publication Number Publication Date
CN114546880A true CN114546880A (en) 2022-05-27

Family

ID=81665868

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210286867.2A Pending CN114546880A (en) 2022-03-23 2022-03-23 Test report display method and device

Country Status (1)

Country Link
CN (1) CN114546880A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016165484A1 (en) * 2015-04-13 2016-10-20 中兴通讯股份有限公司 Server testing method, test server, and server to be tested
CN107590044A (en) * 2017-09-15 2018-01-16 郑州云海信息技术有限公司 A kind of method of testing, device and the equipment of distributed storage cluster
CN109344053A (en) * 2018-09-03 2019-02-15 平安科技(深圳)有限公司 Interface coverage test method, system, computer equipment and storage medium
CN113778847A (en) * 2020-12-03 2021-12-10 北京沃东天骏信息技术有限公司 Test report generation method and device
US20220066916A1 (en) * 2020-08-26 2022-03-03 Spirent Communications, Inc. Mapping test parameter data elements during heterogeneous component-based testing in a portable automation framework in both api mode and ui mode

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016165484A1 (en) * 2015-04-13 2016-10-20 中兴通讯股份有限公司 Server testing method, test server, and server to be tested
CN107590044A (en) * 2017-09-15 2018-01-16 郑州云海信息技术有限公司 A kind of method of testing, device and the equipment of distributed storage cluster
CN109344053A (en) * 2018-09-03 2019-02-15 平安科技(深圳)有限公司 Interface coverage test method, system, computer equipment and storage medium
US20220066916A1 (en) * 2020-08-26 2022-03-03 Spirent Communications, Inc. Mapping test parameter data elements during heterogeneous component-based testing in a portable automation framework in both api mode and ui mode
CN113778847A (en) * 2020-12-03 2021-12-10 北京沃东天骏信息技术有限公司 Test report generation method and device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
刘淑平;江依诺;杨俊伟;: "基于云计算的电力软件测试技术研究", 电力信息与通信技术, no. 03, 15 March 2018 (2018-03-15) *

Similar Documents

Publication Publication Date Title
CN104866599B (en) The production method and system of Visual Report Forms
CN112286806A (en) Automatic testing method and device, storage medium and electronic equipment
CN108874558B (en) Message subscription method of distributed transaction, electronic device and readable storage medium
CN111553137B (en) Report generation method and device, storage medium and computer equipment
CN109815119B (en) APP link channel testing method and device
CN113448862B (en) Software version testing method and device and computer equipment
CN110244934B (en) Method and device for generating product demand document and test information
CN111240981A (en) Interface testing method, system and platform
CN111192089A (en) A method, device and computer system for generating electronic coupons
CN110198327B (en) Data transmission method and related equipment
US10579915B2 (en) Method and device for initializing two-dimensional code
CN115328997B (en) Data synchronization method, system, device and storage medium
CN112182089B (en) Report generation method, device and equipment based on data warehouse model
CN117009219A (en) Whole-course data verification method and system based on priority ordering
CN114546534B (en) Application page starting method, device, equipment and medium
CN115292418A (en) Cross-system business process automatic processing method and system
CN111367982A (en) Method and device for importing TRIRIGA basic data, computer equipment and storage medium
CN114546880A (en) Test report display method and device
CN114691519B (en) Interface automated testing method, device, equipment and storage medium
CN115061785B (en) Information sending method, device, storage medium and server
CN111367500A (en) Data processing method and device
CN106570004B (en) Data management method and device
CN112445811A (en) Data service method, device, storage medium and component based on SQL configuration
CN113724808A (en) Medical survey questionnaire generation method and device, electronic equipment and storage medium
CN112560938A (en) Model training method and device and computer equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination