YAT automation framework integrated expansion method, device, terminal and storage medium
By integrating the groovy language and spock framework in the gradle project, replacing the Java language for JDBC driver testing, the complexity and high learning cost of the Java language in automated testing are solved, and the JDBC interface testing is efficient and easy to maintain.
Patent Information
- Application Number
- CN202410881591.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-03
- Publication Date
- 2024-10-11
- Estimated Expiration
- 2044-07-03
AI Technical Summary
The Java language has complex logic and high learning costs in automated testing, and the existing yat automation framework is not adapted to Java, making the Java language difficult to maintain and use in JDBC driver testing.
By adding plug-ins and dependencies in the gradle project build tool, integrating the build.gradle file, and writing the groovy language executor and extension point names, it replaces the Java language for JDBC driver testing and uses the spock framework to improve test coverage.
It optimizes the readability and maintenance cost of JDBC interface testing, avoids the Java language compilation process, and improves test coverage and development efficiency.
Smart Images

Figure CN118409735B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of electronic digital data processing, and in particular to a YAT automation framework integrated expansion method, device, terminal and storage medium. Background Art
[0002] Java is widely used in automated testing. Test frameworks such as JUnit and TestNG allow developers to write automated test cases to ensure software quality and stability, but these two frameworks still have many disadvantages, such as difficult test maintenance, frequent changes to test cases as code changes, many external dependencies, and insufficient test coverage. In addition, most database vendors now use the yat framework to complete automated deployment and case care. For the Java language, the open source yat framework is not adapted and needs to be compiled before execution. In addition, the Java language is not as readable as Python in the field of automation, has a high learning cost, and complex logic; therefore, for JDBC-driven testing, the automated deployment and use of Java is somewhat difficult and has a high maintenance cost. Summary of the invention
[0003] The present application provides a YAT automation framework integrated expansion method, device, terminal and storage medium to solve the problems of complex logic and high learning cost of Java language in automated testing in the prior art.
[0004] In a first aspect, the present application provides a YAT automation framework integration extension method, comprising:
[0005] Use the gradle project building tool to add plug-ins, central warehouses and dependencies, and integrate the plug-ins, the central warehouse and the dependencies into the build.gradle file;
[0006] Write a groovy language executor and write the full path of the groovy language executor in the yaml file of the yat framework;
[0007] Write an extension point name in the yaml file of the yat framework so that the yat framework executes the code corresponding to the extension point name;
[0008] The yat automation framework is extended based on the build.gradle file, the full path of the groovy language executor and the extension point name.
[0009] In a second aspect, the present application provides a YAT automation framework integrated expansion device, including:
[0010] A file integration module, used to add plug-ins, central warehouses and dependencies using a gradle project building tool, and integrate the plug-ins, the central warehouse and the dependencies into a build.gradle file;
[0011] The full path specifies the module, which is used to write the groovy language executor, and write the full path of the groovy language executor in the yaml file of the yat framework;
[0012] An extension point designation module, used to write an extension point name in the yaml file of the yat framework, so that the yat framework executes the code corresponding to the extension point name;
[0013] The framework building module is used to extend the yat automation framework based on the build.gradle file, the full path of the groovy language executor and the extension point name.
[0014] In a third aspect, the present application provides a terminal comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the steps of the method described in the first aspect or any possible implementation of the first aspect are implemented.
[0015] In a fourth aspect, the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the steps of the method described in the first aspect or any possible implementation of the first aspect.
[0016] The present application provides a yat automation framework integrated extension method, device, terminal and storage medium, by using the gradle project build tool to add plug-ins, central warehouse and dependencies, and integrate the plug-ins, central warehouse and dependencies into the build.gradle file; write a groovy language executor, and write the full path of the groovy language executor in the yaml file of the yat framework; write the extension point name in the yaml file of the yat framework so that the yat framework executes the code corresponding to the extension point name; based on the build.gradle file, the full path of the groovy language executor and the extension point name, the yat automation framework is extended. The present application integrates the groovy language in the yat automation framework to replace the java language. When testing the JDBC driver, it can avoid executing programs written in the java language directly, optimize the JDBC interface test, and improve the readability and test coverage of the JDBC driver code. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0018] Figure 1 It is a flow chart of the implementation of the YAT automation framework integration and expansion method provided in the embodiment of the present application;
[0019] Figure 2 It is a characteristic diagram of the spock unit test class provided in the embodiment of the present application;
[0020] Figure 3 It is a structural diagram of a YAT automation framework integrated expansion device provided in an embodiment of the present application;
[0021] Figure 4 It is a schematic diagram of a terminal provided in an embodiment of the present application. DETAILED DESCRIPTION
[0022] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0023] In order to make the purpose, technical solutions and advantages of the present application clearer, specific embodiments will be described below in conjunction with the accompanying drawings.
[0024] At present, when using Java language to complete the automated deployment of JDBC driver interface, the following two problems are faced: First, Java language cannot be executed directly, and needs to be called and compiled first. Therefore, in the automation process, it is necessary to use other scripting languages (such as shell) to compile first, and then use other languages to call Java class files. One test point may require at least two files to test; second, Java is an object-oriented strongly typed programming language with characteristics such as strong type verification, and the use case complexity is relatively high, the reusability is not enough, the code redundancy is large when writing, and maintenance is difficult. In addition, the current yat automation framework does not integrate java, so this application aims to provide a yat automation framework. This framework can be applied to the field of interface testing of JDBC drivers. The groovy language is selected and integrated in the yat automation framework to support the testing of JDBC drivers, that is, the groovy language is used instead of the java language to avoid directly calling the java program, solving the problem of having to compile the java language before executing it. Secondly, it solves the limitations of the java language itself, which is not highly reusable and difficult to read the code, making it like a scripting language, capable of directly and clearly designing use cases and execution, more convenient for maintenance and modification, and realizing convenient interaction between the JDBC driver and the database; the spock framework is introduced in the yat framework to improve the test coverage of the JDBC driver and make the code intuitive and clear.
[0025] The main value of this framework is: 1) It is built on the powerful Java language and adds many features learned from languages such as Python, Ruby and Smalltalk, such as dynamic type conversion, closures and metaprogramming support; 2) It provides Java developers with the most popular programming language features in modern times, and the learning cost is very low, almost zero; 3) It avoids the process of compiling first and then executing in the automation process of the Java language; 4) It improves the readability of the script and reduces the maintenance cost of the use case; 5) The basic types in the groovy language are also objects, and the usage can be called directly; 6) It supports functional coding and does not require a main function; 7) It seamlessly integrates existing Java type objects; 8) When developing WEB, GUI, database or console programs, it greatly improves the efficiency of developers by reducing framework code; 9) Data Driven Testing (DDT) in spock can quickly and clearly gather a large number of test cases to cover various branches of complex scenarios; 10) The should assertion in the spock framework can more clearly display the use case execution results and result value verification.
[0026] This framework is a JDBC driver testing framework based on the coordination of the yat automation framework, spock framework, gradle project building tool, groovy language and JDBC driver jar package. The main advantages of this framework are: 1) Use scripting language to complete database testing of java interfaces; 2) Integrate data-driven testing of the spock framework to avoid using hard-coded data in testing, so that test data and use case script code are separated; 3) A test logic only needs to be written once, and multiple test data can be reused, while improving the efficiency of writing test scripts. The specific yat automation framework integration extension method is as follows:
[0027] Figure 1 The implementation flow chart of the YAT automation framework integrated extension method provided in the embodiment of the present application is described in detail as follows:
[0028] In step 101, a plug-in, a central repository, and dependencies are added using the gradle project building tool, and the plug-in, the central repository, and dependencies are integrated into the build.gradle file.
[0029] In an embodiment of the present application, the gradle project building tool is used to build the environment and integrate plug-ins, specifically, plug-ins, central warehouses and dependencies are added to the yat automation box, and the added plug-ins, central warehouses and dependencies are integrated into a build.gradle file.
[0030] In a possible implementation, the gradle project building tool may include plugins, repositories and dependencies, the plugins include a groovy language plugin and a java language plugin, the dependencies include a spock dependency, a yat dependency, a junit dependency and a should assertion dependency;
[0031] Use the gradle project build tool to add plugins, central repositories, and dependencies, which can include:
[0032] Use plugin to add groovy language plugin and java language plugin;
[0033] Use repositories to add a central warehouse;
[0034] Use dependencies to add spock dependencies, yat dependencies, junit dependencies, and should assertion dependencies in the central repository.
[0035] Among them, the gradle project building tools include plugins, repositories and dependencies.
[0036] Plugin is used to add plugins, set compilers and source code directory structure, etc.
[0037] repositories is a configuration block of the gradle project build tool build script, which is used to specify the repository location of the project dependencies. In this project, the mavenCentral() function call is configured. MavenCentral() points to the maven central repository. By using repositories{mavenCentral()} in the gradle project build tool build script, the gradle project build tool can obtain dependencies from the maven repository when building the project. The gradle project build tool will search the maven repository for the required dependencies and download them to the local build environment for the project to use.
[0038] Dependencies is the dependency declaration part in the build script of the gradle project build tool, which is used to specify the external libraries or modules that the project depends on. This project uses the core library of the spock framework and the dependent yat automation framework, and adds the should assertion library and junit framework.
[0039] Optionally, use plugin to add a Groovy language plugin and a Java language plugin to support use cases written in Groovy and Java.
[0040] Use repositories to add the repositories of the spock framework and the JUnit Jupiter engine, that is, implement the mavenCentral() method, which can directly point to the central repository and reference the required packages to the project.
[0041] Use dependencies to add spock dependencies, yat dependencies, junit dependencies, and should assertion dependencies in the central repository to specify the referenced version and specific jar package.
[0042] In a possible implementation, the gradle project building tool may further include test. After the plug-in, the central repository, and the dependencies are integrated into the build.gradle file, the method may further include:
[0043] Use test to configure the test task, and use the test task to test the build.gradle file;
[0044] Accordingly, building the yat automation framework based on the build.gradle file and extension point name can include:
[0045] Build the yat automation framework based on the build.gradle file and extension point name completed by the test.
[0046] Among them, the gradle project build tool also includes test, which is used to specify the behavior of the test task. This project uses useJUnitPlatform(), which tells the gradle project build tool to use JUnitPlatform to run the test when executing the test.
[0047] Optionally, use the test configuration task to tell the gradle project build tool to use the JUnit Platform to run the test, so that the yat automation framework can recognize and run the spock framework test. Accordingly, the yat automation framework is built based on the build.gradle file and extension point name completed by the test.
[0048] In step 102, a groovy language executor is written, and the full path of the groovy language executor is written in the yaml file of the yat framework.
[0049] In the embodiment of the present application, an extension point is written to realize the recognition and execution of the groovy language by the yat framework: a groovy language executor is written, and the full path of the storage of the groovy language executor is obtained. Then a string parameter scriptFilePath is written in the yaml file of the yat framework, and the string parameter scriptFilePath is used to specify the full path of the groovy language executor to be executed by yat, that is, the GroovyShell class of the groovy language executor is used to load and execute the specified groovy script file.
[0050] For example, the extension point information of the new yat framework is created to enable the yat framework to recognize groovy use cases and execute them. Therefore, this project adds a groovy executor to be responsible for loading and running groovy script files. In the executor, a string parameter scriptFilePath is received, which indicates the path of the groovy script file to be executed. This method uses the GroovyShell class of the groovy language executor to load and execute the specified groovy script file. This method can be packaged into a jar package, and the jar package can be directly called using the yat framework, and the script to be executed can be passed in. The execution program is as follows:
[0051] Command: java -cp path / to / GroovyExecutor.jar GroovyExecutor path / to / groovy / script.groovy
[0052] In step 103, the extension point name is written in the YAML file of the YAT framework, so that the YAT framework executes the code corresponding to the extension point name.
[0053] In an embodiment of the present application, the extension point name corresponding to the code executed by the yat framework is written in the yaml file under the yat framework.
[0054] In a possible implementation, the extension point name is written in the YAML file of the YAT framework, which may include:
[0055] In the YAML file of the YAT framework, specify the extension point name in the Extension field.
[0056] Optionally, specify the name of the extension point to enable yat to call the newly implemented extension point: write the Extension field in the yaml file under the yat frame, specify the extension point name to be used by the yat framework, and the yat framework performs corresponding operations according to the code corresponding to the extension point name.
[0057] For example, in the yat test case, a custom extension point name is used to reference the extension point, as follows: The Extension field specifies the extension point name to be used, and then the corresponding operation is performed according to the type of extension point. The execution program can be as follows:
[0058] - TestCase: Use GroovyExecutor Extension
[0059] Steps:
[0060] - Step: Use Extension
[0061] Extension: GroovyExecutor Extension
[0062] Action: Perform GroovyExecutor Action
[0063] Params:
[0064] Option1: value1
[0065] Option2: value2
[0066] In step 104, the yat automation framework is extended based on the build.gradle file, the full path of the groovy language executor, and the extension point name.
[0067] In the embodiment of the present application, the build.gradle file integrated in step 101 and the full path and extension point name of the groovy language executor written in step 102 are integrated to extend the yat automation framework.
[0068] In a possible implementation, after extending the yat automation framework based on the build.gradle file, the full path of the groovy language executor, and the extension point name, the method may further include:
[0069] Based on the spock framework, use the groovy language to write JDBC interface use cases;
[0070] Create a test suite under the yat automation framework. The test suite includes testcase and lib.
[0071] Put the JDBC interface use case into testcase, put the JDBC interface jar package into lib, and then do the test.
[0072] Optionally, according to the spock framework structure, put the JDBC interface use case written in the groovy language into the spock framework.
[0073] Then create a test suite for testcase and lib under the yat automation framework; then put the JDBC interface use case into the testcase, and put the JDBC interface jar package into lib for testing.
[0074] When creating a test suite, configure the relevant execution environment and variable information. Use cases can be automated with macro variables to ensure successful execution in other environments, as follows:
[0075] default:
[0076] host: '127.0.0.1'
[0077] db:
[0078] type: 'zenith'
[0079] username: 'test'
[0080] password: 'test'
[0081] port: 5432
[0082] name: 'postgres'
[0083] In a possible implementation, based on the spock framework, the JDBC interface use case is written in groovy language, including:
[0084] Create a spock framework structure, which is a given-when-then structure;
[0085] Use groovy language to write action code, test case condition code and expected result code;
[0086] Put the action code into given, the test case condition code into when, and the expected result code into then to form a JDBC interface use case.
[0087] Among them, the spock unit test class must integrate Specification, which provides features such as mock, stub, with, verifyAll, etc. Figure 2 .
[0088] The spock framework provides pre- and post-methods to take charge of setting and cleaning up the environment. When testing with JDBC, you can put environment settings and post-cleaning into this module.
[0089] The spock framework provides built-in support for six types of blocks for feature methods. Through the given-when-then structure, it forces the author to put the code of different stages in different locations. Through the division of the given-when-then structure, the content of the unit test can be figured out more quickly, thereby improving the readability of the unit test and making the unit test easier to maintain. For example, put actions such as defining local variables, JDBC connections, and generating stmt in given, output the conditions of the test case in when, and output the expected results in then, and then verify the results. The built-in support for the six types of blocks is shown in the following table:
[0090]
[0091] Use the should assertion to verify the result of resultSet: In the native groovy language test scenario, the should method can be used with the Groovy True assertion to express the test assertion and verify the data of the JDBC interface result set; in the spock mocking test scenario, should can be used to make interactive assertions on the mock objects. For example, in the JDBC usage scenario, the update of the stmt statement can be used to judge the result.
[0092] Optionally, create a spock framework structure according to the spock feature, that is, a given-when-then structure. Use the groovy language to write action code, test case condition code, and expected result code, then put the action code in given, the test case condition code in when, and the expected result code in then to form a JDBC interface use case.
[0093] In a possible implementation, the test suite may further include a script. After placing the JDBC interface use case into the test case, the method may further include:
[0094] Write the JDBC interface use case in the script for subsequent test calls.
[0095] Optionally, before performing JDBC testing, you can also add public methods to the script of the yat automation framework and write JDBC interface use cases in the script for subsequent test calls. For example, encapsulate the connection method and let the yat automation framework read the macro variable in conf to obtain the connection (system.getenv("default_db_driver"),...), and directly use the connection object in the code. You can also add some commonly used custom methods to facilitate testing, such as methods for generating blob data of a specified length. For example:
[0096] public static byte[] generateBlob(int length)
[0097] {
[0098] byte[] blob = new byte[length];
[0099] new Random().nextBytes(blob);
[0100] return blob;
[0101] }
[0102] In a possible implementation, the test suite may further include a schedule for providing a scheduling file.
[0103] The present application provides a method for integrating and extending a yat automation framework, by using the gradle project build tool to add plug-ins, central warehouses, and dependencies, and integrating the plug-ins, central warehouses, and dependencies into the build.gradle file; writing a groovy language executor, and writing the full path of the groovy language executor in the yaml file of the yat framework; writing the extension point name in the yaml file of the yat framework so that the yat framework executes the code corresponding to the extension point name; and extending the yat automation framework based on the build.gradle file, the full path of the groovy language executor, and the extension point name. The present application integrates the groovy language in the yat automation framework to replace the java language. When testing the JDBC driver, it can avoid executing programs written in the java language that are directly called, optimizes the JDBC interface test, and improves the readability and test coverage of the JDBC driver code.
[0104] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0105] The following is an embodiment of the device of the present application. For details not described in detail, please refer to the corresponding method embodiment described above.
[0106] Figure 3 The structure diagram of the YAT automation framework integrated expansion device provided in the embodiment of the present application is shown. For the convenience of explanation, only the part related to the embodiment of the present application is shown, which is described in detail as follows:
[0107] like Figure 3 As shown, the yat automation framework integrated expansion device 3 includes:
[0108] The file integration module 31 is used to add plug-ins, central warehouses and dependencies by using the gradle project building tool, and integrate the plug-ins, central warehouses and dependencies into the build.gradle file;
[0109] The full path designation module 32 is used to write a groovy language executor and write the full path of the groovy language executor in the yaml file of the yat framework;
[0110] The extension point designation module 33 is used to write the extension point name in the yaml file of the yat framework so that the yat framework executes the code corresponding to the extension point name;
[0111] The framework building module 34 is used to extend the yat automation framework based on the build.gradle file, the full path of the groovy language executor and the extension point name.
[0112] The present application provides a yat automation framework integrated extension device, which uses the gradle project build tool to add plug-ins, central warehouses and dependencies, and integrates the plug-ins, central warehouses and dependencies into the build.gradle file; writes a groovy language executor, and writes the full path of the groovy language executor in the yaml file of the yat framework; writes the extension point name in the yaml file of the yat framework so that the yat framework executes the code corresponding to the extension point name; and extends the yat automation framework based on the build.gradle file, the full path of the groovy language executor and the extension point name. The present application integrates the groovy language in the yat automation framework to replace the java language. When testing the JDBC driver, it can avoid executing programs written in the java language that are directly called, optimizes the JDBC interface test, and improves the readability and test coverage of the JDBC driver code.
[0113] In a possible implementation, the gradle project building tool may include plugins, repositories, and dependencies, the plugins include a groovy language plugin and a java language plugin, and the dependencies include a spock dependency, a yat dependency, a junit dependency, and a should assertion dependency.
[0114] In a possible implementation, the file integration module may be used to:
[0115] Use plugin to add groovy language plugin and java language plugin;
[0116] Use repositories to add a central warehouse;
[0117] Use dependencies to add spock dependencies, yat dependencies, junit dependencies, and should assertion dependencies in the central repository.
[0118] In one possible implementation, the gradle project build tool can include the test and file integration modules that can also be used to:
[0119] Use test to configure the test task, and use the test task to test the build.gradle file;
[0120] Accordingly, the framework building module can be used to:
[0121] Extend the yat automation framework based on the test completed build.gradle file, the full path of the groovy language executor and the extension point name.
[0122] In one possible implementation, the extension point specification module can be used to:
[0123] In the YAML file of the YAT framework, specify the extension point name in the Extension field.
[0124] In a possible implementation, the device may further include a use case testing module, which may be used to:
[0125] Based on the spock framework, use the groovy language to write JDBC interface use cases;
[0126] Create a test suite under the yat automation framework, which includes testcas and lib;
[0127] Put the JDBC interface use case into testcase, put the JDBC interface jar package into lib, and then do the test.
[0128] In a possible implementation, the use case test module can also be used to:
[0129] Create a spock framework structure, the spock framework structure is a given-when-then structure;
[0130] Use groovy language to write action code, test case condition code and expected result code;
[0131] Put the action code into given, the test case condition code into when, and the expected result code into then to form a JDBC interface use case.
[0132] In a possible implementation, the test suite may also include a script, and the use case test module may also be used to:
[0133] Write the JDBC interface use case in the script for subsequent test calls.
[0134] Figure 4 is a schematic diagram of a terminal provided in an embodiment of the present application. Figure 4 As shown, the terminal 4 of this embodiment includes: a processor 40, a memory 41, and a computer program 42 stored in the memory 41 and executable on the processor 40. When the processor 40 executes the computer program 42, the steps in the above-mentioned embodiments of the YAT automation framework integration extension method are implemented, such as Figure 1 Alternatively, when the processor 40 executes the computer program 42, the functions of each module / unit in the above-mentioned device embodiments are realized, for example Figure 3 The functions of each module are shown.
[0135] Exemplarily, the computer program 42 may be divided into one or more modules / units, which are stored in the memory 41 and executed by the processor 40 to complete the present application. The one or more modules / units may be a series of computer program instruction segments capable of completing specific functions, which are used to describe the execution process of the computer program 42 in the terminal 4. For example, the computer program 42 may be divided into Figure 3 The modules shown.
[0136] The terminal 4 may be a computing device such as a desktop computer, a notebook, a PDA, or a cloud server. The terminal 4 may include, but is not limited to, a processor 40 and a memory 41. Those skilled in the art will appreciate that Figure 4 It is only an example of terminal 4 and does not constitute a limitation on terminal 4. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the terminal may also include input and output devices, network access devices, buses, etc.
[0137] The processor 40 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0138] The memory 41 may be an internal storage unit of the terminal 4, such as a hard disk or memory of the terminal 4. The memory 41 may also be an external storage device of the terminal 4, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the terminal 4. Further, the memory 41 may also include both an internal storage unit and an external storage device of the terminal 4. The memory 41 is used to store the computer program and other programs and data required by the terminal. The memory 41 may also be used to temporarily store data that has been output or is to be output.
[0139] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0140] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0141] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0142] In the embodiments provided in the present application, it should be understood that the disclosed devices / terminals and methods can be implemented in other ways. For example, the device / terminal embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0143] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0144] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0145] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by the processor, the steps of the above-mentioned embodiments of the YAT automation framework integrated extension method can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device that can carry the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practices in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practices, computer-readable media does not include electrical carrier signals and telecommunication signals.
[0146] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A YAT automation framework integration extension method, It is characterized in that include: Use the gradle project building tool to add plug-ins, central warehouses and dependencies, and integrate the plug-ins, the central warehouse and the dependencies into the build.gradle file; Write a groovy language executor and write the full path of the groovy language executor in the yaml file of the yat framework; Write an extension point name in the yaml file of the yat framework so that the yat framework executes the code corresponding to the extension point name; Extending the yat automation framework based on the build.gradle file, the full path of the groovy language executor and the extension point name; selecting and integrating the groovy language in the yat automation framework to support JDBC-driven testing, with the groovy language replacing the java language; Wherein, the gradle project construction tool includes plugin, and the plugin includes groovy language plugin and java language plugin; The use of the gradle project construction tool to add a plug-in includes: Use the plugin to add the groovy language plug-in and the java language plug-in.
2. The yat automation framework integrated expansion method according to claim 1, It is characterized in that The gradle project building tool includes repositories and dependencies, and the dependencies include spock dependencies, yat dependencies, junit dependencies and should assertion dependencies; The use of the gradle project build tool to add a central repository and dependencies includes: Use the repositories to add the central warehouse; The spock dependency, the yat dependency, the junit dependency, and the should assertion dependency are added to the central repository using the dependencies.
3. The YAT automation framework integrated expansion method according to claim 1, It is characterized in that The gradle project construction tool includes test. After integrating the plug-in, the central warehouse and the dependencies into the build.gradle file, the method further includes: Use the test configuration task, and use the test task to test the build.gradle file; Accordingly, the YAT automation framework is extended based on the build.gradle file, the full path of the Groovy language executor and the extension point name, including: The yat automation framework is extended based on the build.gradle file completed by the test, the full path of the groovy language executor and the extension point name.
4. The YAT automation framework integrated expansion method according to claim 1, It is characterized in that The extension point name is written in the yaml file of the yat framework, including: The extension point name is specified in the YAML file of the YAT framework using the Extension field.
5. The YAT automation framework integrated expansion method according to claim 1, It is characterized in that After extending the yat automation framework based on the build.gradle file, the full path of the groovy language executor and the extension point name, the method further includes: Based on the spock framework, use the groovy language to write JDBC interface use cases; Creating a test suite under the yat automation framework, wherein the test suite includes testcase and lib; Put the JDBC interface use case into the testcase, put the jar package of the JDBC interface into the lib, and perform testing.
6. The YAT automation framework integrated expansion method according to claim 5, It is characterized in that The JDBC interface use case is written in groovy language based on the spock framework, including: Create the spock framework structure, wherein the spock framework structure is a given-when-then structure; Using the groovy language to write action codes, test case condition codes and expected result codes; Put the action code into given, put the test case condition code into when, put the expected result code into then, and build the JDBC interface use case.
7. The YAT automation framework integrated expansion method according to claim 5, It is characterized in that The test suite also includes a script. After the JDBC interface use case is placed in the testcase, the method further includes: Write the JDBC interface use case in the script for subsequent test calls.
8. A YAT automation framework integrated expansion device, It is characterized in that include: A file integration module, used to add plug-ins, central warehouses and dependencies using a gradle project building tool, and integrate the plug-ins, the central warehouse and the dependencies into a build.gradle file; The full path specifies the module, which is used to write the groovy language executor, and write the full path of the groovy language executor in the yaml file of the yat framework; An extension point designation module, used to write an extension point name in the yaml file of the yat framework, so that the yat framework executes the code corresponding to the extension point name; A framework building module, used for extending the yat automation framework based on the build.gradle file, the full path of the groovy language executor and the extension point name; selecting and integrating the groovy language in the yat automation framework to support JDBC-driven testing, the groovy language replacing the java language; Wherein, the gradle project construction tool includes plugin, and the plugin includes groovy language plugin and java language plugin; The file integration module is used for: Use the plugin to add the groovy language plug-in and the java language plug-in.
9. A terminal comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, It is characterized in that When the processor executes the computer program, the steps of the YAT automation framework integration and extension method as described in any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium storing a computer program. It is characterized in that When the computer program is executed by a processor, the steps of the YAT automation framework integration and extension method as described in any one of claims 1 to 7 are implemented.
