commit 88b02be430df7ebf68eb99c15591db650afadb7b Author: LG_lai Date: Fri Mar 8 09:56:27 2024 +0800 no message diff --git a/DA_data.yaml b/DA_data.yaml new file mode 100644 index 0000000..013bb02 --- /dev/null +++ b/DA_data.yaml @@ -0,0 +1,10 @@ +婚介: + UEC域名: https://dating-agency-api-test.qniao.cn + Client域名: + Header: {'Content-Type':'application/json','X-APP-ID':'50325897884795880'} + + + +用户: + 手机号: 15014242835 + 验证码: 888888 \ No newline at end of file diff --git a/InsertData.robot b/InsertData.robot new file mode 100644 index 0000000..665e01b --- /dev/null +++ b/InsertData.robot @@ -0,0 +1,45 @@ +*** Settings *** +Library Collections +Library ExcelLibrary +Library DatabaseLibrary + +*** Test Cases *** +ReadData + Import Variables D:\\LYL\\Study\\Ptest\\用户资料\\Execl.py + #${DList} Set Variable ${cap} + log ${phone_list} + LOG ${phone} + FOR ${P} IN RANGE ${phone_list} + END + LOG ${P} + +Connect_Database + [Documentation] 连接数据库 + #连接数据库 + Connect To Database Using Custom Params pymysql database='dating-agency-service',user='root',password='qniaothreetwoonego',host='8.135.8.221' + ${UserData} Query SELECT * FROM `uec`.`qn_account` WHERE `tid` = '13517986787' AND `is_delete` = '0' + ${accountId} Set Variable ${UserData[0][0]} + Disconnect From Database + +ReadData-1 + #读取execl表数据 + Open Excel D:\\LYL\\Study\\Robot_framework\\space\\Dating-Agency\\相亲用户资料.xls + ${rowCount} Get Row Count 用户资料 #获取表行数 + ${List} Create List + FOR ${x} IN RANGE ${rowCount -1} #读取count-1行,不读取首行 + ${read_row} Get Row Values 用户资料 ${x+1} #1代表execl的第一行,读完${rowCount}是一个list + Set Suite Variable ${read_row} + #\ Insert_Into_List ${List} ${x} ${row_list} + #${Count_List} Evaluate len(${List}) + #Set Suite Variable ${Count_List} + #Set Suite Variable ${List} + +*** Keywords *** +Keyword + #处理每行的List + ${row_list} Create List + ${count_column} Get Column Count 用户资料 #获取表列数 + @{int_values_index} Create List ${1} ${2} ${3} ${4} ${5} ${7} ${9} ${10} ${11} ${12} + FOR ${i} IN RANGE ${count_column} #循环文本列数 + ${row_values} Set Variable ${read_row[${i}][1]} + ${if_empty} Run Keyword And Return Status Should Be Equal As Strings ${row_values} ${empty} #判断是否为空 diff --git a/Login/PhoneLogin.robot b/Login/PhoneLogin.robot new file mode 100644 index 0000000..1c5b553 --- /dev/null +++ b/Login/PhoneLogin.robot @@ -0,0 +1,9 @@ +*** Settings *** +Suite Setup Set Library Search Order AppiumLibrary | Selenium2Library +Library AppiumLibrary + +*** Test Cases *** +PLogin + Open Application http://127.0.0.1:4723/wd/hub platformName=Android platformVersion=11 deviceName=Z9Z5YTCIU8NRAQZX + sleep 10 + Close Application diff --git a/Login/__init__.robot b/Login/__init__.robot new file mode 100644 index 0000000..e69de29 diff --git a/相亲用户资料.xls b/相亲用户资料.xls new file mode 100644 index 0000000..25ddbb3 Binary files /dev/null and b/相亲用户资料.xls differ