Method and device for obtaining test results, electronic device and storage medium
By accessing pre-configured interfaces and UI automation tools, the test return values are obtained and compared, which solves the problem that existing tools cannot verify the creation of underlying resources in the Linux system, and achieves accurate test result acquisition and verification.
Patent Information
- Application Number
- CN202011608571.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-30
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2040-12-30
AI Technical Summary
Existing automated testing tools cannot obtain the test results of whether the underlying resources of the Linux system (such as k8s, Ceph, apache, mysql, etc.) are successfully created, making it impossible to verify the resource creation status.
By accessing the pre-configured interface, the automated deployment tool page is triggered to open, where test tasks are created and executed, and the test return value obtained through the UI automation tool is compared with the expected return value to determine the test result.
It realizes obtaining the test results of whether the underlying resources of the Linux system are successfully created, solves the problem that existing tools cannot verify the resource creation, and improves the testing efficiency and accuracy.
Smart Images

Figure CN112597051B
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of software testing, and in particular to a method and device for obtaining test results, an electronic device, and a storage medium. Background Art
[0002] Software automation testing exists in contrast to manual testing. Testers perform tests step by step according to the procedures described in the test cases to obtain a comparison between the actual results and the expected results. Compared with manual testing, the use of automated software testing methods saves manpower, time or hardware resources and has high testing efficiency. In the prior art, when testing the underlying resources of the Linux system, the test results cannot be obtained using the existing automated testing tools, resulting in the inability to verify whether the underlying resources of the Linux system (k8s, Ceph, apache, mysql, etc.) are successfully created. Summary of the invention
[0003] The present disclosure provides a method and device for obtaining test results, an electronic device and a storage medium, which can obtain test results, especially test results for verifying whether the underlying resource creation of a Linux system is successful.
[0004] According to a first aspect of the present disclosure, there is provided a method for obtaining a test result, comprising:
[0005] Accessing a pre-configured interface, triggering the opening of an automated deployment tool page when accessed, and creating and automatically executing a test task in the automated deployment tool page;
[0006] Obtain the test return value through the interface;
[0007] The test result corresponding to the test task is determined by comparing the test return value with the expected return value, and the expected return value includes the expected result information corresponding to the test task.
[0008] In some possible implementations, the interface is developed using a UI automation tool, and when accessed, the UI automation program in the interface is used to trigger the opening of an automation deployment tool page, and to create and execute test tasks in the automation deployment tool page; the UI automation program contains business logic for executing tests.
[0009] In some possible implementations, obtaining the test return value through the interface includes:
[0010] Locate and obtain output information in the page of the automated deployment tool through the UI automation program in the interface;
[0011] The output information is obtained through the interface as a test return value.
[0012] In some possible implementations, the number of the interfaces is multiple;
[0013] The UI automation programs in different interfaces execute different business logics and are used to create and execute different test tasks.
[0014] In some possible implementations, comparing the test return value with the expected return value to determine the test result corresponding to the test task further includes:
[0015] In response to whether the test return value is consistent with the expected return value, the test result is determined to be success or failure.
[0016] According to a second aspect of the present disclosure, there is provided a device for obtaining a test result, comprising:
[0017] A trigger module, used to trigger the opening of an automated deployment tool page when a pre-configured interface is accessed, and to create and automatically execute a test task in the automated deployment tool page;
[0018] A return module, used to obtain the test return value through the interface;
[0019] A comparison module is used to determine the test result of the test task by comparing the test return value with the expected return value, wherein the expected return value includes the expected result information corresponding to the test task.
[0020] In some possible implementations, the interface is developed using a UI automation tool;
[0021] The trigger module is also used to trigger the opening of the automation deployment tool page through the UI automation program in the interface when accessed, and to create and automatically execute test tasks in the automation deployment tool page; the business logic for executing the test is written in the UI automation program.
[0022] In some possible implementations, the return module is further used to locate and obtain output information in the page of the automated deployment tool through a UI automation program in the interface; and then obtain the output information through the interface as a test return value.
[0023] According to a third aspect of the present disclosure, there is provided an electronic device, comprising:
[0024] processor;
[0025] a memory for storing processor-executable instructions;
[0026] The processor is configured to call instructions stored in the memory to execute the method described in any one of the first aspects.
[0027] According to a fourth aspect of the present disclosure, a computer-readable storage medium is provided, on which computer program instructions are stored, and when the computer program instructions are executed by a processor, the method described in any one of the first aspects is implemented.
[0028] In the disclosed embodiment, the created interface can be accessed by the program testing tool, and the test task can be created and executed in the automated deployment tool page by accessing the interface, and the test return value can be obtained through the interface; the test return value is then compared with the expected return value to determine the test result corresponding to the test task. The disclosed embodiment can obtain the test result, especially the test result that verifies whether the underlying resource creation of the Linux system is successful.
[0029] It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
[0030] Further features and aspects of the present disclosure will become apparent from the following detailed description of exemplary embodiments with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] The drawings herein are incorporated into the specification and constitute a part of the specification. These drawings illustrate embodiments consistent with the present disclosure and are used to illustrate the technical solutions of the present disclosure together with the specification.
[0032] Figure 1 A flow chart showing a method for obtaining test results according to an embodiment of the present disclosure;
[0033] Figure 2 A flowchart showing step S20 in the method for obtaining test results according to an embodiment of the present disclosure;
[0034] Figure 3 A block diagram showing a device for obtaining test results according to an embodiment of the present disclosure is shown;
[0035] Figure 4 A block diagram of an electronic device according to an embodiment of the present disclosure is shown;
[0036] Figure 5 A block diagram of another electronic device according to an embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0037] Various exemplary embodiments, features and aspects of the present disclosure will be described in detail below with reference to the accompanying drawings. The same reference numerals in the accompanying drawings represent elements with the same or similar functions. Although various aspects of the embodiments are shown in the accompanying drawings, the drawings are not necessarily drawn to scale unless otherwise specified.
[0038] The word “exemplary” is used exclusively herein to mean “serving as an example, example, or illustration.” Any embodiment described herein as “exemplary” is not necessarily to be construed as preferred or advantageous over other embodiments.
[0039] The term "and / or" herein is only a description of the association relationship of the associated objects, indicating that there may be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the term "at least one" herein represents any combination of at least two of any one or more of a plurality of. For example, including at least one of A, B, and C can represent including any one or more elements selected from the set consisting of A, B, and C.
[0040] In addition, in order to better illustrate the present disclosure, numerous specific details are given in the following specific embodiments. It should be understood by those skilled in the art that the present disclosure can also be implemented without certain specific details. In some examples, methods, means, components and circuits well known to those skilled in the art are not described in detail in order to highlight the subject matter of the present disclosure.
[0041] The execution subject of the method for obtaining the test result can be any device that can be used for testing, for example, the method can be executed by a terminal device or a server or other processing device, wherein the terminal device can be a user equipment (UE), a mobile device, a user terminal, a terminal, a cellular phone, a cordless phone, a personal digital assistant (PDA), a handheld device, a computing device, a vehicle-mounted device, a wearable device, etc. In some possible implementations, the method can be implemented by a processor calling a computer-readable instruction stored in a memory.
[0042] It can be understood that the above-mentioned various method embodiments mentioned in the present disclosure can be combined with each other to form a combined embodiment without violating the principle logic. Due to space limitations, the present disclosure will not go into details.
[0043] Figure 1 A flow chart showing a method for obtaining test results according to an embodiment of the present disclosure is shown as follows: Figure 1 As shown, the method for obtaining the test result includes:
[0044] S10: accessing a pre-configured interface, triggering the opening of an automated deployment tool page when accessed, and creating and executing a test task in the automated deployment tool page;
[0045] S20: Obtain the test return value through the interface;
[0046] S30: Determine the test result corresponding to the test task by comparing the test return value with the expected return value, wherein the expected return value includes expected result information corresponding to the test task.
[0047] In the disclosed embodiment, the execution subject of the method for obtaining the test result is a program testing tool, and the program testing tool is preferably an interface testing tool Postman. In the related art, in order to test whether the underlying resources of the Linux system are successfully created, the Postman software used is used for automated testing. During the test process, it is found that: the test results cannot be obtained, which leads to the inability to verify whether the underlying resources (k8s, Ceph, apache, mysql, etc.) of the Linux system are successfully created. Therefore, the disclosed embodiment combines the automated deployment tool page and the pre-configured interface to obtain the test return value to verify whether the underlying resources of the Linux system are successfully created. Of course, in actual applications, the software testing tool can also use other corresponding tools, such as: jmeter, etc.
[0048] Before executing the test, that is, before using the program testing tool to access the pre-configured interface, the embodiment of the present disclosure includes: the user configures the interface, and the interface is preferably: a flask interface, that is. Of course, other types of interfaces can also be used in practical applications, such as: a Django interface.
[0049] The interface of the disclosed embodiment can be developed using a UI automation tool (i.e., the interface contains an IU automation program). When accessed, the UI automation program in the interface triggers the opening of the automation deployment tool page, and creates and automatically executes test tasks in the automation deployment tool page. The UI automation program contains the business logic for executing the test. In this embodiment, the UI automation tool is preferably selenium; the automation deployment tool is preferably jenkins; and the automation deployment tool page is a jenkins WEB page. Of course, in actual applications, the present invention is not limited to this. The UI automation tool can also be Robot Framework, UTF, and the automation deployment tool can also include tekton, drone, and jenkins x.
[0050] Therefore, the embodiment of the present disclosure uses the third-party library flask to develop a flask interface for access by the program testing tool postman software. In the flask interface, the automated deployment tool page Jenkins WEB page can be operated through the selenium program. The purpose is to trigger the selenium program in the interface when the program testing tool postman accesses the flask interface, and perform operations such as opening the automated deployment tool, creating test tasks, and executing test tasks.
[0051] Among them, Selenium is a tool for testing web applications. Selenium tests run directly in the browser, just like real users are operating. Flask is a lightweight web application framework written in Python; Jenkins is an open source software project, a continuous integration tool developed based on Java, used to monitor continuous and repetitive work, aiming to provide an open and easy-to-use software platform to make continuous integration of software possible.
[0052] Through the above configuration, an interface for program testing tool postman to access can be created through the third-party library flask, and the UI automation tool selenium is used to develop in this interface. The program testing tool postman access interface of the disclosed embodiment is used to open the automated deployment tool page, locate the task node executed by the automated deployment tool page, and obtain information such as test results generated in the automated deployment tool page. By accessing this interface through postman, the automated deployment tool page can be called to automatically execute test tasks and obtain test results. Specifically, postman accesses the flask interface to trigger the selenium program, and the jenkins WEB page is opened through the selenium program. The selenium program drives the creation of a new job task (test task) in the job of the jenkins WEB page. Then, according to the business logic information related to the test task in the selenium program, the test task can be executed, so that the job task is executed in the linux system, and the execution result is returned to the jenkins WEB page after the execution is completed.
[0053] In the process of executing software program testing, the created interface can be accessed through the program testing tool postman. In the embodiment of the present disclosure, the number of created interfaces can be multiple, and different interfaces can be used to complete different tests of the application, for example, it can include testing whether the k8s resources under the bottom layer of the Linux system are successfully created, and whether the MySQL resources under the bottom layer of the Linux system are successfully created, etc., and the present disclosure does not make specific limitations on this. Moreover, the different interfaces in the embodiment of the present disclosure refer to different business logics executed by the UI automation program in different interfaces, which can be used to create and execute different test tasks.
[0054] In the disclosed embodiment, when the program testing tool postman accesses the interface to open the automated deployment tool page, it also includes: obtaining verification information, which may include a user name and password. The automated deployment tool page will only be opened if the input verification information matches the pre-registered information.
[0055] Specifically, Figure 2 A flowchart of step S20 in the method for obtaining test results according to an embodiment of the present disclosure is shown. The step of obtaining the test return value through the interface includes:
[0056] S21: Locate and obtain output information in the page of the automated deployment tool through the UI automation program in the interface;
[0057] S22: The output information is obtained through the interface and returned as a test value.
[0058] Specifically, the content of the console output in the Jenkins WEB page can be located and obtained through Selenium, and returned to Postman through the Flask interface, so that Postman can obtain the return value; the disclosed embodiment can store the above-obtained information in real time. In the disclosed embodiment, job is a task or project of Jenkins, which is configurable and executable. Tasks are executed in the Linux system; the console is the console in the Jenkins WEB page, which is used to print output logs and output results.
[0059] Furthermore, when the test return value is obtained, the test return value can be compared with the expected return value corresponding to the test task, and the test result of the test task can be determined based on the comparison result of the test return value and the expected return value. The test result includes the construction status of the underlying architecture corresponding to the test task.
[0060] Specifically, the expected return value may include the expected generation result for the test task, that is, the result predicted to be generated when the test task is executed on the corresponding application. For example, it may include information such as expected intermediate parameters and the final execution result (success or failure), or it may also include information on the underlying resources constructed. This disclosure does not make specific restrictions on this. As long as the parameters or results that can be obtained by executing the test task can be used as the expected return value.
[0061] When the test return value is obtained, the test return value can be compared with the expected return value. If the two are the same, it means that the status of the application currently tested by the test task is consistent with the expectation, that is, the test result is successful. If there is a difference between the two, it can be determined that there is a fault or error in the status of the application currently tested, that is, the test result is a failure, and the application needs to be improved and modified.
[0062] In some possible implementations, the expected return value may include at least one return value, and the return value may match the underlying resources of the application. In the process of executing the test task, if the corresponding underlying resource runs correctly and is successfully created, a return value corresponding to the underlying resource may be generated, which is the test return value. Therefore, the test return value may indicate whether the underlying resources in the application corresponding to the test task are successfully created. In the embodiment of the present disclosure, the underlying resources may include at least one of k8s, Ceph, apache, and mysql. When the corresponding underlying resource is created, the generated return value may be a first identifier, and when the corresponding underlying resource fails to be created, the generated return value may be a second identifier, or no identifier is generated. The corresponding generated test return value may be a sequence consisting of a first identifier and a second identifier. The first identifier may be 1, and the second identifier may be 0, which is not specifically limited in the embodiment of the present disclosure.
[0063] In some possible real-time methods, when the expected return value includes a parameter value other than the test return value, the parameter value can be used to determine the underlying resource that failed to be created. As described above, when the underlying resource fails to be created, the second identifier corresponding to the underlying resource may not be generated. Therefore, the test return value includes only the first identifier corresponding to the successfully created underlying resource, and the underlying resource corresponding to the first identifier that was not generated fails to be created.
[0064] In some possible implementations, when the expected return value is different from the corresponding parameter value in the test return value, different parameter values can be used to determine the underlying resource that failed to be created. As described above, when the creation of the underlying resource fails, a second identifier corresponding to the underlying resource is generated. Therefore, each first identifier in the expected return value can represent the expected result of the creation of each underlying resource in the tested application. At this time, the number of return values in the test return value and the expected return value is the same, and the second identifier corresponding to the underlying resource that failed to be created is different from the first identifier in the expected return value. Different identifiers can be used to determine the underlying resource that failed to be created. On the contrary, if the test return value is consistent with the expected return value, it is determined that the underlying resource is successfully constructed.
[0065] In summary, in the disclosed embodiment, the program testing tool can be used to access the created interface, trigger the creation and automatic execution of the test task in the automated deployment tool page when accessed, obtain the test return value, and the program testing tool determines the test result of the test task by comparing the test return value with the expected return value. The disclosed embodiment can obtain the test result of the program, especially the test result that verifies whether the underlying resource creation of the Linux system is successful.
[0066] Those skilled in the art will appreciate that, in the above method of specific implementation, the order in which the steps are written does not imply a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of the steps should be determined by their functions and possible internal logic.
[0067] Figure 3 A block diagram of a device for obtaining test results according to an embodiment of the present disclosure is shown as follows: Figure 3 As shown, the device for obtaining the test result includes:
[0068] A trigger module 10, configured to trigger opening of an automated deployment tool page when accessing a pre-configured interface, and to create and automatically execute a test task in the automated deployment tool page;
[0069] The return module 20 is used to obtain the test return value through the interface;
[0070] The comparison module 30 is used to determine the test result of the test task by comparing the test return value with the expected return value, where the expected return value includes the expected result information corresponding to the test task.
[0071] In some possible implementations, the interface is developed using a UI automation tool;
[0072] The trigger module is also used to trigger the opening of the automation deployment tool page through the UI automation program in the interface when accessed, and to create and automatically execute test tasks in the automation deployment tool page, wherein the UI automation program contains business logic for executing tests.
[0073] In some possible implementations, the return module is further used to locate and obtain output information in the page of the automated deployment tool through a UI automation program in the interface; and then obtain the output information through the interface as a test return value.
[0074] In some embodiments, the functions or modules included in the device provided by the embodiments of the present disclosure can be used to execute the method described in the above method embodiments. The specific implementation can refer to the description of the above method embodiments, and for the sake of brevity, it will not be repeated here.
[0075] In addition, the present disclosure also provides an apparatus for obtaining test results, an electronic device, a computer-readable storage medium, and a program, all of which can be used to implement any method for obtaining test results provided by the present disclosure. The corresponding technical solutions and descriptions are referred to the corresponding records in the method part and will not be repeated here.
[0076] The embodiment of the present disclosure also provides a computer-readable storage medium, on which computer program instructions are stored, and when the computer program instructions are executed by a processor, the above method is implemented. The computer-readable storage medium may be a non-volatile computer-readable storage medium.
[0077] The embodiment of the present disclosure further proposes an electronic device, comprising: a processor; and a memory for storing instructions executable by the processor; wherein the processor is configured as the above method.
[0078] The electronic device may be provided as a terminal, a server, or a device in other forms.
[0079] Figure 4 A block diagram of an electronic device 800 according to an embodiment of the present disclosure is shown. For example, the electronic device 800 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, or the like.
[0080] Reference Figure 4 , the electronic device 800 may include one or more of the following components: a processing component 802 , a memory 804 , a power component 806 , a multimedia component 808 , an audio component 810 , an input / output (I / O) interface 812 , a sensor component 814 , and a communication component 816 .
[0081] The processing component 802 generally controls the overall operation of the electronic device 800, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 802 may include one or more modules to facilitate the interaction between the processing component 802 and other components. For example, the processing component 802 may include a multimedia module to facilitate the interaction between the multimedia component 808 and the processing component 802.
[0082] The memory 804 is configured to store various types of data to support operations on the electronic device 800. Examples of such data include instructions for any application or method operating on the electronic device 800, contact data, phone book data, messages, pictures, videos, etc. The memory 804 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0083] The power supply component 806 provides power to the various components of the electronic device 800. The power supply component 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the electronic device 800.
[0084] The multimedia component 808 includes a screen that provides an output interface between the electronic device 800 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front camera and / or a rear camera. When the electronic device 800 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
[0085] The audio component 810 is configured to output and / or input audio signals. For example, the audio component 810 includes a microphone (MIC), and when the electronic device 800 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 804 or sent via the communication component 816. In some embodiments, the audio component 810 also includes a speaker for outputting audio signals.
[0086] I / O interface 812 provides an interface between processing component 802 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: home button, volume button, start button, and lock button.
[0087] The sensor assembly 814 includes one or more sensors for providing various aspects of status assessment for the electronic device 800. For example, the sensor assembly 814 can detect the open / closed state of the electronic device 800, the relative positioning of the components, such as the display and keypad of the electronic device 800, and the sensor assembly 814 can also detect the position change of the electronic device 800 or a component of the electronic device 800, the presence or absence of contact between the user and the electronic device 800, the orientation or acceleration / deceleration of the electronic device 800, and the temperature change of the electronic device 800. The sensor assembly 814 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 814 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0088] The communication component 816 is configured to facilitate wired or wireless communication between the electronic device 800 and other devices. The electronic device 800 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 816 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0089] In an exemplary embodiment, the electronic device 800 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the above methods.
[0090] In an exemplary embodiment, a non-volatile computer-readable storage medium is also provided, such as a memory 804 including computer program instructions, which can be executed by a processor 820 of an electronic device 800 to perform the above method.
[0091] Figure 5 1 is a block diagram of another electronic device 1900 according to an embodiment of the present disclosure. For example, the electronic device 1900 may be provided as a server. Figure 5 , the electronic device 1900 includes a processing component 1922, which further includes one or more processors, and a memory resource represented by a memory 1932 for storing instructions executable by the processing component 1922, such as an application. The application stored in the memory 1932 may include one or more modules, each corresponding to a set of instructions. In addition, the processing component 1922 is configured to execute instructions to perform the above method.
[0092] The electronic device 1900 may also include a power supply component 1926 configured to perform power management of the electronic device 1900, a wired or wireless network interface 1950 configured to connect the electronic device 1900 to a network, and an input / output (I / O) interface 1958. The electronic device 1900 may operate based on an operating system stored in the memory 1932, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™ or the like.
[0093] In an exemplary embodiment, a non-volatile computer-readable storage medium is also provided, such as a memory 1932 including computer program instructions, which can be executed by the processing component 1922 of the electronic device 1900 to perform the above method.
[0094] The present disclosure may be a system, a method and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for causing a processor to implement various aspects of the present disclosure.
[0095] A computer-readable storage medium may be a tangible device that can hold and store instructions used by an instruction execution device. A computer-readable storage medium may be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples of computer-readable storage media (a non-exhaustive list) include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disk read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, such as a punch card or a raised structure in a groove on which instructions are stored, and any suitable combination of the foregoing. As used herein, a computer-readable storage medium is not to be interpreted as a transient signal per se, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagating through a waveguide or other transmission medium (e.g., a light pulse through a fiber optic cable), or an electrical signal transmitted through a wire.
[0096] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device.
[0097] The computer program instructions for performing the operation of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages, such as Smalltalk, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. Computer-readable program instructions may be executed completely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer, partially on a remote computer, or completely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., using an Internet service provider to connect via the Internet). In some embodiments, an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), may be personalized by utilizing the state information of the computer-readable program instructions, and the electronic circuit may execute the computer-readable program instructions, thereby realizing various aspects of the present disclosure.
[0098] Various aspects of the present disclosure are described herein with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products according to the embodiments of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer-readable program instructions.
[0099] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processor of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0100] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operating steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0101] The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to multiple embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a part of a module, program segment or instruction, and a part of the module, program segment or instruction includes one or more executable instructions for realizing the specified logical function. In some alternative implementations, the function marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous square boxes can actually be executed substantially in parallel, and they can sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or action, or can be implemented with a combination of special hardware and computer instructions.
[0102] The embodiments of the present disclosure have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and changes will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or technical improvements in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.
Claims
1. A method for obtaining test results, characterized in that: Applied to software testing tools, including: Accessing a pre-configured interface, triggering the opening of an automated deployment tool page when accessed, and creating and automatically executing a test task in the automated deployment tool page, wherein the test task is used to verify the creation of underlying resources of the Linux system; Obtain the test return value through the interface; Determine the test result corresponding to the test task by comparing the test return value with the expected return value, wherein the test result includes the construction status of the underlying architecture corresponding to the test task, and the expected return value includes the expected result information corresponding to the test task, the expected intermediate parameters, and the information of the constructed underlying resources; Wherein, obtaining the test return value through the interface includes: locating and obtaining the output information in the page of the automated deployment tool through the UI automation program in the interface; obtaining the output information as the test return value through the interface; The software testing tool is postman software, the interface is a flask interface developed by a third-party library flask for access by the postman software, the flask interface contains a selenium program developed using a UI automation tool, the selenium program contains business logic for executing the test, and the automated deployment tool page is a jenkins WEB page; The access to the pre-configured interface triggers the opening of an automated deployment tool page when accessed, and creates and automatically executes a test task in the automated deployment tool page, including: The postman software is used to access the flask interface to trigger the selenium program, and the selenium program is used to trigger the opening of the jenkins WEB page during the access, and the selenium program is used to create the test task in the jenkins WEB page, and the test task is executed in the linux system according to the business logic related to the test task in the selenium program, and the test return value is returned to the jenkins WEB page after the execution is completed.
2. The method according to claim 1, characterized in that: The number of the interfaces is multiple; The UI automation programs in different interfaces execute different business logics and are used to create and execute different test tasks.
3. The method according to claim 1, characterized in that The step of comparing the test return value with the expected return value to determine the test result corresponding to the test task further includes: In response to whether the test return value is consistent with the expected return value, the test result is determined to be success or failure.
4. A device for obtaining test results, characterized in that: Applied to software testing tools, including: A trigger module, used to trigger the opening of an automated deployment tool page when accessing a pre-configured interface, and to create and automatically execute a test task in the automated deployment tool page, wherein the test task is used to verify the creation of underlying resources of the Linux system; A return module, used to obtain the test return value through the interface; A comparison module is used to compare the test return value with the expected return value to determine the test result of the test task, wherein the test result includes the construction status of the underlying architecture corresponding to the test task, and the expected return value includes the expected result information corresponding to the test task, the expected intermediate parameters, and the information of the constructed underlying resources; The return module is further used to locate and obtain output information in the page of the automated deployment tool through the UI automation program in the interface; and then obtain the output information as a test return value through the interface; The software testing tool is postman software, the interface is a flask interface developed by a third-party library flask for access by the postman software, the flask interface contains a selenium program developed using a UI automation tool, the selenium program contains business logic for executing the test, and the automated deployment tool page is a jenkins WEB page; Among them, the trigger module is also used to use the postman software to access the flask interface to trigger the selenium program, trigger the opening of the jenkins WEB page through the selenium program when accessing, create the test task in the jenkins WEB page using the selenium program, and execute the test task in the linux system according to the business logic related to the test task in the selenium program, and return the test return value to the jenkins WEB page after the execution is completed.
5. An electronic device, characterized in that: include: processor; a memory for storing processor-executable instructions; The processor is configured to call the instructions stored in the memory to execute the method described in any one of claims 1 to 3.
6. A computer-readable storage medium having computer program instructions stored thereon, characterized in that: When the computer program instructions are executed by a processor, the method according to any one of claims 1 to 3 is implemented.
