Use Jenkins free-style software project to realize continuous integration of interface automation testing

1. JOB project configuration

1. Add description

Optional options can be filled or not filled
insert image description here
insert image description here

2. Limit the running nodes of the project

The node must have the configuration required for the operating environment
Node configuration tutorial: https://blog.csdn.net/YZL40514131/article/details/131504280
insert image description here

3. Source code management

The script needs to be pushed to the remote warehouse
insert image description here

4. Build triggers

Timing build and polling SCM can be selected
Timing build: according to the set timing time, the scheduled task will be executed automatically
Polling SCM: when the code in the remote warehouse changes, the automation code will be executed automatically
insert image description here

5. Construction steps

a.: python -m pytest ${methods} --alluredir=./reports --clean-alluredir${methods} gets the parameters passed during the parameterized build process, the default is testcases
insert image description here

b. The current path is /root/jenkins_mulu/workspace/test_backend
insert image description here

c. workspace: the job name is the project name
insert image description here
insert image description here

6. Post-build operations

Special Note: Keep the names
insert image description here
consistentPlugin Post Build taskShell execution after generating the report
insert image description here
python3 send_ding.py "${JOB_BASE_NAME}": pass the parameter "${JOB_BASE_NAME}" to the send_ding.py file. JOB_BASE_NAME: Indicates the job name

In send_ding.py, you need to use sys.argv[1] to receive. When the job is built, perform post-build operations, generate test reports and send Dingding notifications

insert image description here

insert image description here

Guess you like

Origin blog.csdn.net/YZL40514131/article/details/131613141