CN109918288A - Use-case test method and device - Google Patents

Use-case test method and device Download PDF

Info

Publication number
CN109918288A
CN109918288A CN201910040151.2A CN201910040151A CN109918288A CN 109918288 A CN109918288 A CN 109918288A CN 201910040151 A CN201910040151 A CN 201910040151A CN 109918288 A CN109918288 A CN 109918288A
Authority
CN
China
Prior art keywords
case
tested
test
mentioned
state
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201910040151.2A
Other languages
Chinese (zh)
Inventor
李明
侯玉磊
李杨
易翠
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Mutual Gold New Finance Technology Co Ltd
Original Assignee
Beijing Mutual Gold New Finance Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Mutual Gold New Finance Technology Co Ltd filed Critical Beijing Mutual Gold New Finance Technology Co Ltd
Priority to CN201910040151.2A priority Critical patent/CN109918288A/en
Publication of CN109918288A publication Critical patent/CN109918288A/en
Pending legal-status Critical Current

Links

Abstract

The invention discloses a kind of use-case test method and devices.Wherein, this method comprises: obtaining use-case to be tested, wherein above-mentioned use-case to be tested is for testing user interface capabilities;After based on target tool library creation test environment, above-mentioned use-case to be tested is run under above-mentioned test environment, wherein above-mentioned target tool library includes at least: puppeteer tool storage room;Determine whether above-mentioned use-case to be tested passes through test according to operation result, wherein the test result of above-mentioned operation result and above-mentioned use-case to be tested is shown in target pages, above-mentioned target pages include at least: visual page.The present invention solves test method manual testing higher cost in the prior art and the lower technical problem of test accuracy.

Description

