phoenixframework automated testing platform 1.5.0 newly released

I. Introduction

I have always wanted to refactor the code of phoenix_webdriver and phoenix_mobile before. Many friends reported that the API of the platform is not intuitive enough, especially the API related to webUI and mobile app is a bit messy. I have this feeling myself, especially in the follow-up function expansion, which is more troublesome. With the increase in the number of users, the code refactoring of these modules is more and more imminent, otherwise there will be more problems in the future. But suffer from not having enough time. Taking advantage of the few days between the recent job change, I decided to refactor the code of these modules.

This refactoring is just a refactoring of the code structure of important modules. The functions of all previous versions will be fully retained in the new version. In addition, the js methods, page functions, page UI, CSS, etc. of the page are refactored, especially the UI, which can give you a new look.

Second, the reconstruction effect experience

The effect after reconstruction is as follows:

Under the develop project, the user logic custom area can use px or phoenix to call out all the API interfaces supported by the platform, and then directly call all the methods under the interface. The interface call after refactoring is also more intuitive and convenient, especially if I expand new functions in the future, it will be more convenient, and the code logic will be clearer.

If you choose the webAPI method:

As can be seen from the following code, compared with the previous version, the function has been completely separated.

3. Description of each API function

1 webAPI

webAPI is used for automated testing of webUI. It can simulate the operation of human hand clicking on the elements of the page. The methods in this API are also suitable for mobile browsers.

Call method:

        phoenix.webAPI().....

Sample code:

        http://my.oschina.net/u/2391658/blog/607791

2、Android API

This API is used to simulate click, slide and other operations on the elements of the Android app. Virtual and physical machines are supported.

Calling method:
        phoenix.androidAPI()....

Sample code:

        http://my.oschina.net/u/2391658/blog/713170

3、checkPointAPI

Checkpoint methods, all of which are available in other APIs. Such as phoenix.checkPoint().checkIsFalse(condition); can be used in webUI, Android, socketAPI, etc. The inspection results are automatically counted and can be viewed in the statistical graph.

Calling method:
        phoenix.checkPoint()......

Sample code:

String r = phoenix.webAPI().webElement("//*[@id=\"su\"]", LocatorType.XPATH).getAttribute("value");//数据库中的数据可以与页面不变的数据混合使用
			phoenix.checkPoint().checkIsEqual(r, "百度一下");//调用检查点,检查结果会在日志中统计

4、commonAPI

The methods in this API are common to every other module. Such as data loading, positioning information loading, waiting. The positioning information data of the previous version was automatically loaded, but later I felt it was unnecessary, so I changed it to manual loading through this method

Calling method:
        phoenix.commonAPI().....

Sample code:

		HashMap<InterfaceBatchDataBean, HashMap<String, String>> datas = phoenix.commonAPI().loadWebCaseDatas(caseName);//加载数据库测试数据方法		
		HashMap<String,LocatorBean> locators = phoenix.commonAPI().addLocator(caseName);//加载定位信息的方法

5、ftpClientAPI

Used to operate the FTP server, download from the FTP server, and upload files to the FTP server.

Calling method:
        phoenix.ftpClient().....

Code example:

		px.ftpClient().ftpClientConfig(String serverIp, int serverport,
				String loginName, String password, String ftpServerFolder);
		px.ftpClient().ftpUploadFile("test.txt");
		px.ftpClient().ftpDisconnect();

6、imagerReader

It is used to recognize the text on the picture, which is developed based on OCR. In general, the recognition rate of normal text on the picture is high, but the recognition rate of some verification codes is very low.

Calling method:
        phoenix.imageReader().....

Code example:

        http://my.oschina.net/u/2391658/blog/713173

7、interfaceAPI

For interface testing, it includes many source code capture methods, supports https, cookie, dynamic proxy, page source code formatting dom, random number tool, regular judgment tool, xml/json data and many other useful parsing methods.

Calling method:
        phoenix.interfaceAPI().....

Code example:

       http://my.oschina.net/u/2391658/blog/491754

8 、 iosAPI

Used to operate ios applications. There is currently no implementation method for this interface, and it will be added in the next version.

Calling method:
        phoenix.iosAPI().....

Code example: the usage method is the same as the Android app

9、svnClient

It is used to operate the svn server. Through this api, you can automatically obtain the code submitter, submitted version, function description, and code submission path in the specified directory. It is a powerful tool for automating continuous integration.

Calling method:
        phoenix.svnClient()....

Code example:

        http://my.oschina.net/u/2391658/blog/713174

10、telnetClient

TelnetClient is used to operate the remote socket server, it can send telnet commands and socket commands to the remote server, and can receive the response content of the remote server.

Calling method:
        phoenix.telnetClient().....

Code example:

        http://my.oschina.net/u/2391658/blog/713175

4. 1.5.0 upgrade details

phoenix_web : Added sorting function according to id for each table phoenix_web
: Added some styles, such as font adjustment, added, deleted and modified link styles code editor phoenix_web: page js code refactoring phoenix_webdriver : code refactoring, easier to extend phoenix_webdriver : support for custom insert steps log The test list adds automatic update task status function phoenix_web: shiro is integrated with spring phoenix_web: added cache support for shiro phoenix_webdriver: data and positioning information data are changed from automatic loading to manual loading phoenix_webdriver: the remark information of each module is improved











Five, source code resource download

You can visit the platform website: https://feiyang123.github.io/  to get the source code download address and download the packaged war package. Since the network disk address will be changed, I will update it on the website when a new address is released.

How to set up and use the environment:

http://my.oschina.net/u/2391658/blog/706055

Email: [email protected]

Author QQ: 296595606

Platform QQ group: 246776066

WeChat public account: phoenixframework

 

Author WeChat ID: phoenixframe_2013

{{o.name}}
{{m.name}}

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324130395&siteId=291194637