~ hi stamp here –>>>>>>> Click here to get the source code

1, the overall structure of the test framework: config: store configuration files, associated parameters cookie Chromedriver path, global variables, folder path, page URL address, etc.

Data: stores the Excel test case, uploads the required image, and authenticates the login after OCR processing

Page: Each page of the project, based on the POM design pattern, each page is written as a class, each operation as a method

Result: test results, including error screenshots, execution logs, and test I reports

Scripts: test logic script save file

Util: Public method file, Including unitTest framework assertion secondary encapsulation error screenshots, WebDriver secondary encapsulation, local Google Browser driver automatic matching download, framework dependency detection download, login verification code recognition, logging log encapsulation, test case Excel data parsing,.ini.json.txt.yaml File reading and writing, email sending (automatic uploading of latest reports and logs), time generation tool, error log collection, method of uploading files by PyWinAuto in Windows, and writing test results into the result set of corresponding test cases in Excel

2. Automatic screenshots are saved when the assert method in the UnitTest framework reports errors during secondary encapsulation

All page classes from the Basepage class inherit from this base class

4. Automatically detect the local Google Browser version and download the corresponding driver

Automatic detection of native Python installations and dependencies used by automatic downloads

6, login verification code recognition, verification code interception, binarization, noise reduction (as long as the verification code is not distorted in the picture can be recognized)

Logging module log secondary encapsulation, logging can be enabled/disabled in global variables

8. Obtain and analyze Excel test data, and generate corresponding dictionary format data

Secondary encapsulation of browser operation methods in WebDriver, including: Browser Basic operations Open the browser, open the web page, click (right click, double click, drag), input, select from the drop-down box (select drop-down box processing, non-select drop-down box processing, random selection), cookie operation (obtain, add, delete), As well as window, iframe switch, get page text, element attribute, change attribute, accept cancel warning popup, screenshot, keyboard operation (single key operation, multi-key combination operation)

X. Email sending (upload attachment logs and test reports)

Error log collection

Windows popup file transfer operation, based on PyWinAuto library

Xiii. Write the test results into the excel application case results

Github address: github.com/13720673941…