Use-case test method and device
Technical field
The present invention relates to the field of test technology, in particular to a kind of use-case test method and device.
Background technique
In the prior art, after holding code before a modification, tester generally requires a large amount of use-cases of regression test to protect The correctness of code is demonstrate,proved, but in use-case test, not only manual testing's higher cost, also inevitably omits certain tests Use-case, test accuracy is lower be easy to cause code is dealt on line after go wrong.
For above-mentioned problem, currently no effective solution has been proposed.
Summary of the invention
The embodiment of the invention provides a kind of use-case test method and devices, at least to solve test side in the prior art The technical problem that legal person's work testing cost is higher and test accuracy is lower.
According to an aspect of an embodiment of the present invention, a kind of use-case test method is provided, comprising: obtain to be measured on probation Example, wherein above-mentioned use-case to be tested is for testing user interface capabilities;After based on target tool library creation test environment, Above-mentioned use-case to be tested is run under above-mentioned test environment, wherein above-mentioned target tool library includes at least: puppeteer tool Library;Determine whether above-mentioned use-case to be tested passes through test according to operation result, wherein above-mentioned operation knot is shown in target pages The test result of fruit and above-mentioned use-case to be tested, above-mentioned target pages include at least: visual page.
Further, above-mentioned use-case to be tested includes at least one of: returning first that point data is write based on function Test case;The second test case that tool is recorded is recorded using code.
Further, above-mentioned test environment includes at least: page language environment;Test wrapper is created based on target tool library Border, comprising: above-mentioned visual page is accessed using above-mentioned target tool library, to create above-mentioned page language environment;In above-mentioned survey Above-mentioned use-case to be tested is run under test ring border, comprising: run above-mentioned use-case to be tested under above-mentioned page language environment, obtain State operation result.
Further, determine whether above-mentioned use-case to be tested passes through test according to operation result, comprising: detection operation is above-mentioned The current page state of above-mentioned visual page after use-case to be tested;Above-mentioned current page state and target pages state are compared, Obtain comparison result;In the case where above-mentioned comparison result indicates above-mentioned current page state and target pages state consistency, really Fixed above-mentioned use-case to be tested indicates that above-mentioned current page state and target pages state are different by test, in above-mentioned comparison result In the case where cause, determine that above-mentioned use-case to be tested does not pass through test.
Further, after determining above-mentioned use-case to be tested by test, the above method further include: record above-mentioned to be measured Example on probation, and mark the current state of above-mentioned use-case to be tested in above-mentioned visual page and pass through state for test;In determination After above-mentioned use-case to be tested does not pass through test, the above method further include: generate snapshot number corresponding with above-mentioned use-case to be tested According to and recording daily record data corresponding with above-mentioned use-case to be tested, and mark in above-mentioned visual page above-mentioned to be tested The current state of use-case is that test does not pass through state.
According to another aspect of an embodiment of the present invention, a kind of use-case test device is additionally provided, comprising: obtain module, use In acquisition use-case to be tested, wherein above-mentioned use-case to be tested is for testing user interface capabilities;Module is run, for being based on After target tool library creation test environment, above-mentioned use-case to be tested is run under above-mentioned test environment, wherein above-mentioned target work Tool library includes at least: puppeteer tool storage room;Determining module, for whether determining above-mentioned use-case to be tested according to operation result Pass through test, wherein the test result of above-mentioned operation result and above-mentioned use-case to be tested, above-mentioned target are shown in target pages The page includes at least: visual page.
Further, above-mentioned test environment includes at least: page language environment;Above-mentioned apparatus further include: creation module is used In accessing above-mentioned visual page using above-mentioned target tool library, to create above-mentioned page language environment;Above-mentioned operation module, also For running above-mentioned use-case to be tested under above-mentioned page language environment, above-mentioned operation result is obtained.
Further, above-mentioned determining module includes: detection unit, for detect run above-mentioned use-case to be tested after it is above-mentioned can Current page state depending on changing the page;Comparing unit is compared for comparing above-mentioned current page state and target pages state To result;Determination unit, for indicating the feelings of above-mentioned current page state and target pages state consistency in above-mentioned comparison result Under condition, determine that above-mentioned use-case to be tested by test, indicates above-mentioned current page state and target pages in above-mentioned comparison result In the case that state is inconsistent, determine that above-mentioned use-case to be tested does not pass through test.
According to another aspect of an embodiment of the present invention, a kind of storage medium is additionally provided, above-mentioned storage medium includes storage Program, wherein equipment where controlling above-mentioned storage medium in above procedure operation executes the above-mentioned use-case of any one and surveys Method for testing.
According to another aspect of an embodiment of the present invention, a kind of processor is additionally provided, above-mentioned processor is used to run program, Wherein, any one above-mentioned use-case test method is executed when above procedure is run.
In embodiments of the present invention, by obtaining use-case to be tested, wherein above-mentioned use-case to be tested is for testing user circle Face function;After based on target tool library creation test environment, above-mentioned use-case to be tested is run under above-mentioned test environment, In, above-mentioned target tool library includes at least: puppeteer tool storage room;Whether above-mentioned use-case to be tested is determined according to operation result Pass through test, wherein the test result of above-mentioned operation result and above-mentioned use-case to be tested, above-mentioned target are shown in target pages The page includes at least: visual page, has achieved the purpose that the test result of visual testing use-case, and realizes reduction and survey Try cost and improve test accuracy technical effect, and then solve test method manual testing cost in the prior art compared with High and lower test accuracy technical problem.
Detailed description of the invention
The drawings described herein are used to provide a further understanding of the present invention, constitutes part of this application, this hair Bright illustrative embodiments and their description are used to explain the present invention, and are not constituted improper limitations of the present invention.In the accompanying drawings:
Fig. 1 is a kind of flow chart of use-case test method according to an embodiment of the present invention;
Fig. 2 is a kind of flow chart of optional use-case test method according to an embodiment of the present invention;
Fig. 3 is a kind of flow chart of optional use-case test method according to an embodiment of the present invention;
Fig. 4 is a kind of structural schematic diagram of use-case test device according to an embodiment of the present invention.
Specific embodiment
In order to enable those skilled in the art to better understand the solution of the present invention, below in conjunction in the embodiment of the present invention Attached drawing, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described embodiment is only The embodiment of a part of the invention, instead of all the embodiments.Based on the embodiments of the present invention, ordinary skill people The model that the present invention protects all should belong in member's every other embodiment obtained without making creative work It encloses.
It should be noted that description and claims of this specification and term " first " in above-mentioned attached drawing, " Two " etc. be to be used to distinguish similar objects, without being used to describe a particular order or precedence order.It should be understood that using in this way Data be interchangeable under appropriate circumstances, so as to the embodiment of the present invention described herein can in addition to illustrating herein or Sequence other than those of description is implemented.In addition, term " includes " and " having " and their any deformation, it is intended that cover Cover it is non-exclusive include, for example, the process, method, system, product or equipment for containing a series of steps or units are not necessarily limited to Step or unit those of is clearly listed, but may include be not clearly listed or for these process, methods, product Or other step or units that equipment is intrinsic.
Embodiment 1
According to embodiments of the present invention, a kind of embodiment of use-case test method is provided, it should be noted that in attached drawing The step of process illustrates can execute in a computer system such as a set of computer executable instructions, although also, Logical order is shown in flow chart, but in some cases, it can be to be different from shown by sequence execution herein or retouch The step of stating.
Fig. 1 is a kind of flow chart of use-case test method according to an embodiment of the present invention, as shown in Figure 1, this method includes Following steps:
Step S102 obtains use-case to be tested, wherein above-mentioned use-case to be tested is for testing user interface capabilities;
Step S104, based on target tool library creation test environment after, run under above-mentioned test environment it is above-mentioned to Test case, wherein above-mentioned target tool library includes at least: puppeteer tool storage room;
Step S106 determines whether above-mentioned use-case to be tested passes through test according to operation result, wherein in target pages Show the test result of above-mentioned operation result and above-mentioned use-case to be tested, above-mentioned target pages include at least: visual page.
In an alternative embodiment, above-mentioned use-case to be tested includes at least one of: returning points based on function According to the first test case write;The second test case that tool is recorded is recorded using code.
Optionally, above-mentioned use-case to be tested can be, but not limited to generate in the following manner: front end developer is based on function The first test case that point data is write can be returned, for example, returning what point data was write according to the complete product function of product Test code, by front end functional test, can quick page function point on the tropic, reduce tester's test at This, covers basic use-case;Tester records the second test case that tool is recorded using code, for example, by using code The test script that recording tool puppeteer record is recorded.
It should be noted that in the embodiment of the present application, can be, but not limited to write use-case using JavaScript language, Learning cost is low, does not need to learn other programming languages.
Optionally, after obtaining use-case to be tested, test environment can be created by using puppeteer tool storage room, And above-mentioned use-case to be tested is run under above-mentioned test environment.Also, can also by the above-mentioned use-case to be tested of timing operation, The test result of above-mentioned operation result and above-mentioned use-case to be tested is shown in target pages, quickly find line on problem, and can and Shi Tongzhi developer.
In an alternative embodiment, above-mentioned use-case test side can be realized by four modules of following test macro Method: use-case generation module, operation module, reporting modules, visualization model.
Wherein, use-case generation module is for obtaining use-case to be tested, it is above-mentioned it is to be tested can be survey that developer writes Try the use-case of code and tester's recording;Operation module is for starting browser environment creation page context and running State use-case to be tested;Reporting modules are for being analyzed and processed operation result, to there is abnormal module to carry out reporting notice;It can Start operation automation depending on changing the accessible visual page of related personnel that module is used to that front end to be facilitated to test to survey Example on probation, and the operation result and test result of each use-case to be tested can be clearly obtained in the visual page.
In embodiments of the present invention, by obtaining use-case to be tested, wherein above-mentioned use-case to be tested is for testing user circle Face function;After based on target tool library creation test environment, above-mentioned use-case to be tested is run under above-mentioned test environment, In, above-mentioned target tool library includes at least: puppeteer tool storage room;Whether above-mentioned use-case to be tested is determined according to operation result Pass through test, wherein the test result of above-mentioned operation result and above-mentioned use-case to be tested, above-mentioned target are shown in target pages The page includes at least: visual page, has achieved the purpose that the test result of visual testing use-case, and realizes reduction and survey Try cost and improve test accuracy technical effect, and then solve test method manual testing cost in the prior art compared with High and lower test accuracy technical problem.
In an alternative embodiment, above-mentioned test environment includes at least: page language environment;Based on target tool library Creation test environment, comprising: step S202 accesses above-mentioned visual page using above-mentioned target tool library, to create above-mentioned page Face language environment;Above-mentioned use-case to be tested is run under above-mentioned test environment, comprising: step S204, in above-mentioned page language ring Above-mentioned use-case to be tested is run under border, obtains above-mentioned operation result.
In above-mentioned optional embodiment, it can be accessed by using puppeteer tool storage room in headless Chrome Some visual page creation test environment, that is, one page context (Page Context) of creation, in above-mentioned page language Above-mentioned use-case to be tested is run under speech environment, obtains above-mentioned operation result, for example, carrying out dom programming behaviour by api interface Make, for example, simulation is clicked, input frame input content etc..
In an alternative embodiment, Fig. 2 is a kind of optional use-case test method according to an embodiment of the present invention Flow chart, as shown in Fig. 2, determining whether above-mentioned use-case to be tested passes through test according to operation result, comprising:
Step S302, detection run the current page state of above-mentioned visual page after above-mentioned use-case to be tested;
Step S304 compares above-mentioned current page state and target pages state, obtains comparison result;
Step S306, the case where above-mentioned comparison result indicates above-mentioned current page state and target pages state consistency Under, determine that above-mentioned use-case to be tested by test, indicates above-mentioned current page state and page object planar in above-mentioned comparison result In the case that state is inconsistent, determine that above-mentioned use-case to be tested does not pass through test.
In above-mentioned optional embodiment, after running above-mentioned use-case to be tested, visual page has to be changed accordingly Become, and then the current page state of above-mentioned visual page after above-mentioned use-case to be tested can be run by detection, and compares Current page state and target pages state are stated, indicates above-mentioned current page state and target pages state in above-mentioned comparison result Under unanimous circumstances, above-mentioned use-case to be tested is determined by test (for example, the code logic of use-case to be tested is normal), above-mentioned Comparison result indicates that above-mentioned current page state and target pages state are inconsistent (for example, the code logic of use-case to be tested is different In the case where often), determine that above-mentioned use-case to be tested does not pass through test.
In an alternative embodiment, after determining above-mentioned use-case to be tested by test, the above method further include: Step S402 records above-mentioned use-case to be tested, and the current state of above-mentioned use-case to be tested is marked in above-mentioned visual page Pass through state for test.
In an alternative embodiment, after determining that above-mentioned use-case to be tested does not pass through test, the above method is also Include: step S404, generates snapshot data corresponding with above-mentioned use-case to be tested, and record is corresponding with above-mentioned use-case to be tested Daily record data, and mark the current state of above-mentioned use-case to be tested in above-mentioned visual page and do not pass through state for test.
The state for whether passing through test according to above-mentioned use-case to be tested, can be handled in different ways, for example, right In the use-case to be tested that passes through of test, above-mentioned use-case to be tested is recorded, and is marked in above-mentioned visual page above-mentioned to be tested The current state of use-case is that test passes through state;For testing unsanctioned use-case to be tested, generate and above-mentioned use-case to be tested Corresponding snapshot data, and daily record data corresponding with above-mentioned use-case to be tested is recorded, and in the acceptance of the bid of above-mentioned visual page It infuses the current state of above-mentioned use-case to be tested and does not pass through state for test.
Below by way of a kind of optional embodiment, use-case test method provided by the embodiment of the present application is illustrated, Fig. 3 is a kind of flow chart of optional use-case test method according to an embodiment of the present invention, as shown in figure 3, it is above-mentioned optionally with Example test method, comprises the following methods:
Step S502 obtains use-case to be tested, wherein above-mentioned use-case to be tested is for testing user interface capabilities;
Step S504 accesses visual page using target tool library, to create page language environment, wherein above-mentioned mesh Mark tool storage room includes at least: puppeteer tool storage room;
Step S506 runs above-mentioned use-case to be tested under above-mentioned page language environment and obtains operation result;
Step S508, detection run the current page state of above-mentioned visual page after above-mentioned use-case to be tested;
Step S510 compares above-mentioned current page state and target pages state, obtains comparison result;
Step S512, the case where above-mentioned comparison result indicates above-mentioned current page state and target pages state consistency Under, determine that above-mentioned use-case to be tested passes through test;
Step S514 indicates above-mentioned current page state and the inconsistent situation of target pages state in above-mentioned comparison result Under, determine that above-mentioned use-case to be tested does not pass through test;
Wherein, after determining above-mentioned use-case to be tested by test, step S516 is executed, it is above-mentioned to be measured on probation determining After example is not by test, step S518 is executed.
Step S516 records above-mentioned use-case to be tested, and above-mentioned use-case to be tested is marked in above-mentioned visual page Current state is that test passes through state;
Step S518 generates snapshot data corresponding with above-mentioned use-case to be tested, and records and above-mentioned use-case pair to be tested The daily record data answered, and mark the current state of above-mentioned use-case to be tested in above-mentioned visual page and do not pass through shape for test State.
It should be noted that use-case test method provided by the embodiment of the present application, compares more existing test method, lead to It crosses and use-case is write using JavaScript language, learning cost is low, does not need to learn other programming languages;And net can be carried out Network request intercepts, and simulates returned data;Weak net state and the performance without network state lower front end page function can be simulated;It can To open debug mode, when use-case is problematic, facilitate developer's orientation problem;Current page snapshot can be generated, it is convenient fixed Position problem;Tester can generate test script by tool, reduce tester's learning cost;Visualization interface side is provided Just test result is checked.
Embodiment 2
According to embodiments of the present invention, it additionally provides a kind of for implementing the Installation practice of above-mentioned use-case test method, Fig. 4 It is a kind of structural schematic diagram of use-case test device according to an embodiment of the present invention, as shown in figure 4, above-mentioned use-case test device, It include: to obtain module 40, operation module 42 and determining module 44, in which:
Module 40 is obtained, for obtaining use-case to be tested, wherein above-mentioned use-case to be tested is for testing user interface function Energy;Run module 42, for based on target tool library creation test environment after, run under above-mentioned test environment it is above-mentioned to Test case, wherein above-mentioned target tool library includes at least: puppeteer tool storage room;Determining module 44, for according to operation As a result determine whether above-mentioned use-case to be tested passes through test, wherein shown in target pages above-mentioned operation result and it is above-mentioned to The test result of test case, above-mentioned target pages include at least: visual page.
In an alternative embodiment, above-mentioned test environment includes at least: page language environment;Above-mentioned apparatus is also wrapped It includes: creation module, for accessing above-mentioned visual page using above-mentioned target tool library, to create above-mentioned page language environment; Above-mentioned operation module is also used to run above-mentioned use-case to be tested under above-mentioned page language environment, obtains above-mentioned operation result.
In an alternative embodiment, above-mentioned determining module includes: detection unit, above-mentioned to be tested for detecting operation The current page state of above-mentioned visual page after use-case;Comparing unit, for comparing above-mentioned current page state and page object Surface state obtains comparison result;Determination unit, for indicating above-mentioned current page state and target pages in above-mentioned comparison result In the case where state consistency, determine that above-mentioned use-case to be tested by test, indicates above-mentioned current page planar in above-mentioned comparison result In the case that state and target pages state are inconsistent, determine that above-mentioned use-case to be tested does not pass through test.
It should be noted that above-mentioned modules can be realized by software or hardware, for example, for the latter, Can be accomplished by the following way: above-mentioned modules can be located in same processor;Alternatively, above-mentioned modules are with any Combined mode is located in different processors.
Herein it should be noted that above-mentioned acquisition module 40, operation module 42 and determining module 44 correspond in embodiment 1 Step S102 to step S106, above-mentioned module is identical as example and application scenarios that corresponding step is realized, but is not limited to 1 disclosure of that of above-described embodiment.It should be noted that above-mentioned module may operate in computer as a part of device In terminal.
It should be noted that the optional or preferred embodiment of the present embodiment may refer to the associated description in embodiment 1, Details are not described herein again.
Above-mentioned use-case test device can also include processor and memory, above-mentioned acquisition module 40, operation module 42 It waits with determining module 44 and is stored in memory as program unit, above-mentioned journey stored in memory is executed by processor Sequence unit realizes corresponding function.
Include kernel in processor, is gone in memory to transfer corresponding program unit by kernel, above-mentioned kernel can be set One or more.Memory may include the non-volatile memory in computer-readable medium, random access memory (RAM) And/or the forms such as Nonvolatile memory, such as read-only memory (ROM) or flash memory (flash RAM), memory includes at least one Storage chip.
According to the embodiment of the present application, a kind of storage medium embodiment is additionally provided.Optionally, in the present embodiment, above-mentioned Storage medium includes the program of storage, wherein equipment where controlling above-mentioned storage medium in above procedure operation executes above-mentioned Any one use-case test method.
Optionally, in the present embodiment, above-mentioned storage medium can be located in computer network in computer terminal group In any one terminal, or in any one mobile terminal in mobile terminal group, above-mentioned storage medium packet Include the program of storage.
Optionally, when program is run, equipment where control storage medium executes following functions: use-case to be tested is obtained, In, above-mentioned use-case to be tested is for testing user interface capabilities;After based on target tool library creation test environment, above-mentioned Above-mentioned use-case to be tested is run under test environment, wherein above-mentioned target tool library includes at least: puppeteer tool storage room;Foundation Operation result determines whether above-mentioned use-case to be tested passes through test, wherein above-mentioned operation result and upper is shown in target pages The test result of use-case to be tested is stated, above-mentioned target pages include at least: visual page.
Optionally, when program is run, equipment where control storage medium executes following functions: using above-mentioned target tool Library accesses above-mentioned visual page, to create above-mentioned page language environment;It is run under above-mentioned page language environment above-mentioned to be measured Example on probation, obtains above-mentioned operation result.
Optionally, when program is run, equipment where control storage medium executes following functions: detection operation is above-mentioned to be measured The current page state of above-mentioned visual page after example on probation;Above-mentioned current page state and target pages state are compared, is obtained Comparison result;In the case where above-mentioned comparison result indicates above-mentioned current page state and target pages state consistency, in determination Use-case to be tested is stated by test, indicates that above-mentioned current page state and target pages state are inconsistent in above-mentioned comparison result In the case of, determine that above-mentioned use-case to be tested does not pass through test.
Optionally, when program is run, equipment where control storage medium executes following functions: recording above-mentioned to be measured on probation Example, and mark the current state of above-mentioned use-case to be tested in above-mentioned visual page and pass through state for test;It is above-mentioned determining After use-case to be tested does not pass through test, the above method further include: snapshot data corresponding with above-mentioned use-case to be tested is generated, and Record daily record data corresponding with above-mentioned use-case to be tested, and above-mentioned use-case to be tested is marked in above-mentioned visual page Current state is that test does not pass through state.
According to the embodiment of the present application, a kind of processor embodiment is additionally provided.Optionally, in the present embodiment, above-mentioned place Reason device is for running program, wherein above procedure executes any one of the above use-case test method when running.
The embodiment of the present application provides a kind of equipment, equipment include processor, memory and storage on a memory and can The program run on a processor, processor performs the steps of when executing program obtains use-case to be tested, wherein it is above-mentioned to Test case is for testing user interface capabilities;After based on target tool library creation test environment, in above-mentioned test environment The lower above-mentioned use-case to be tested of operation, wherein above-mentioned target tool library includes at least: puppeteer tool storage room;According to operation result Determine whether above-mentioned use-case to be tested passes through test, wherein above-mentioned operation result and above-mentioned to be tested is shown in target pages The test result of use-case, above-mentioned target pages include at least: visual page.
Optionally, when above-mentioned processor executes program, above-mentioned visualization page can also be accessed using above-mentioned target tool library Face, to create above-mentioned page language environment;Above-mentioned use-case to be tested is run under above-mentioned page language environment, obtains above-mentioned operation As a result.
Optionally, when above-mentioned processor executes program, above-mentioned visualization after the above-mentioned use-case to be tested of operation can also be detected The current page state of the page;Above-mentioned current page state and target pages state are compared, comparison result is obtained;In above-mentioned comparison As a result in the case where indicating above-mentioned current page state and target pages state consistency, determine that above-mentioned use-case to be tested passes through survey Examination, in the case where above-mentioned comparison result indicates that above-mentioned current page state and target pages state are inconsistent, determine it is above-mentioned to Test case does not pass through test.
Optionally, when above-mentioned processor executes program, above-mentioned use-case to be tested can also be recorded, and in above-mentioned visualization page The current state of above-mentioned use-case to be tested is marked in face passes through state for test;Determining that above-mentioned use-case to be tested do not pass through test Later, the above method further include: generate snapshot data corresponding with above-mentioned use-case to be tested, and record and above-mentioned use-case to be tested Corresponding daily record data, and mark the current state of above-mentioned use-case to be tested in above-mentioned visual page and do not pass through for test State.
Present invention also provides a kind of computer program products, when executing on data processing equipment, are adapted for carrying out just The program of beginningization there are as below methods step: use-case to be tested is obtained, wherein above-mentioned use-case to be tested is for testing user interface function Energy;After based on target tool library creation test environment, above-mentioned use-case to be tested is run under above-mentioned test environment, wherein Above-mentioned target tool library includes at least: puppeteer tool storage room;Determine whether above-mentioned use-case to be tested passes through according to operation result Test, wherein the test result of above-mentioned operation result and above-mentioned use-case to be tested, above-mentioned target pages are shown in target pages It includes at least: visual page.
Optionally, it when above-mentioned computer program product executes program, can also be accessed using above-mentioned target tool library above-mentioned Visual page, to create above-mentioned page language environment;Above-mentioned use-case to be tested is run under above-mentioned page language environment, is obtained Above-mentioned operation result.
Optionally, it when above-mentioned computer program product executes program, can also detect on after the above-mentioned use-case to be tested of operation State the current page state of visual page;Above-mentioned current page state and target pages state are compared, comparison result is obtained;? In the case that above-mentioned comparison result indicates above-mentioned current page state and target pages state consistency, above-mentioned use-case to be tested is determined It is determined by test in the case where above-mentioned comparison result indicates that above-mentioned current page state and target pages state are inconsistent Above-mentioned use-case to be tested does not pass through test.
Optionally, when above-mentioned computer program product executes program, above-mentioned use-case to be tested can also be recorded, and above-mentioned The current state of above-mentioned use-case to be tested is marked in visual page passes through state for test;Determining above-mentioned use-case to be tested not After test, the above method further include: generate snapshot data corresponding with above-mentioned use-case to be tested, and record and it is above-mentioned to The corresponding daily record data of test case, and the current state of above-mentioned use-case to be tested is marked in above-mentioned visual page to survey Examination does not pass through state.
The serial number of the above embodiments of the invention is only for description, does not represent the advantages or disadvantages of the embodiments.
In the above embodiment of the invention, it all emphasizes particularly on different fields to the description of each embodiment, does not have in some embodiment The part of detailed description, reference can be made to the related descriptions of other embodiments.
In several embodiments provided herein, it should be understood that disclosed technology contents can pass through others Mode is realized.Wherein, the apparatus embodiments described above are merely exemplary, such as the division of the unit, Ke Yiwei A kind of logical function partition, there may be another division manner in actual implementation, for example, multiple units or components can combine or Person is desirably integrated into another system, or some features can be ignored or not executed.Another point, shown or discussed is mutual Between coupling, direct-coupling or communication connection can be through some interfaces, the INDIRECT COUPLING or communication link of unit or module It connects, can be electrical or other forms.
The unit as illustrated by the separation member may or may not be physically separated, aobvious as unit The component shown may or may not be physical unit, it can and it is in one place, or may be distributed over multiple On unit.It can some or all of the units may be selected to achieve the purpose of the solution of this embodiment according to the actual needs.
It, can also be in addition, the functional units in various embodiments of the present invention may be integrated into one processing unit It is that each unit physically exists alone, can also be integrated in one unit with two or more units.Above-mentioned integrated list Member both can take the form of hardware realization, can also realize in the form of software functional units.
If the integrated unit is realized in the form of SFU software functional unit and sells or use as independent product When, it can store in a computer readable storage medium.Based on this understanding, technical solution of the present invention is substantially The all or part of the part that contributes to existing technology or the technical solution can be in the form of software products in other words It embodies, which is stored in a storage medium, including some instructions are used so that a computer Equipment (can for personal computer, server or network equipment etc.) execute each embodiment the method for the present invention whole or Part steps.And storage medium above-mentioned includes: that USB flash disk, read-only memory (ROM, Read-Only Memory), arbitrary access are deposited Reservoir (RAM, Random Access Memory), mobile hard disk, magnetic or disk etc. be various to can store program code Medium.
The above is only a preferred embodiment of the present invention, it is noted that for the ordinary skill people of the art For member, various improvements and modifications may be made without departing from the principle of the present invention, these improvements and modifications are also answered It is considered as protection scope of the present invention.

