Plug-in automatic report generation system
Through the plug-in automated report generation system, the test data and report templates are decoupled, and the independent plug-in and standard interface connection of the report template is realized, solving the development difficulty and code stability problems caused by the modification of report templates in the existing system, and improving the Development efficiency and system flexibility.
Patent Information
- Application Number
- CN202411451055.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-17
- Publication Date
- 2025-02-11
AI Technical Summary
In the existing automated test report generation system, the test data is deeply coupled with the report template, resulting in a large number of modifications to the automation tools when adding or modifying the report template, which increases the difficulty of development and may damage the stability and maintainability of the code.
It adopts a plug-in automated report generation system, and provides test report plug-in installation, uninstallation and generation interfaces through a web back-end server, allowing each report template to be connected to the test system as an independent plug-in through a standard interface to achieve the decoupling of test data and report templates.
It reduces the complexity and risks of secondary development, so that new or modified report templates do not need to touch the core testing logic, supports rapid response to changes in customer needs, and improves the flexibility and adaptability of the automated testing process.
Smart Images

Figure CN119415330A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of automated testing, in particular to automated report generation, and specifically refers to a plug-in automated report generation system. Background Art
[0002] As the complexity of electronic product hardware and software systems increases dramatically, the number of test points for signal testing and other tasks increases dramatically. Traditional manual testing and report compilation methods are cumbersome and error-prone, and can no longer meet current efficiency and accuracy requirements. The introduction of automated testing tools has become the key to alleviating this dilemma. However, if reports still need to be generated manually after automated testing is completed, the value of the automated process is greatly reduced.
[0003] Faced with this challenge, the adoption of automated report generation technology has become particularly urgent. For OEMs with many customers, each customer may have its own unique report template requirements, which further increases the complexity of automated reporting. Traditional automation tools often tightly bind report templates to test execution. Each new report template means a lot of modifications to the automation tool and the introduction of complex branching logic, which not only increases the difficulty of development, but may also undermine the stability and maintainability of existing code.
[0004] Therefore, the existing automated test report generation exposes the following defects:
[0005] Deep coupling between test data and report templates: In traditional methods, automated testing tools often hard-code test data directly into the report generation logic. Whenever a new report template is added or changed, developers need to deeply analyze the original logic and adapt the new template by adding complex conditional branches. This is not only costly, but also easy to introduce errors, affecting the stability of the existing template.
[0006] Inability to perform incremental updates: Traditional automation tools require the entire tool to be redeployed after the code for generating a new report template is updated, which has a significant impact on the use of the tool. Summary of the invention
[0007] The purpose of the present invention is to overcome the above-mentioned shortcomings of the prior art and provide a plug-in automatic report generation system.
[0008] In order to achieve the above object, the plug-in automatic report generation system of the present invention is as follows:
[0009] The main features of the plug-in automatic report generation system are that the system includes:
[0010] The automated testing tool is deployed on the PC side where the business is executed. It is used to execute specific test cases and submit the test result data in JSON format to the interface of the backend server after the test case is executed or during the execution process.
[0011] The Web backend server has a test report plug-in installation interface, a plug-in uninstallation interface, and a report generation interface, which are used to process the received test data and generate a test report according to the corresponding test report plug-in;
[0012] Web front-end server, connected to the automated testing tool, used to provide static files to the user's browser for reference, including html, css, javascript pages;
[0013] A database server, connected to the Web back-end server, for storing plug-in information and test data information of relevant reports;
[0014] The MQTT Broker / Websocket agent is connected to the Web backend server and is used to provide a coordination agent for the automated testing tool, the Web backend server, and the Web front-end server, and distribute messages of specific topics to various subscribers.
[0015] Preferably, the test report plug-in installation interface specifically performs the following processing:
[0016] Processing the compressed package of the report plug-in transmitted by the Web front-end server, determining whether the received file is a compressed package, and if it is not a compressed package, directly returning a status and error message notifying the Web front-end server of the failure of installation in HTTP; if it is a compressed package, decompressing the received compressed package, and if the decompression fails, deleting all files in the decompressed path, and directly returning a status and error message notifying the Web front-end server of the failure of installation in HTTP;
[0017] A background task is added, and the processing result is returned to the Web front-end server and the Web back-end server in HTTP mode.
[0018] Preferably, the decompression method of the test report plug-in installation interface is:
[0019] (a1) First, the unzipped directory will be searched to see if it contains a target naming document. If so, all third-party libraries will be installed in place through pip-rrequirements.txt;
[0020] (b1) Next, all files in the decompressed directory are traversed. If the file ends with .py or .pyc, try to dynamically import the file through imp. If the import is successful, determine whether the imported module contains: the short name of the template, the template name, the short name of the template language, the language name, the test module name, the write_report function, and whether it needs to rely on the template file.
[0021] (c1) storing template files that meet the requirements according to preset rules;
[0022] (d1) Clear the dynamically imported modules, and then notify the installation of this plug-in through MQTT or Websocket.
[0023] Preferably, the plug-in uninstallation interface specifically performs the following processing:
[0024] Receive the plugin_id transmitted from the Web front-end server, query the plugin information of the plugin_id from the database server, delete the code in the queried code path, delete the template under the queried template path, and delete the information in the plugin information table in the database server; then return the front-end result; and notify the deletion of this plugin in the form of MQTT or Websocket.
[0025] Preferably, the report generation interface specifically performs the following processing:
[0026] (a2) receiving data transmitted by the Web front-end server, including: test modules, languages and test templates;
[0027] (b2) determining whether the test module is empty; if it is empty, first obtaining all the test case IDs that have been tested in the test data table, and then determining the modules corresponding to the corresponding test cases according to the test case IDs;
[0028] (c2) Remove duplicates to obtain a list of test modules and traverse it;
[0029] (d2) The test plug-in table is then queried through the three parameter combinations of the test module, language and test template to find the path where the plug-in code for executing and generating the report is located, the module is dynamically imported, and the function for generating the corresponding report is executed.
[0030] Preferably, the Web front-end server specifically performs the following processing:
[0031] (a3) When the user makes a request, the server transmits the static file to the browser. After the browser completes the rendering, it loads the corresponding data in the background according to the control logic of Javascript;
[0032] (b3) Provide a plug-in installation button. After clicking the button, select the compressed package to be uploaded;
[0033] (c3) After the selection is completed, the Web front-end server uploads the compressed package to the Web back-end server and opens a dialog box containing a text area. At the same time, the installation log topic of MQTT or Websocket is subscribed;
[0034] (d3) Filter the corresponding topic information in the onmessage function of MQTT or Websocket, and display the received log information in the text area of the dialog box. After the installation is completed, close the dialog box.
[0035] Preferably, the Web front-end server also includes:
[0036] After the installation is complete, the front end will display the basic information of all installed plug-ins. If the plug-in is marked as a default built-in plug-in, there will be no uninstall button for the plug-in; if the plug-in is installed by the user, an uninstall button will be displayed; by clicking the uninstall button, a request will be submitted, which contains the ID of the plug-in so that the Web back-end server can uninstall the corresponding plug-in.
[0037] Preferably, the Web front-end server also includes:
[0038] The front end will provide a Generate Report button on each task interface. After clicking the button, a dialog box will appear. The dialog box includes report template selection, language selection, and test module selection. The report template selection drop-down box and language drop-down box must be selected.
[0039] Preferably, the Web front-end server also includes:
[0040] The front end will subscribe to the topic of plugin installation of MQTT or Websocket; when the web backend server pushes the newly installed plugin through this topic, the options of the template selection drop-down box, the template selection drop-down box amount options and the test module drop-down box options are directly updated, and the newly installed plugin options can be obtained without the user re-requesting;
[0041] And plug-in development guidance is provided on the front-end interface.
[0042] Preferably, the system further comprises an internal network, and the internal network is used as a carrier for the automated testing tool, the Web back-end server, and the Web front-end server to transmit messages to each other.
[0043] The plug-in automated report generation system of the present invention is adopted to realize the decoupling of test data and report templates by constructing a flexible and configurable report generation framework. A modular design is adopted, and each report template is used as an independent plug-in, which is seamlessly connected to the test system through a standard interface, so that the core test logic does not need to be touched when adding or modifying the report template, which greatly reduces the complexity and risk of secondary development. At the same time, the architecture of the present invention also supports rapid response to changes in customer needs, effectively improving the flexibility and adaptability of the automated testing process. It innovatively integrates cutting-edge technologies such as Web services, database interactions, automated report generation, and MQTT, websocket communications, aiming to solve the problem of deep binding of data and code in the field of automated testing due to the diversification of report templates, thereby significantly improving the efficiency and quality of secondary development; it not only greatly accelerates the development process of automated report generation for hardware testing, but also has high scalability and stability. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] Figure 1 It is a schematic diagram of the structure of the plug-in automatic report generation system of the present invention. DETAILED DESCRIPTION
[0045] In order to more clearly describe the technical content of the present invention, further description is given below in conjunction with specific embodiments.
[0046] Before describing in detail embodiments according to the present invention, it should be noted that, hereinafter, the terms "comprises", "includes" or any other variations are intended to cover non-exclusive inclusion, whereby a process, method, article or apparatus comprising a series of elements includes not only these elements, but also other elements not explicitly listed or inherent to such process, method, article or apparatus.
[0047] See also Figure 1 As shown, the plug-in automatic report generation system, wherein the system includes:
[0048] The automated testing tool is deployed on the PC side where the business is executed. It is used to execute specific test cases and submit the test result data in JSON format to the interface of the backend server after the test case is executed or during the execution process.
[0049] The Web backend server has a test report plug-in installation interface, a plug-in uninstallation interface, and a report generation interface, which are used to process the received test data and generate a test report according to the corresponding test report plug-in;
[0050] Web front-end server, connected to the automated testing tool, used to provide static files to the user's browser for reference, including html, css, javascript pages;
[0051] A database server, connected to the Web back-end server, for storing plug-in information and test data information of relevant reports;
[0052] The MQTT Broker / Websocket agent is connected to the Web backend server and is used to provide a coordination agent for the automated testing tool, the Web backend server, and the Web front-end server, and distribute messages of specific topics to various subscribers.
[0053] As a preferred embodiment of the present invention, the test report plug-in installation interface specifically performs the following processing:
[0054] Processing the compressed package of the report plug-in transmitted by the Web front-end server, determining whether the received file is a compressed package, and if it is not a compressed package, directly returning a status and error message notifying the Web front-end server of the failure of installation in HTTP; if it is a compressed package, decompressing the received compressed package, and if the decompression fails, deleting all files in the decompressed path, and directly returning a status and error message notifying the Web front-end server of the failure of installation in HTTP;
[0055] A background task is added, and the processing result is returned to the Web front-end server and the Web back-end server in HTTP mode.
[0056] As a preferred embodiment of the present invention, the decompression method of the test report plug-in installation interface is:
[0057] (a1) First, the unzipped directory will be searched to see if it contains a target naming document. If so, all third-party libraries will be installed in place through pip-rrequirements.txt;
[0058] (b1) Next, all files in the decompressed directory are traversed. If the file ends with .py or .pyc, try to dynamically import the file through imp. If the import is successful, determine whether the imported module contains: the short name of the template, the template name, the short name of the template language, the language name, the test module name, the write_report function, and whether it needs to rely on the template file.
[0059] (c1) storing template files that meet the requirements according to preset rules;
[0060] (d1) Clear the dynamically imported modules, and then notify the installation of this plug-in through MQTT or Websocket.
[0061] As a preferred embodiment of the present invention, the plug-in uninstallation interface specifically performs the following processing:
[0062] Receive the plugin_id transmitted from the Web front-end server, query the plugin information of the plugin_id from the database server, delete the code in the queried code path, delete the template under the queried template path, and delete the information in the plugin information table in the database server; then return the front-end result; and notify the deletion of this plugin in the form of MQTT or Websocket.
[0063] As a preferred embodiment of the present invention, the report generation interface specifically performs the following processing:
[0064] (a2) receiving data transmitted by the Web front-end server, including: test modules, languages and test templates;
[0065] (b2) determining whether the test module is empty; if it is empty, first obtaining all the test case IDs that have been tested in the test data table, and then determining the modules corresponding to the corresponding test cases according to the test case IDs;
[0066] (c2) Remove duplicates to obtain a list of test modules and traverse it;
[0067] (d2) The test plug-in table is then queried through the three parameter combinations of the test module, language and test template to find the path where the plug-in code for executing and generating the report is located, the module is dynamically imported, and the function for generating the corresponding report is executed.
[0068] As a preferred embodiment of the present invention, the Web front-end server specifically performs the following processing:
[0069] (a3) When the user makes a request, the server transmits the static file to the browser. After the browser completes the rendering, it loads the corresponding data in the background according to the control logic of Javascript;
[0070] (b3) Provide a plug-in installation button. After clicking the button, select the compressed package to be uploaded;
[0071] (c3) After the selection is completed, the Web front-end server uploads the compressed package to the Web back-end server and opens a dialog box containing a text area. At the same time, the installation log topic of MQTT or Websocket is subscribed;
[0072] (d3) Filter the corresponding topic information in the onmessage function of MQTT or Websocket, and display the received log information in the text area of the dialog box. After the installation is completed, close the dialog box.
[0073] As a preferred embodiment of the present invention, the Web front-end server further includes:
[0074] After the installation is complete, the front end will display the basic information of all installed plug-ins. If the plug-in is marked as a default built-in plug-in, there will be no uninstall button for the plug-in; if the plug-in is installed by the user, an uninstall button will be displayed; by clicking the uninstall button, a request will be submitted, which contains the ID of the plug-in so that the Web back-end server can uninstall the corresponding plug-in.
[0075] As a preferred embodiment of the present invention, the Web front-end server further includes:
[0076] The front end will provide a Generate Report button on each task interface. After clicking the button, a dialog box will appear. The dialog box includes report template selection, language selection, and test module selection. The report template selection drop-down box and language drop-down box must be selected.
[0077] As a preferred embodiment of the present invention, the Web front-end server further includes:
[0078] The front end will subscribe to the topic of plugin installation of MQTT or Websocket; when the web backend server pushes the newly installed plugin through this topic, the options of the template selection drop-down box, the template selection drop-down box amount options and the test module drop-down box options are directly updated, and the newly installed plugin options can be obtained without the user re-requesting;
[0079] And plug-in development guidance is provided on the front-end interface.
[0080] As a preferred embodiment of the present invention, the system further comprises an internal network, and the internal network is used as a carrier for transmitting messages between the automated testing tool, the Web back-end server and the Web front-end server.
[0081] The system described in the present invention consists of 6 parts: automation tools, web backend server, database server, MQTT Broker agent, web front-end server, and internal network. The following will describe each functional module in detail:
[0082] 1. Automation Tools
[0083] A tool for executing specific test cases, deployed on the PC where the business is executed, submits the test result data in JSON format to the interface of the backend server after the test case is executed or during the execution.
[0084] 2. Web backend server
[0085] Test data processing: After receiving the test data submitted by the automation tool, the Web backend server writes the test data into the database.
[0086] Test report plug-in installation interface: process the compressed package of the report plug-in submitted by the front end, determine whether the received file is a compressed package, and if it is not, directly return the status and error information of the failed installation to the front end via HTTP; decompress the received compressed package, and if the decompression fails, delete all files in the decompressed path, and then directly return the status and error information of the failed installation to the front end via HTTP; in order to avoid the front end being stuck due to the long interface response rate, after processing the above two steps, add a background task, and then directly return the processing results of the back end to the front end via HTTP;
[0087] In the report plugin installation background task function, first, it will look for a requirements.txt document in the unzipped directory (the document name can be arbitrary). If this document exists, all third-party libraries will be installed in place through pip-rrequirements.txt. Next, it will traverse all the files under the unzipped directory. If it ends with .py or .pyc, it will try to dynamically import this file through imp. If the import is successful, it will determine whether the imported module contains: 1) A short name of the TPL_SHORT_NAME template. Subsequent judgments will be based on this variable; it is represented by a few English letters that can express meaning; 2) TPL_NAME template name, which defines a Chinese name for the template. It is displayed on the page for easy identification; 3) TPL_LANG_SHORT_NAME is the short name of the template language; subsequent judgments on the report language are based on this variable; it is represented by a few English letters that can express meaning; 4) TPL_LANG language name, defines a Chinese name for the template, mainly displayed on the page for easy identification; 5) TPL_MODULE test module name, represented by a few English letters that can express meaning; 6) Determine whether the module contains the write_report function, if not, directly determine the next file; 7) Determine whether the module contains TPL_FILE_NAME, this variable definition is used to indicate that this code file needs to rely on a template file when generating code, and all subsequent operations are writing this template file. Therefore, this template file needs to be stored permanently in a path, and it should be stored with the name {test module short name}_{test template short name}_{language short name}_{original file name}; the imported verification code should also be moved to a specific directory for saving, and the name should follow the rule of {test module short name}_{test template short name}_{language short name} when saving; the test module, template path, language short name (a small number of English letters), report template short name (a small number of English letters), report template, language description, code path, and whether it is a built-in plug-in (default is no) should be written into the data table; then the dynamically imported module should be cleared; then the plug-in is notified via MQTT or Websocket that it has been installed; during the execution of this function, the logs of each step currently executed will be notified to the front end via MQTT or websocket; the naming of the above variables can be meaningful, and does not necessarily follow the above naming rules;
[0088] Plugin uninstallation interface: receives plugin_id sent from the front end, queries the plugin information of the plugin_id from the database; deletes the code in the queried code path, deletes the template under the queried template path, and deletes the information in the plugin information table in the database; returns the front end result; and then notifies the plugin to be deleted via MQTT or Websocket;
[0089] Report generation interface: Receive data transmitted from the front end: test_module (test module), language (language) and tpl (test template); first determine whether test_module is empty; if it is empty, first obtain all the testcase_ids that have been tested in the test data table; then obtain which modules the test cases with these IDs belong to based on these test case IDs, remove duplicates and get a list of test modules; then traverse this list; query the test plug-in table through the combination of test_module (test module), language (language) and tpl (test template) parameters to find the path of the plug-in code that executes report generation; dynamically import this module, and then execute the report generation function in it;
[0090] The functions for querying the data required for the report are defined in the backend web framework so that they can be used in the report plug-in. This is to avoid exposing the relevant parameters of the server database during the plug-in development process and improve the security of the overall system.
[0091] The backend provides a compressed package of plug-in development samples for the frontend to download.
[0092] 3. Web front-end server
[0093] It mainly provides static files, html, css, and javascript pages to the user's browser. When the user requests, the server transmits the static files to the browser. After the browser completes rendering, it loads data in the background according to the control logic in Javascript. It provides a plug-in installation button. After clicking the button, it will let you choose which compressed package to upload. After the selection is completed, the front end will upload the compressed package to the back end and open a dialog box. The dialog box will contain a text area and subscribe to the installation log topic of MQTT or Websocket. The topic information is filtered in the onmessage function of MQTT or Websocket. Then the received log information is displayed in the text box in the dialog box. After the installation is completed, the dialog box is closed.
[0094] The front end displays the basic information of all installed plug-ins. If the plug-in is marked as a default built-in plug-in, there is no uninstall button for the plug-in. If the plug-in is installed by the user, an uninstall button will be displayed. After clicking the uninstall button, a request will be submitted. The request contains the ID of the plug-in to notify the back end which plug-in to uninstall.
[0095] There is a button to generate a report on each task interface in the front end. After clicking the button, a dialog box will appear. The dialog box will include the report template selection, language selection, and test module selection. The report template selection drop-down box and the language selection drop-down box must be selected, and the test module drop-down box can be left unselected.
[0096] The front-end will subscribe to the topic of plugin installation of MQTT or Websocket; when the back-end pushes the newly installed plugin through this topic, it will directly update the options in the template selection drop-down box; it will directly update the options in the test module drop-down box, so that users can get the newly installed plugin options without re-requesting;
[0097] The front-end interface will provide plug-in development guidance to help developers understand the usage of each back-end function.
[0098] 4. Database Server
[0099] Database, the server where the database for storing plug-in information, test data information, etc. is located.
[0100] 5. MQTT Broker\Websocket proxy
[0101] It acts as a coordination agent. Automation tools, web front-end, web back-end and other services will connect to this proxy service through MQTT\Websocket; it distributes messages of specific topics to various subscribers.
[0102] 6. Internal Network
[0103] The carrier of the message; the transmission of messages between the above modules must be transmitted through the internal network, so the network must be stable.
[0104] In practical application, the beneficial effects of this technical solution are as follows:
[0105] 1. Standardized storage of test data: Automated test data is carefully designed and stored in the database, following a unified format standard, thus achieving complete decoupling between code and data. This measure not only improves the flexibility of data management, but also enhances the scalability of the system.
[0106] 2. Persistent storage ensures data reusability: Test data is safely stored through a persistent storage mechanism. Even if the current system has not yet integrated a report generation plug-in for a specific client, it will be easy to use newly developed plug-ins to seamlessly import historical test reports in the future. This feature ensures the long-term value and reuse potential of data resources.
[0107] 3. Dynamic modular report generation mechanism: We use advanced modular architecture to support report generation with different templates. Each module operates independently, and functional integration is achieved through a dynamic call mechanism, ensuring complete isolation between modules. This design reduces the interdependence between modules, so that modifying any module will not affect other modules, greatly simplifying the logical structure, reducing the complexity of the code, and significantly improving the maintainability and scalability of the code.
[0108] 4. Seamless plug-in installation experience: For system administrators, the plug-in installation process has become easier and faster than ever before. Administrators can easily install new plug-ins without interrupting server operation or performing tedious redeployment, and this process has no impact on the report generation tasks of other users of the system, ensuring high system availability and continuity of user experience.
[0109] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code that includes one or more executable instructions for implementing the steps of a specific logical function or process, and the scope of the preferred embodiments of the present invention includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by those skilled in the art to which the embodiments of the present invention belong.
[0110] It should be understood that each part of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution device.
[0111] A person of ordinary skill in the art may understand that all or part of the steps of the method for implementing the above-mentioned embodiment may be completed by instructing the relevant hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one of the steps of the method embodiment or a combination thereof.
[0112] The storage medium mentioned above can be a read-only memory, a magnetic disk or an optical disk, etc.
[0113] In the description of this specification, the description with reference to the terms "an embodiment", "some embodiments", "example", "specific example", or "embodiment" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.
[0114] Although the embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present invention. A person skilled in the art may change, modify, replace and vary the above embodiments within the scope of the present invention.
[0115] The plug-in automated report generation system of the present invention is adopted to realize the decoupling of test data and report templates by constructing a flexible and configurable report generation framework. A modular design is adopted, and each report template is used as an independent plug-in, which is seamlessly connected to the test system through a standard interface, so that the core test logic does not need to be touched when adding or modifying the report template, which greatly reduces the complexity and risk of secondary development. At the same time, the architecture of the present invention also supports rapid response to changes in customer needs, effectively improving the flexibility and adaptability of the automated testing process. It innovatively integrates cutting-edge technologies such as Web services, database interactions, automated report generation, and MQTT, websocket communications, aiming to solve the problem of deep binding of data and code in the field of automated testing due to the diversification of report templates, thereby significantly improving the efficiency and quality of secondary development; it not only greatly accelerates the development process of automated report generation for hardware testing, but also has high scalability and stability.
[0116] In this specification, the present invention has been described with reference to specific embodiments thereof. However, it is apparent that various modifications and variations may be made without departing from the spirit and scope of the present invention. Therefore, the specification and drawings should be regarded as illustrative rather than restrictive.
Claims
1. A plug-in automated report generation system, characterized in that: The system comprises: The automated testing tool is deployed on the PC side where the business is executed. It is used to execute specific test cases and submit the test result data in JSON format to the interface of the backend server after the test case is executed or during the execution process. The Web backend server has a test report plug-in installation interface, a plug-in uninstallation interface, and a report generation interface, which are used to process the received test data and generate a test report according to the corresponding test report plug-in; Web front-end server, connected to the automated testing tool, used to provide static files to the user's browser for reference, including html, css, javascript pages; A database server, connected to the Web back-end server, for storing plug-in information and test data information of relevant reports; The MQTT Broker / Websocket agent is connected to the Web backend server and is used to provide a coordination agent for the automated testing tool, the Web backend server, and the Web front-end server, and distribute messages of specific topics to various subscribers.
2. The plug-in automated report generation system according to claim 1, characterized in that: The test report plug-in installation interface specifically performs the following processing: Processing the compressed package of the report plug-in transmitted by the Web front-end server, determining whether the received file is a compressed package, and if it is not a compressed package, directly returning a status and error message notifying the Web front-end server of the failure of installation in HTTP; if it is a compressed package, decompressing the received compressed package, and if the decompression fails, deleting all files in the decompressed path, and directly returning a status and error message notifying the Web front-end server of the failure of installation in HTTP; A background task is added, and the processing result is returned to the Web front-end server and the Web back-end server in HTTP mode.
3. The plug-in automated report generation system according to claim 2, characterized in that: The decompression method of the test report plug-in installation interface is: (a1) First, the unzipped directory will be searched to see if it contains a target naming document. If so, all third-party libraries will be installed in place through pip-rrequirements.txt; (b1) Next, all files in the decompressed directory are traversed. If the file ends with .py or .pyc, try to dynamically import the file through imp. If the import is successful, determine whether the imported module contains: the short name of the template, the template name, the short name of the template language, the language name, the test module name, the write_report function, and whether it needs to rely on the template file. (c1) storing template files that meet the requirements according to preset rules; (d1) Clear the dynamically imported modules, and then notify the installation of this plug-in through MQTT or Websocket.
4. The plug-in automated report generation system according to claim 1, characterized in that: The plug-in uninstallation interface specifically performs the following processing: Receive the plugin_id transmitted from the Web front-end server, query the plugin information of the plugin_id from the database server, delete the code in the queried code path, delete the template under the queried template path, and delete the information in the plugin information table in the database server; Then return the front-end results; And notify this plug-in to delete via MQTT or Websocket.
5. The plug-in automated report generation system according to claim 3, characterized in that: The report generation interface specifically performs the following processing: (a2) receiving data transmitted by the Web front-end server, including: test modules, languages and test templates; (b2) determining whether the test module is empty; if it is empty, first obtaining all the test case IDs that have been tested in the test data table, and then determining the modules corresponding to the corresponding test cases according to the test case IDs; (c2) Remove duplicates to obtain a list of test modules and traverse it; (d2) The test plug-in table is then queried through the three parameter combinations of the test module, language and test template to find the path where the plug-in code for executing and generating the report is located, the module is dynamically imported, and the function for generating the corresponding report is executed.
6. The plug-in automated report generation system according to claim 3, characterized in that: The Web front-end server specifically performs the following processing: (a3) When the user makes a request, the server transmits the static file to the browser. After the browser completes the rendering, it loads the corresponding data in the background according to the control logic of Javascript; (b3) Provide a plug-in installation button. After clicking the button, select the compressed package to be uploaded; (c3) After the selection is completed, the Web front-end server uploads the compressed package to the Web back-end server and opens a dialog box containing a text area. At the same time, the installation log topic of MQTT or Websocket is subscribed; (d3) Filter the corresponding topic information in the onmessage function of MQTT or Websocket, and display the received log information in the text area of the dialog box. After the installation is completed, close the dialog box.
7. The plug-in automated report generation system according to claim 6, characterized in that: The Web front-end server also includes: After the installation is complete, the front end will display the basic information of all installed plug-ins. If the plug-in is marked as a default built-in plug-in, there will be no uninstall button for the plug-in; if the plug-in is installed by the user, an uninstall button will be displayed; by clicking the uninstall button, a request will be submitted, which contains the ID of the plug-in so that the Web back-end server can uninstall the corresponding plug-in.
8. The plug-in automated report generation system according to claim 6, characterized in that: The Web front-end server also includes: The front end will provide a Generate Report button on each task interface. After clicking the button, a dialog box will appear. The dialog box includes report template selection, language selection, and test module selection. The report template selection drop-down box and language drop-down box must be selected.
9. The plug-in automated report generation system according to claim 6, characterized in that: The Web front-end server also includes: The front end will subscribe to the topic of plugin installation of MQTT or Websocket; when the web backend server pushes the newly installed plugin through this topic, the options of the template selection drop-down box, the template selection drop-down box amount options and the test module drop-down box options are directly updated, and the newly installed plugin options can be obtained without the user re-requesting; And plug-in development guidance is provided on the front-end interface.
10. The plug-in automated report generation system according to claim 1, characterized in that: The system also includes an internal network, which is used as a carrier for the automated testing tool, the Web back-end server, and the Web front-end server to transmit messages to each other.