|
最近看了lantianwei 的描述性编程的事例,感觉很不错,自己也学习着写了一个小程序
#=============================================================================
#从SVN版本库上下载更新版本
#利用自动化测试工具实现自动更新版本库上的信息
#=============================================================================
#判断SVN窗口是否已经打开,如果打开就自动关闭退出,如果没有打开,那么程序打开SNV窗口
GUI_load(".\\svn_test\\svn.gui");
if(win_exists("{class:window,label:\"Repository Browser\",MSW_class:\"#32770\"}")==E_OK)
{
report_msg("the SVN label is enable");
win_close("{class:window,label:\"Repository Browser\",MSW_class:\"#32770\"}");
texit;
}
else
{
report_msg("the SVN label is not start,now start it");
set_window ("html_frame", 2);
if(list_check_item("SysListView32",1,"bootrom.bin")!=E_OK)
{
set_window ("html_frame", 2);
obj_mouse_click ("SysListView32", 75, 49, RIGHT);
set_window ("Browser Main Window", 1);
menu_select_item ("TortoiseSVN;item_0");
wait(1);
}
else
{
report_msg("SVN has the new version,please recover it!");
# 执行recoverd
set_window ("html_frame", 2);
obj_mouse_click ("SysListView32", 47, 191, RIGHT);
set_window ("Browser Main Window", 1);
menu_select_item ("TortoiseSVN;item_1");
}
}
if(win_exists("{class:window,label:URL,MSW_class:\"#32770\"}")==E_OK)
{
set_window ("URL", 16);
list_select_item ("URL:_0", "#0");
wait(1);
button_press ("OK");
}
wait(5);
# 进入SVN版本管理窗口,进行选择需要更新的版本界面
win_activate ("Repository Browser");
set_window ("Repository Browser", 3);
obj_mouse_dbl_click ("MFCReportCtrl", 129, 24, LEFT);
obj_mouse_dbl_click ("MFCReportCtrl", 129, 24, LEFT);
obj_mouse_dbl_click ("MFCReportCtrl", 103, 144, LEFT);
obj_mouse_dbl_click ("MFCReportCtrl", 111, 178, LEFT);
obj_mouse_dbl_click ("MFCReportCtrl", 119, 278, LEFT);
obj_mouse_dbl_click ("MFCReportCtrl", 125, 330, LEFT);
obj_mouse_dbl_click ("MFCReportCtrl", 142, 348, LEFT);
win_activate ("Repository Browser");
set_window ("Repository Browser", 1);
obj_mouse_click ("MFCReportCtrl", 231, 343, RIGHT);
win_mouse_click ("Repository Browser", 279, 454);
#找到新的版本后,更新到本地PC上
set_window ("{class: window, label: Checkout, MSW_class: \"#32770\"}", 2);
edit_set ("{class:edit,attached_text:\"Checkout directory:\"}", "E:\\test_tools\\test_svn");
wait(1);
button_press ("OK");
#如果是重命名,那么采取覆盖的形式
if(win_exists("{class:window,label:TortoiseSVN,MSW_class:\"#32770\"}")==E_OK)
{
set_window("TortoiseSVN");
button_press("Yes");
# svn://10.1.1.19/megaeye/test enviornment/executable and resource files/server application/trunk/bootrom - TortoiseSVN Export... Finished!
set_window ("svn://10.1.1.19/megaeye/test enviornment/executable and resource files/server application/trunk/bootrom - TortoiseSVN Checkout... Finished!", 2);
wait(3);
}
set_window ("svn://10.1.1.19/megaeye/test enviornment/executable and resource files/server application/trunk/bootrom - TortoiseSVN Checkout... Finished!", 2);
button_press ("OK");
wait(1);
win_close("{class:window,label:\"Repository Browser\",MSW_class:\"#32770\"}");
GUI_close(".\\svn_test\\svn.gui"); |
|