Claims (10)

1. a kind of use-case test method characterized by comprising
Obtain use-case to be tested, wherein the use-case to be tested is for testing user interface capabilities;
After based on target tool library creation test environment, the use-case to be tested is run under the test environment, wherein The target tool library includes at least: puppeteer tool storage room;
Determine whether the use-case to be tested passes through test according to operation result, wherein the operation is shown in target pages As a result with the test result of the use-case to be tested, the target pages are included at least: visual page.
2. the method according to claim 1, wherein the use-case to be tested includes at least one of: being based on Function returns the first test case that point data is write;The second test case that tool is recorded is recorded using code.
3. the method according to claim 1, wherein
The test environment includes at least: page language environment;Test environment is created based on target tool library, comprising: uses institute It states target tool library and accesses the visual page, to create the page language environment;
The use-case to be tested is run under the test environment, comprising: is run under the page language environment described to be measured Example on probation, obtains the operation result.
4. according to the method described in claim 3, it is characterized in that, determining whether the use-case to be tested leads to according to operation result Cross test, comprising:
Detection runs the current page state of the visual page after the use-case to be tested;
The current page state and target pages state are compared, comparison result is obtained;
In the case where the comparison result indicates the current page state and the target pages state consistency, described in determination Use-case to be tested indicates that the current page state and the target pages state are inconsistent by test, in the comparison result In the case where, determine that the use-case to be tested does not pass through test.
5. the method according to claim 1, wherein
After determining the use-case to be tested by test, the method also includes: the use-case to be tested is recorded, and in institute Stating and marking the current state of the use-case to be tested in visual page is that test passes through state;
After determining that the use-case to be tested does not pass through test, the method also includes: it generates and the use-case pair to be tested The snapshot data answered, and daily record data corresponding with the use-case to be tested is recorded, and mark in the visual page The current state of the use-case to be tested is that test does not pass through state.
6. a kind of use-case test device characterized by comprising
Module is obtained, for obtaining use-case to be tested, wherein the use-case to be tested is for testing user interface capabilities;
Run module, for based on target tool library creation test environment after, under the test environment operation described in Test case, wherein the target tool library includes at least: puppeteer tool storage room;
Determining module, for determining whether the use-case to be tested passes through test according to operation result, wherein in target pages Show the test result of the operation result and the use-case to be tested, the target pages include at least: visual page.
7. device according to claim 6, which is characterized in that
The test environment includes at least: page language environment;Described device further include: creation module, for using the mesh It marks tool storage room and accesses the visual page, to create the page language environment;
The operation module is also used to run the use-case to be tested under the page language environment, obtains the operation knot Fruit.
8. device according to claim 7, which is characterized in that the determining module includes:
Detection unit, for detect run the use-case to be tested after the visual page current page state;
Comparing unit obtains comparison result for comparing the current page state and the target pages state;
Determination unit, for indicating the feelings of the current page state Yu the target pages state consistency in the comparison result Under condition, determine that the use-case to be tested by test, indicates the current page state and target pages in the comparison result In the case that state is inconsistent, determine that the use-case to be tested does not pass through test.
9. a kind of storage medium, which is characterized in that the storage medium includes the program of storage, wherein run in described program When control the storage medium where equipment perform claim require any one of 1 to 5 described in use-case test method.
10. a kind of processor, which is characterized in that the processor is for running program, wherein right of execution when described program is run Benefit require any one of 1 to 5 described in use-case test method.
CN201910040151.2A 2019-01-16 2019-01-16 Use-case test method and device Pending CN109918288A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910040151.2A CN109918288A (en) 2019-01-16 2019-01-16 Use-case test method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910040151.2A CN109918288A (en) 2019-01-16 2019-01-16 Use-case test method and device

