diff --git a/0-Datadriven/2.1-APPlogin.robot b/0-Datadriven/2.1-APPlogin.robot index 471fcd1..7e31eec 100644 --- a/0-Datadriven/2.1-APPlogin.robot +++ b/0-Datadriven/2.1-APPlogin.robot @@ -26,11 +26,11 @@ login_token Set Global Variable ${userId} Set Global Variable ${gettoken} #Execl写入数据 - Open Excel D:\\LYL\\Study\\Robot_framework\\New_Trading\\数据驱动.xls + Open Excel D:\\LYL\\Study\\Robot_framework\\space\\ztb-ops-rf-api\\数据驱动.xls Put String To Cell ztbsc 3 7 {'Content-Type':'application/json','Authorization':'QNT ${gettoken}','X-APP-ID':'470236309865238528'} #写入移动端请求头数据 Save Excel DatadrivenC-1.xls #数据驱动 - Open Excel D:\\LYL\\Study\\Robot_framework\\New_Trading\\DatadrivenC-1.xls + Open Excel D:\\LYL\\Study\\Robot_framework\\space\\ztb-ops-rf-api\\DatadrivenC-1.xls ${client_firstlogin_header} Read Cell Data By Name ztbsc D8 #客户端首次登录header Set Global Variable ${client_firstlogin_header} sleep 0.5 @@ -55,11 +55,11 @@ get_baseInfo Set Global Variable ${packerName} Set Global Variable ${orgfullName} #Execl写入数据 - Open Excel D:\\LYL\\Study\\Robot_framework\\New_Trading\\数据驱动.xls + Open Excel D:\\LYL\\Study\\Robot_framework\\space\\ztb-ops-rf-api\\数据驱动.xls Put String To Cell ztbsc 3 1 {'Content-Type':'application/json','Authorization':'QNT ${gettoken}','X-APP-ID':'470236309865238528','X-ORGANIZATION-ID':'${orgId}','X-PACKING-FACTORY-ID':'${packerId}'} #写入移动端请求头数据 Save Excel DatadrivenB-1.xls #数据驱动 - Open Excel D:\\LYL\\Study\\Robot_framework\\New_Trading\\DatadrivenB-1.xls + Open Excel D:\\LYL\\Study\\Robot_framework\\space\\ztb-ops-rf-api\\DatadrivenB-1.xls ${client_headerP} Read Cell Data By Name ztbsc D2 #客户端首次登录header Set Global Variable ${client_headerP} sleep 0.5 diff --git a/0-Datadriven/2.2-APPlogin.robot b/0-Datadriven/2.2-APPlogin.robot index 716e8f9..b2f31a5 100644 --- a/0-Datadriven/2.2-APPlogin.robot +++ b/0-Datadriven/2.2-APPlogin.robot @@ -26,11 +26,11 @@ login_token Set Global Variable ${userId} Set Global Variable ${gettoken} #Execl写入数据 - Open Excel D:\\LYL\\Study\\Robot_framework\\New_Trading\\数据驱动.xls + Open Excel D:\\LYL\\Study\\Robot_framework\\space\\ztb-ops-rf-api\\数据驱动.xls Put String To Cell ztbsc 3 7 {'Content-Type':'application/json','Authorization':'QNT ${gettoken}','X-APP-ID':'470236309865238528'} #写入移动端请求头数据 Save Excel DatadrivenC-2.xls #数据驱动 - Open Excel D:\\LYL\\Study\\Robot_framework\\New_Trading\\DatadrivenC-2.xls + Open Excel D:\\LYL\\Study\\Robot_framework\\space\\ztb-ops-rf-api\\DatadrivenC-2.xls ${client_firstlogin_header} Read Cell Data By Name ztbsc D8 #客户端首次登录header Set Global Variable ${client_firstlogin_header} sleep 0.5 @@ -55,11 +55,11 @@ get_baseInfo Set Global Variable ${packerName} Set Global Variable ${orgfullName} #Execl写入数据 - Open Excel D:\\LYL\\Study\\Robot_framework\\New_Trading\\数据驱动.xls + Open Excel D:\\LYL\\Study\\Robot_framework\\space\\ztb-ops-rf-api\\数据驱动.xls Put String To Cell ztbsc 3 1 {'Content-Type':'application/json','Authorization':'QNT ${gettoken}','X-APP-ID':'470236309865238528','X-ORGANIZATION-ID':'${orgId}','X-PACKING-FACTORY-ID':'${packerId}'} #写入移动端请求头数据 Save Excel DatadrivenB-2.xls #数据驱动 - Open Excel D:\\LYL\\Study\\Robot_framework\\New_Trading\\DatadrivenB-2.xls + Open Excel D:\\LYL\\Study\\Robot_framework\\space\\ztb-ops-rf-api\\DatadrivenB-2.xls ${client_headerT} Read Cell Data By Name ztbsc D2 #客户端首次登录header Set Global Variable ${client_headerT} sleep 0.5 diff --git a/0-Datadriven/3-WebLogin.robot b/0-Datadriven/3-WebLogin.robot index 86422ec..6d9784e 100644 --- a/0-Datadriven/3-WebLogin.robot +++ b/0-Datadriven/3-WebLogin.robot @@ -25,11 +25,11 @@ Papermill_Login Set Global Variable ${PM_userId} Set Global Variable ${PM_token} #Execl写入数据 - Open Excel D:\\LYL\\Study\\Robot_framework\\New_Trading\\数据驱动.xls + Open Excel D:\\LYL\\Study\\Robot_framework\\space\\ztb-ops-rf-api\\数据驱动.xls Put String To Cell ztbsc 3 20 {'Content-Type':'application/json','Authorization':'QNT ${PM_token}','X-APP-ID':'503258978847966406'} #写入纸厂端请求头数据 Save Excel Datadriven.xls #数据驱动 - Open Excel D:\\LYL\\Study\\Robot_framework\\New_Trading\\Datadriven.xls + Open Excel D:\\LYL\\Study\\Robot_framework\\space\\ztb-ops-rf-api\\Datadriven.xls ${ztbsc_papermill_header} Read Cell Data By Name ztbsc D21 #纸厂端header Set Global Variable ${ztbsc_papermill_header} sleep 0.5 @@ -44,11 +44,11 @@ Papermill_Login END Set Global Variable ${papermill_name} #Execl写入数据 - Open Excel D:\\LYL\\Study\\Robot_framework\\New_Trading\\数据驱动.xls + Open Excel D:\\LYL\\Study\\Robot_framework\\space\\ztb-ops-rf-api\\数据驱动.xls Put String To Cell ztbsc 3 20 {'Content-Type':'application/json','Authorization':'QNT ${PM_token}','X-APP-ID':'503258978847966406','X-ORGANIZATION-ID':'${papermill_orgId}'} #写入纸厂端请求头数据 Save Excel DatadrivenP.xls #数据驱动 - Open Excel D:\\LYL\\Study\\Robot_framework\\New_Trading\\DatadrivenP.xls + Open Excel D:\\LYL\\Study\\Robot_framework\\space\\ztb-ops-rf-api\\DatadrivenP.xls ${ztbsc_papermill_header} Read Cell Data By Name ztbsc D21 #纸厂端header Set Global Variable ${ztbsc_papermill_header} sleep 0.5 @@ -71,11 +71,11 @@ Factoring_Login Set Global Variable ${F_userId} Set Global Variable ${F_token} #Execl写入数据 - Open Excel D:\\LYL\\Study\\Robot_framework\\New_Trading\\数据驱动.xls + Open Excel D:\\LYL\\Study\\Robot_framework\\space\\ztb-ops-rf-api\\数据驱动.xls Put String To Cell ztbsc 3 24 {'Content-Type':'application/json','Authorization':'QNT ${F_token}','X-APP-ID':'503258978847966410','X-ORGANIZATION-ID':'710132392618233856'} #写入保理商端请求头数据 Save Excel DatadrivenF.xls #数据驱动 - Open Excel D:\\LYL\\Study\\Robot_framework\\New_Trading\\DatadrivenF.xls + Open Excel D:\\LYL\\Study\\Robot_framework\\space\\ztb-ops-rf-api\\DatadrivenF.xls ${ztbsc_factoring_header} Read Cell Data By Name ztbsc D25 #保理商端header ${ztbsc_factoring_login_header} Read Cell Data By Name ztbsc D23 #保理商端登录header Set Global Variable ${ztbsc_factoring_header} diff --git a/Datadriven.xls b/Datadriven.xls index 51d1207..5f8ee34 100644 Binary files a/Datadriven.xls and b/Datadriven.xls differ diff --git a/DatadrivenB-1.xls b/DatadrivenB-1.xls index af89b36..f421ec0 100644 Binary files a/DatadrivenB-1.xls and b/DatadrivenB-1.xls differ diff --git a/DatadrivenB-2.xls b/DatadrivenB-2.xls index 90dd0e9..37d1751 100644 Binary files a/DatadrivenB-2.xls and b/DatadrivenB-2.xls differ diff --git a/DatadrivenC-1.xls b/DatadrivenC-1.xls index fd67012..d6b95e2 100644 Binary files a/DatadrivenC-1.xls and b/DatadrivenC-1.xls differ diff --git a/DatadrivenC-2.xls b/DatadrivenC-2.xls index 7da9d67..fb0cc61 100644 Binary files a/DatadrivenC-2.xls and b/DatadrivenC-2.xls differ diff --git a/DatadrivenF.xls b/DatadrivenF.xls index d2042da..aa50754 100644 Binary files a/DatadrivenF.xls and b/DatadrivenF.xls differ diff --git a/DatadrivenP.xls b/DatadrivenP.xls index 62f63e0..19d9fd9 100644 Binary files a/DatadrivenP.xls and b/DatadrivenP.xls differ diff --git a/DatadrivenT.xls b/DatadrivenT.xls index 2d53e1d..8e976c7 100644 Binary files a/DatadrivenT.xls and b/DatadrivenT.xls differ diff --git a/RF-TEST/0-Data driven/dataDriven.robot b/RF-TEST/0-Data driven/dataDriven.robot index bf50b13..7c6739a 100644 --- a/RF-TEST/0-Data driven/dataDriven.robot +++ b/RF-TEST/0-Data driven/dataDriven.robot @@ -6,6 +6,7 @@ Library Collections Library RequestsLibrary Library urllib3 Library DatabaseLibrary +Library MockServerLibrary *** Test Cases *** ztbsc @@ -128,12 +129,15 @@ ztbsc #... # ELSE log true #IF,ELSE IF语句 [3041,3042,3043,3044] - ${ServiceFeeType} Set Variable [3041,3042,3043,3044] - ${ServiceFeeType} Evaluate random.choice(${ServiceFeeType}) random #保理服务费类型 - Run Keyword If ${ServiceFeeType}==3041 Run Keyword ServiceFee3041 - ... ELSE IF ${ServiceFeeType}==3042 Run Keyword ServiceFee3042 - ... ELSE IF ${ServiceFeeType}==3043 Run Keyword ServiceFee3043 - ... ELSE ${ServiceFeeType}==3044 Run Keyword ServiceFee3044 + #${ServiceFeeType} Set Variable [3041,3042,3043,3044] + #${ServiceFeeType} Evaluate random.choice(${ServiceFeeType}) random #保理服务费类型 + #Run Keyword If ${ServiceFeeType}==3041 Run Keyword ServiceFee3041 + # ELSE IF ${ServiceFeeType}==3042 Run Keyword ServiceFee3042 # ELSE IF ${ServiceFeeType}==3043 Run Keyword ServiceFee3043 # ELSE ${ServiceFeeType}==3044 Run Keyword ServiceFee3044 + #Mock + #Make Headers + Create Mock Session login + Create Mock Request Matcher post recycle-service/admin/login form-data username=laiyonglan@qniao.cn password=qn123456 + Create Mock Response 200 *** Keywords *** ServiceFee3041 diff --git a/RF-TEST/2-Platform/0-login.robot b/RF-TEST/2-Platform/0-login.robot index f2a4650..c6c8ed5 100644 --- a/RF-TEST/2-Platform/0-login.robot +++ b/RF-TEST/2-Platform/0-login.robot @@ -10,3 +10,4 @@ pwlogin Create Session ZTBSC ${ztbops} ${ztbsc_ops_login_header} ${data} Create Dictionary username=${ztbsc_account} password=${ztbsc_password} ${reps} Post On Session ZTBSC recycle-service/admin/login params=${data} + Should Be Equal As Strings ${reps.json()['message']} 登陆成功 diff --git a/RF-TEST/2-Platform/Auction.robot b/RF-TEST/2-Platform/Auction.robot index 81fe199..9d298ed 100644 --- a/RF-TEST/2-Platform/Auction.robot +++ b/RF-TEST/2-Platform/Auction.robot @@ -79,13 +79,13 @@ auction_detail ${Num} Evaluate random.randint(1,6) random #获取随机数字 ${bidders_List} Evaluate random.sample(${List},${Num}) random #获取多个竞拍人员id ${BList} Convert To String ${bidders_List} - ${BiddersList} Replace String Using Regexp ${BList} ' \ + ${BiddersList} Replace String Using Regexp ${BList} ' ${EMPTY} #获取时间 ${time} Get Current Date result_format=%Y-%m-%d %H:%M:00 #获取当前时间 ${start_time} Add Time To Date ${time} 00:05:00 #获取未来两小时 ${start_time} Get Substring ${start_time} 0 19 #截取正常时间时间 - #${end_time} Add Time To Date ${time} 1 day #获取第二天当前时间 - ${end_time} Add Time To Date ${time} 00:10:00 + ${end_time} Add Time To Date ${time} 1 day #获取第二天当前时间 + #${end_time} Add Time To Date ${time} 00:10:00 ${end_time} Get Substring ${end_time} 0 19 #截取正常时间时间 #保存拍品规则 ${bidScale} Evaluate random.randint(1,10) random #加价幅度