*** Variables *** ${TestData_System_Code_1} _elisa_SC1 # 測試資料 系統內碼 ${TestData_Organization_Code_1} _elisa_OC1 # 測試資料 機構代碼 ${TestData_Organization_Name_1} _elisa_ON1 # 測試資料 機構名稱 ${TestData_Organization_Address_1} TestData_Organization_Address_1. # 測試資料 機構地址 ${TestData_Contact_Phone_1} TestData_Contact_Phone_1 # 測試資料 連絡電話 ${TestData_Contact_Email_1} TestData_Contact_Email_1@yamail.com # 測試資料 聯絡信箱 ${TestData_Announcement_1} TestData_Announcement_1 # 測試資料 公告訊息 *** Test Cases *** Verify DB Records #Resources有引用Database.robot才能直接呼叫此keywords Connect Database ${queryBasic_Hospital_TestData_1}= Set Variable select * from Basic_Hospital where hospital_code='${TestData_System_Code_1}' nhi_code='${TestData_Organization_Code_1}' and and hospital_name ='${TestData_Organization_Name_1}' and addr='${TestData_Organization_Address_1}' and phone='${TestData_Contact_Phone_1}' and email='${TestData_Contact_Email_1}' and active_flag=1 and announcement='${TestData_Announcement_1}' and is_chk_hosp= 'Y' Log Verify 資料庫是否有指定的資料 Check If Exists In DataBase ${queryBasic_Hospital_TestData_1}
Database.robot內容
*** Variables *** ${DBModuleName} pymssql ${DBName} databasename ${DBUser} user ${DBPassword} password ${DBHost} 10.10.10.10 ${DBPort} 443 ${Charset} utf8 *** Keywords *** Connect Database Connect To Database Using Custom Params ${DBModuleName} database='${DBName}', user='${DBUser}', password='${DBPassword}', host='${DBHost}', port=${DBPort}, charset='${Charset}'
順帶一提
#檢查要存在資料庫才pass Check If Exists In DataBase #檢查不要存在資料庫才pass Check If Not Exists In Database
沒有留言:
張貼留言