Java Interface Automation Series - BaseCase the basis of the parent class of use cases

Interface Automation thinking step, all test methods needs to be done
1, replacing the parametric
2, database front-query results (database queries must be asserted before and after the implementation of the interface)
3, call interface
4, asserted in response to the results of
5 interface is added In response to write back
6, the database query result set
7, a database assertion
8, adding assertions to write the contents back to
9, adding a log
10, the report asserts

Test class in accordance with more than 10 steps to complete all of the calls, the interface automation introduces three interfaces, registration, login, recharge

BaseCase three major public portion of the package interfaces are used, three test interface class inherit the class

@step @Description Allure is a plug-in reports to use for describing methods to make the report more clearly

1, calls the interface method call a third step, the interface for reading the address, the request mode, the type of request, request parameters, receiving the response data

2, addWBD method to add objects to write back to collection

The row number, column number, in response to the stored content list acquired the collection

3, assertResponse method, in response to the assertion content

As a common method is for convenience when asserted, may be asserted subtraction mode, where only two determined, and multi-field values ​​match and single-field matching equivalence

Multi-field, that the need to add a line array type formats, the desired design expression embodiment with the table, and then using analytical jsonpath

 

 

 

 4, replace method, parameter substitution

The main parameters of the method in use in the embodiment, all of the codes are used to read directly from the case, if it is directly read, the data is taken out of the parameter can not be resolved, where a method to write additional need for instead of new parameters to the parameters read directly

env is a map set, the parameter set for storing data read from the table to use cases

 

 5, init method initializes

Initialization method for reading parameters stored in the configuration file, i.e., the previous method in the old new value

CreateMobileUtils is a randomly generated phone number of the class, will be introduced later

 

 6, finish the method, the interface is finished

 

 

Guess you like

Origin www.cnblogs.com/wanshuang/p/12524325.html