Continuous integration does this, and the efficiency of App automation testing is increased by 50%

Continuous integration is a development practice that advocates that team members need to integrate their work frequently, and each integration is verified by automated construction (including compilation, construction, and automated testing), so as to find integration errors as soon as possible. Keeping the software under development in a working state allows products to iterate quickly while maintaining high quality.

Jenkins is a continuous integration tool developed based on Java, open source and free, official website: https://jenkins.io/

App automation test execution strategy

Automated testing is mainly used for regression testing, and we can formulate execution strategies: such as fixed every day, and regular execution after the development code is updated, which requires integration with Jenkins.

Problems with Jenkins integrated App automation testing:

App automation requires the use of a real machine or an emulator, and Jenkins is generally deployed on a server. It is obviously impossible to connect a real machine or an emulator to the server.

solution:

  • Apply for a local computer dedicated to automated testing, deploy an automated testing environment, and connect to a local real machine/simulator

  • Deploy Jenkins on the company server (internal server or Alibaba Cloud/Tencent Cloud server)

  • Use the Jenkins master-slave mode to send the task to the corresponding local computer and execute the task on the local computer

If you want to learn automated testing, here I recommend a set of videos for you. This video can be said to be the number one automated testing tutorial on the entire network at station B. At the same time, the number of people online has reached 1,000, and there are notes to collect and share with you. Dashen Technical Exchange: 798478386   

[Updated] The most detailed collection of practical tutorials for automated testing of Python interfaces taught by station B (the latest version of actual combat)_哔哩哔哩_bilibili [Updated] The most detailed collection of practical tutorials for automated testing of Python interfaces taught by station B (actual combat) The latest version) has a total of 200 videos, including: 1. [Interface Automation] The current market situation of software testing and the ability standards of testers. , 2. [Interface Automation] Fully skilled in the Requests library and the underlying method call logic, 3. [Interface Automation] interface automation combat and the application of regular expressions and JsonPath extractors, etc. For more exciting videos, please pay attention to the UP account. https://www.bilibili.com/video/BV17p4y1B77x/?spm_id_from=333.337.search-card.all.click
specific steps

It should be noted that the local execution computer needs to configure the environment of JDK+Maven+Android SDK+Git, and needs to link to the device through adb.

Jenkins master-slave mode (master-slave) uses:

Add Node node

Manage Jenkins -> Manage Nodes and Clouds -> New Node

picture

 

picture

It should be noted that the Launch method must open the remote connection port of jenkins, otherwise the slave machine cannot connect to the Jenkins service. This connection uses the JNLP4 protocol, which is a long connection protocol encapsulated on the basis of WebSocket + TLS. It can be turned on in the security settings panel of jenkins: enter the Jenkins home page -> security panel

picture

Connect slave slave

Both ways can connect to the slave slave

picture

In the task configuration, select the corresponding slave slave machine to build

picture

 Possible problem 1:

D:\jenkins-slave\workspace\jenkins_maven_demo>mvn clean test
The JAVA_HOME environment variable is not defined correctly
This environment variable is needed to run this program
NB: JAVA_HOME should point to a JDK not a JRE

ERROR: Error cloning remote repo 'origin'  

hudson.plugins.git.GitException: Could not init D:\jenkins-

slave\workspace\jenkins_maven_demo


Solution: Configure the tool path on the slave node:

picture

Possible problem 2:

mvn not found

There is no maven in the environment variable of the Jenkins slave node. Solution: Copy the PATH environment variable on the slave machine to here:

picture

Guess you like

Origin blog.csdn.net/caixiangting/article/details/132110801