python+uiautomator2+pytest automated testing framework (2)

Basic Directory Description

case

The directory where the case is stored
insert image description here

Use the @pytest.mark.parametrize decorator + the parameters corresponding to the yml file to execute the case

For example, test_a reads the parameters in the yml file for verification and asserts whether it exists

data

Test data storage directory
supports json, xml, etc.

The comparison and parameterized data of the case are now in the form of yml, which is as follows:
insert image description here

For other formats, please use Baidu

Page

This directory stores page objects

For example, in the home class, all the basic operation objects of the home page are stored. There are different operation methods in the object and they are called with the home class, and so on\

Every time a new page class is added, the method in init must be referenced
insert image description here

public

Public methods
include system methods and application methods

The basic operation method is encapsulated under Public, which is convenient to call later.
For example: find_class, find_id login location method

init is the configuration file that defines the read
BASE_CONF = get_data(os.path.join(os.path.dirname(os.path.dirname(os.path.realpath( file ))), "config.ini"))[' App']

insert image description here

Guess you like

Origin blog.csdn.net/qq_34004131/article/details/115250907