def shoot_pctest(): test = PcMfcTest(r"D:\auto\pc_install\npp.5.7.Installer.exe") drivers = test.find_drivers() devdriver = drivers.items()[0] target(proj_path=r'D:\auto\buffer\testProject') shoot(devdriver=devdriver, modelfile= r'D:\auto\buffer\testProject\testcase\pc_mfc_excel_usage.xlsx', modeltype="pc")
def shoot_webtest(): test = WebTest() drivers = test.find_drivers() devdriver = drivers.items()[0] target(proj_path=r'D:\auto\buffer\testProject') shoot( devdriver=devdriver, modelfile=r'D:\auto\buffer\testProject\testcase\web_excel_usage.xlsx', modeltype="web")
def shoot_packet_test(): test = PacketTest() drivers = test.find_drivers() devdriver = drivers.items()[0] target(proj_path=r'D:\auto\buffer\testProject') shoot( devdriver=devdriver, modelfile=r'D:\auto\buffer\testProject\testcase\api_excel_usage.xlsx', modeltype="api")
def shoot_padtest(): test = PadTest( r'D:\auto\python\app-autoApp\demoProject\apps\ApiDemos\ApiDemos-debug.apk' ) drivers = test.find_drivers() devdriver = drivers.items()[0] target(proj_path=r'D:\auto\buffer\testProject') shoot( devdriver=devdriver, modelfile=r'D:\auto\buffer\testProject\testcase\pad_excel_usage.xlsx', modeltype="pad")
@AUTHOR: Administrator-Bruce Luo(罗科峰) MAIL: [email protected] RCS: demo.yaml_web_usage,v 1.0 2017年5月18日 FROM: 2017年5月18日 ******************************************************************** ====================================================================== UI and Web Http automation frame for python. ''' from rock4 import target,shoot,WebTest,Grid # 创建并初始化项目 target("web_excel_usage", proj_path = r'D:\auto\env\testProject', initdirs = False) def case_detail(devdriver): shoot(devdriver = devdriver,modelfile = r'D:\auto\env\testProject\testcase\web_yaml_usage.yaml',modeltype="web") #### Test def local_web_test(): # defaultly will grab the remote host and connect them. if no remote host, local webdriver will be started return WebTest(hub_ip="127.0.0.1", hub_port=4444) def remote_web_test(): ''' Before test: # PC1 -> start hub Grid().start_hub()
Rough version history: v1.0 Original version to use ******************************************************************** @AUTHOR: Administrator-Bruce Luo(罗科峰) MAIL: [email protected] RCS: demo.yaml_api_usage,v 1.0 2017年5月18日 FROM: 2017年5月18日 ******************************************************************** ====================================================================== UI and Web Http automation frame for python. ''' from rock4 import shoot, target, PacketTest # 创建并初始化项目 target("test", proj_path=r'D:\auto\env\testProject', initdirs=True) def case_detail(devdriver): shoot(devdriver=devdriver, modelfile=r'D:\auto\env\testProject\testcase\api_yaml_usage.yaml', modeltype="api") if __name__ == "__main__": # 实例一个测试 test = PacketTest() test.run_model_case(case_detail)