Publications (1)

Publication Number Publication Date
CN109918288A true CN109918288A (en) 2019-06-21

Family

ID=66960355

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910040151.2A Pending CN109918288A (en) 2019-01-16 2019-01-16 Use-case test method and device

Country Status (1)

Country Link
CN (1) CN109918288A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113515748A (en) * 2021-05-20 2021-10-19 云账户技术(天津)有限公司 Method and device for detecting SQL injection

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103049371A (en) * 2012-11-07 2013-04-17 青岛海信传媒网络技术有限公司 Testing method and testing device of Android application programs
WO2015039566A1 (en) * 2013-09-22 2015-03-26 Tencent Technology (Shenzhen) Company Limited Method and system for facilitating automated web page testing
US9262311B1 (en) * 2013-12-03 2016-02-16 Amazon Technologies, Inc. Network page test system and methods
CN106294161A (en) * 2016-08-12 2017-01-04 北京奇虎科技有限公司 The interface function method of testing of a kind of application and device
CN106897207A (en) * 2015-12-17 2017-06-27 北京奇虎科技有限公司 Ui testing method and apparatus
CN107480055A (en) * 2017-07-26 2017-12-15 网易(杭州)网络有限公司 Method of testing, device, calculate readable storage medium storing program for executing and computing device
CN107844409A (en) * 2016-09-18 2018-03-27 平安科技(深圳)有限公司 Test example executing method and device

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103049371A (en) * 2012-11-07 2013-04-17 青岛海信传媒网络技术有限公司 Testing method and testing device of Android application programs
WO2015039566A1 (en) * 2013-09-22 2015-03-26 Tencent Technology (Shenzhen) Company Limited Method and system for facilitating automated web page testing
US9262311B1 (en) * 2013-12-03 2016-02-16 Amazon Technologies, Inc. Network page test system and methods
CN106897207A (en) * 2015-12-17 2017-06-27 北京奇虎科技有限公司 Ui testing method and apparatus
CN106294161A (en) * 2016-08-12 2017-01-04 北京奇虎科技有限公司 The interface function method of testing of a kind of application and device
CN107844409A (en) * 2016-09-18 2018-03-27 平安科技(深圳)有限公司 Test example executing method and device
CN107480055A (en) * 2017-07-26 2017-12-15 网易(杭州)网络有限公司 Method of testing, device, calculate readable storage medium storing program for executing and computing device

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113515748A (en) * 2021-05-20 2021-10-19 云账户技术(天津)有限公司 Method and device for detecting SQL injection

