(Jenkins) Build an android project continuous integration and NativeDriver-based UI automated testing environment on the hudson Platform

Source: Internet
Author: User
(Jenkins) Build an android project continuous integration and NativeDriver-based UI automated testing environment on the hudson Platform

From kevinkong 02:56:51 | category: automated test | font size subscription

After the deployment, running the build will first start the android simulator, then build the source code to generate the apk file, then install the apk file to the simulator, and finally build the automatic test code to run the automatic test, collect application logs to hudson. (The compilation and automatic testing of the android project are put together below. In actual use, you can create two jobs by compiling the android project and executing the automatic test, compile the dependency to generate the apk file and then run the automatic test)

1. First install the hudson Plugin Android Emulator Plugin.
This plug-in is used to start the android simulator, install the apk, collect the application logcat logs, and exit the simulator.
Plug-in address: https://wiki.jenkins-ci.org/display/JENKINS/Android+Emulator+Plugin
Function:
1. Set the sdk version, screen size, resolution, and hardware information of the simulator through configuration options.
2. automatically run the android simulator. Wait until the simulator is fully started, automatically collects logs, and disables the simulator.
3. automatically install and uninstall the Application Software
4. Run the stress testing tool and collect the running results.

2. Create a new job in hudson. 3. After the android plug-in is installed, a Run an Android emulator during Build option will appear in the build Environment option in the job configuration. You can check the options to configure the startup simulator. Note: The configuration is temporarily removed.Use emulator snapshots check box, this option still has a bug.

 

4. In build configuration, compile the configuration you need to build.Configuration example: There are three configuration items in order. The configuration items are executed according to the configuration order. The first Invoke Ant is the android Application source code compilation. After compilation, the apk file is generated. The Install Android package option is the first one to obtain the latest apk file after compilation, Install it in the simulator, and uninstall it before installation. The second Invoke Ant is to compile the automatic test code and run the automatic test case through TestNG to execute the automatic test.

 

Addition: Windows node installation in Jenkins is used to call and execute android source code compilation and automatic test execution.

Your jenkins is deployed on a computer, but the automatic test code may be deployed on a dedicated test machine. In this case, you need to manage the new jenkins node and implement it on jenkins.
Easy management and automatic testing.
The installation procedure is as follows: see: https://wiki.jenkins-ci.org/display/JENKINS/Step+by+step+guide+to+set+up+master+and+slave+machines

  1. System Management-"node management create a new node

     

  2. Enter the node name
  3. Select Dumb SlaveClick OK

     

  4. On the Slave configuration page, enter the following:

Number of executors, one or more

Remote FS root enter the following directory on the Slave, such as c: \ jenkins; the corresponding software to be installed on the node will be installed in this directory.

Usage selection:Only jobs bound to this machine are allowed

Lunch Method: Launch slave agentsJavaWeb Start; This is critical

Avaliablitiy:Keep this slave online as much as possible;

Save the settings;

 

5. Then, log in to husdon from the node computer to be added. Go to the newly created node, and you will see the content shown in. Click launch and run the downloaded software. The corresponding software is installed on the node for hudson to communicate with the node. Install the software in the Remote FS root directory. After the installation is successful, you will see the image in the following 3

 

 

 

Http://qa.blog.163.com/blog/static/190147002201111162565117/

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.