A method for recording a test case, performed by a processor, comprising:
- determining test versions of a target application program and determining, from a pre-established test case management system, functional identifications corresponding to the test versions and case information groups corresponding to the functional identifications, wherein each of the case information groups comprises a case label and a case requirement;
- extracting case labels from the case information groups, and sorting the case labels based on case numbers in the case labels, and generating a case selection box by using the sorted case labels as candidates;
- determining, in response to a record starting operation of a user and in a case where one of the case labels is selected, a target case information group corresponding to the selected case label from the case information groups, and obtaining test action data, wherein the obtaining test action data comprises:
- detecting a plurality of probes preset in the target application program, wherein each of the probes is configured to identify a function name in the target application program;
- and
- determining, in a case where a target executable statement in the target application program is executed, a target probe corresponding to the target executable statement and recording a target function name corresponding to the target probe, wherein the target executable statement is an executable statement in a function module of the target application program;
- and
- stopping obtaining the test action data in response to a record stopping operation of the user, and automatically generating a target test case based on the obtained test action data and the target case information group without requiring the user to manually input test case IDs;
- wherein after the step of stopping obtaining the test action data in response to a record stopping operation of the user, and generating a target test case based on obtained test action data and the target case information group, the method further comprises:
- establishing, based on the recorded target function name, a correlation between the recorded target function name and the target test case;
- and
- calculating a percentage of a number of recorded target function names to a total number of all target function names, to obtain a test coverage of the target test case;
- and
- wherein the method further comprises:
- determining, in a case that one of the case labels is selected, a target case information group corresponding to the selected case label from the case information groups;
- and
- displaying, in the case selection box, case information content in the target case information group.