基於 Ruby 實現的移動 App 自動化測試框架 (AppiumBooster)

AppiumBooster

AppiumBooster helps you to write automation testcases in tables, without writing a snippet of code.

write testcases

You can write testcases in any table tools, including MS Excel and iWork Numbers, and even in plain CSV format.

Take DJI+ Discovers login and logout function as an example.

In order to test these functions above, you can write testcases in tables like this.

After the testcases are finished, export to CSV format, and put the csv files under ios/testcases/ directory.

Thats all you need to do, and now you are ready to run automation test on your app.

run

Run the automation testcases is very easy. Just execute ruby run.rb in the project root directory.

? AppiumBooster git:(master) ? ruby run.rbn

AppiumBooster will load all the csv test suites and then excute each suite sequentially.

? AppiumBooster git:(master) ? ruby run.rbninitialize appium driver ...nstart appium driver ...nalert accepted!n======= start to run testcase suite: ./ios/testcases/Account-Login and Logout.csv =======nload csv testcase file: ./ios/testcases/Account-Login and Logout.csv ...nB------ Start to run testcase: Login with valid accountnstep_1: Enter My Account Pagencontrol_element.click ... ?nuiviewMyAccount exsits? ... ?nstep_2: Enter Login Pagencontrol_element.click ... ?nuiviewLogIn exsits? ... ?nstep_3: Input Email Addressncontrol_element.type leo.lee@dji.com ... ?nstep_4: Input Passwordncontrol_element.type 123456 ... ?nstep_5: Loginncontrol_element.click ... ?ntablecellMyMessage exsits? ... ?nstep_6: Check if coupon popup window existsninner_screen.has_control btnViewMyCoupons ... ?nbtnClose exsits? ... ?nstep_7: Close coupon popup windowncontrol_element.click ... ?n!btnClose no longer exsits? ... ?nE------ Login with valid accountnnB------ Start to run testcase: Logoutnstep_1: Enter My Account Pagencontrol_element.click ... ?nuiviewMyAccount exsits? ... ?nstep_2: Enter System Settingsncontrol_element.click ... ?nbtnLogout exsits? ... ?nstep_3: Click Logoutncontrol_element.click ... ?nDo you want to log out? exsits? ... ?nstep_4: Confirm logout alertnalert accepted!nalert_accept ... ?ntablecellMyAccountLogin exsits? ... ?nE------ Logoutnn============ all testcases have been executed. ============nquit appium driver.n

Source Code

GitHub: debugtalk.com/post/Intr

推薦閱讀:

Unity 遊戲框架搭建 (五) 簡易消息機制
無為文件管理術之「框架思維」
Retrofit 實現分析
2016年 CSS 庫、框架和工具新生榜 TOP 50
PHP模版引擎,框架有什麼區別,各有什麼用?

TAG:Ruby | 自动化测试 | 框架 |