Similar Documents

Publication Publication Date Title
CN110275958B (en) Website information identification method and device and electronic equipment
CN104050076B (en) Application software testing method, apparatus and system on mobile terminal
US11755919B2 (en) Analytics for an automated application testing platform
CN105765528B (en) Method, system and medium with the application execution path trace that configurable origin defines
CN107133174A (en) Test case code automatically generating device and method
US9003235B2 (en) Indicating coverage of web application testing
CN105426310B (en) A kind of method and apparatus for the performance for detecting target process
CN107783899A (en) The method of testing of the H5 pages, device and computer equipment in application program
US8271252B2 (en) Automatic verification of device models
CN108509324B (en) System and method for selecting computing platform
CN108459850B (en) Method, device and system for generating test script
CN107967204A (en) Line pushes method, system and the terminal device surveyed
CN110414581A (en) Picture detection method and device, storage medium and electronic device
CN113268243A (en) Memory prediction method and device, storage medium and electronic equipment
CN106528429A (en) UI testing method and device
CN113590454A (en) Test method, test device, computer equipment and storage medium
CN109697164A (en) Test method, device, storage medium and the terminal of App have been adjusted in browser
CN109918288A (en) Use-case test method and device
CN109783837A (en) Emulator, analogue system, emulation mode and simulated program
CN109656817A (en) A kind of automation interface test device and equipment
CN103955425B (en) Webpage (WEB) exploring testing device and method
CN111414309B (en) Automatic test method of application program, computer equipment and storage medium
US9442826B2 (en) Kernel functionality checker
CN105339974B (en) Analog sensor
CN110515829A (en) Application testing method, device, equipment and computer readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20190621