diff --git a/000_get_current_datetime.robot b/000_get_current_datetime.robot new file mode 100644 index 0000000..47b432d --- /dev/null +++ b/000_get_current_datetime.robot @@ -0,0 +1,10 @@ +*** Settings *** +Library DateTime + +*** Test Cases *** +current_datetime + ${current_time} Get Current Date + log ${current_time} + ${current_date} Convert Date ${current_time} result_format=%Y-%m-%d + log ${current_date} + Set Global Variable ${current_date} diff --git a/001_login_get_info/login_customer.robot b/001_login_get_info/login_customer.robot index 0cec788..a2a9aba 100644 --- a/001_login_get_info/login_customer.robot +++ b/001_login_get_info/login_customer.robot @@ -15,7 +15,9 @@ customer_phone #创建会话 会话别名 baseurl headers Create Session uecclient ${uecclient} headers=${cloud_factory_customer_header} #变量名称 设置用例变量 变量值 - ${body} Set Variable {"accountType":2,"account":"13800138003","captcha":"888888"} + ${accounttype} Set Variable 2 #账号类型 1微信 2手机号 3邮箱 4苹果 5自定义账号 + ${account} Set Variable 13800138003 + ${body} Set Variable {"accountType":${accounttype},"account":"${account}","captcha":"888888"} #变量接收响应结果 post请求 会话别名 uri 传参 ${response} POST On Session uecclient /uec/authorize/by-captcha ${body} #日志 @@ -41,7 +43,7 @@ customer_phone #设置token变量 Set Suite Variable ${userid_customer} #设置带token的请求头 - &{cloudfactorycustomerheader} Create Dictionary Content-Type=application/json;charset=UTF-8 Content-Type=application/json;charset=UTF-8 + &{cloudfactorycustomerheader} Create Dictionary Content-Type=application/json;charset=UTF-8 X-APP-ID=503258978847965388 Authorization=${gettoken_customer} #设置token变量 Set Suite Variable ${cloudfactorycustomerheader} diff --git a/001_login_get_info/login_operate.robot b/001_login_get_info/login_operate.robot index 3975148..9930a11 100644 --- a/001_login_get_info/login_operate.robot +++ b/001_login_get_info/login_operate.robot @@ -11,7 +11,9 @@ ${yytops} https://api-ops-yyt-test.qniao.cn operate_mail Disable Warnings Create Session yytops ${yytops} headers=${operation_backend_header} - &{body} Create Dictionary username=liangjinman@qniao.cn password=qn123456 + ${username} Set Variable liangjinman@qniao.cn + ${password} Set Variable qn123456 + &{body} Create Dictionary username=${username} password=${password} ${response} POST On Session yytops /cloud-factory-operation-backend/admin/login ${body} Log ${response.status_code} Log ${response.json()} @@ -21,7 +23,7 @@ operate_mail log ${gettoken_operate} Set Global Variable ${gettoken_operate} &{operationbackend_header} Create Dictionary Content-Type=application/json;charset=UTF-8 X-APP-ID=503258978847952999 Authorization=${gettoken_operate} - Set Suite Variable ${operationbackend_header} + Set Global Variable ${operationbackend_header} get_operate_userinfo Create Session yytops ${yytops} headers=${operationbackend_header} @@ -30,5 +32,8 @@ get_operate_userinfo log ${response.json()} Should Be Equal As Numbers 200 ${response.status_code} Should Be Equal As Strings successful ${response.json()["message"]} - Should Be Equal As Strings 498985714734731264 ${response.json()["data"]["adminId"]} Should Be Equal As Strings 管理员 ${response.json()["data"]["positionList"][0]["name"]} + ${operate_adminid} Get From Dictionary ${response.json()["data"]} adminId + ${operate_adminname} Get From Dictionary ${response.json()["data"]} name + Set Global Variable ${operate_adminid} + Set Global Variable ${operate_adminname} diff --git a/001_login_get_info/login_operate_psc.robot b/001_login_get_info/login_operate_psc.robot index 5b87ef0..e6c2779 100644 --- a/001_login_get_info/login_operate_psc.robot +++ b/001_login_get_info/login_operate_psc.robot @@ -11,7 +11,9 @@ ${pscops} https://api-ops-psc-test.qniao.cn operate_mail Disable Warnings Create Session pscops ${pscops} headers=${operation_psc_header} - &{body} Create Dictionary username=liangjinman@qniao.cn password=qn123456 + ${username} Set Variable liangjinman@qniao.cn + ${password} Set Variable qn123456 + &{body} Create Dictionary username=${username} password=${password} ${response} POST On Session pscops /payment-settlement-center/admin/login ${body} Log ${response.status_code} Log ${response.json()} diff --git a/001_login_get_info/login_supplier.robot b/001_login_get_info/login_supplier.robot index 2f8c2d7..83cba7a 100644 --- a/001_login_get_info/login_supplier.robot +++ b/001_login_get_info/login_supplier.robot @@ -15,7 +15,9 @@ supplier_phone #创建会话 会话别名 baseurl headers Create Session uecclient ${uecclient} headers=${cloud_factory_supplier_header} #变量名称 设置用例变量 变量值 - ${body} Set Variable {"accountType":2,"account":"13849849646","captcha":"888888"} + ${accounttype} Set Variable 2 #账号类型 1微信 2手机号 3邮箱 4苹果 5自定义账号 + ${account} Set Variable 19898227722 + ${body} Set Variable {"accountType":${accounttype},"account":"${account}","captcha":"888888"} #变量接收响应结果 post请求 会话别名 uri 传参 ${response} POST On Session uecclient /uec/authorize/by-captcha ${body} #日志 diff --git a/001_login_get_info/login_supplier_focus.robot b/001_login_get_info/login_supplier_focus.robot index a2e56b0..050ca69 100644 --- a/001_login_get_info/login_supplier_focus.robot +++ b/001_login_get_info/login_supplier_focus.robot @@ -15,7 +15,9 @@ supplier_focus_phone #创建会话 会话别名 baseurl headers Create Session uecclient ${uecclient} headers=${cloud_factory_supplier_focus_header} #变量名称 设置用例变量 变量值 - ${body} Set Variable {"accountType":2,"account":"18219557422","captcha":"888888"} + ${accounttype} Set Variable 2 #账号类型 1微信 2手机号 3邮箱 4苹果 5自定义账号 + ${account} Set Variable 18219557422 + ${body} Set Variable {"accountType":${accounttype},"account":"${account}","captcha":"888888"} #变量接收响应结果 post请求 会话别名 uri 传参 ${response} POST On Session uecclient /uec/authorize/by-captcha ${body} #日志 diff --git a/002_user_register/customer_user_register.robot b/002_user_register/customer_user_register.robot index 49bb4d9..917ad53 100644 --- a/002_user_register/customer_user_register.robot +++ b/002_user_register/customer_user_register.robot @@ -1,4 +1,5 @@ *** Settings *** +Library DatabaseLibrary Library RequestsLibrary Library Collections Library urllib3 @@ -7,5 +8,169 @@ Library urllib3 &{cloud_factory_customer_header} Content-Type=application/json;charset=UTF-8 X-APP-ID=503258978847965388 ${uecclient} https://api-client-uec-test.qniao.cn ${yytclient} https://api-client-yyt-test.qniao.cn +${yytops} https://api-ops-yyt-test.qniao.cn *** Test Cases *** +customer_phone_captcha + Disable Warnings + Create Session uecclient ${uecclient} headers=${cloud_factory_customer_header} + ${accounttype} Set Variable 2 #账号类型 1微信 2手机号 3邮箱 4苹果 5自定义账号 + ${account} Set Variable 13012345678 + ${body} Set Variable {"accountType":${accounttype},"account":"${account}","captcha":"888888"} + Set Suite Variable ${account} + ${response} POST On Session uecclient /uec/authorize/by-captcha ${body} + Log ${response.status_code} + Log ${response.text} + Log ${response.json()} + Should Be Equal As Numbers 200 ${response.status_code} + Should Be Equal As Strings successful ${response.json()["message"]} + ${gettoken_customer} Get From Dictionary ${response.json()["data"]} token + log ${gettoken_customer} + Set Suite Variable ${gettoken_customer} + ${userid_customer} Get From Dictionary ${response.json()["data"]} userId + log ${userid_customer} + #未转业务线token + Set Suite Variable ${userid_customer} + &{cloudfactorycustomerheader} Create Dictionary Content-Type=application/json;charset=UTF-8 X-APP-ID=503258978847965388 Authorization=${gettoken_customer} + Set Suite Variable ${cloudfactorycustomerheader} + +customerclue_customer + Disable Warnings + Create Session yytclient ${yytclient} headers=${cloudfactorycustomerheader} + ${customer_companyname} Set Variable autotest_companyname_customer + ${customer_enterprisetype} Set Variable 2 #企业类型 1云印客户 2印刷包装厂 3造纸厂 4打包厂 5原纸供应商 6设备供应商 7其他 + ${customer_job} Set Variable autotest_job_customer + ${customer_name} Set Variable autotest_name_customer + ${body} Set Variable {"companyName": "${customer_companyname}","enterpriseType": ${customer_enterprisetype},"job": "${customer_job}","name": "${customer_name}"} + Set Suite Variable ${customer_companyname} + Set Suite Variable ${customer_enterprisetype} + Set Suite Variable ${customer_job} + Set Suite Variable ${customer_name} + ${response} POST On Session yytclient /cloud-print-user-center/save/customerclue ${body.encode("utf8")} + Log ${response.status_code} + Log ${response.json()} + Should Be Equal As Numbers 200 ${response.status_code} + Should Be Equal As Strings successful ${response.json()["message"]} + sleep 1 + +customer_login_token + Disable Warnings + Create Session yytclient ${yytclient} headers=${cloudfactorycustomerheader} + ${body} Set Variable {"loginToken":"${gettoken_customer}"} + ${response} POST On Session yytclient /cloud-print-user-center/authorize/get/product-line-token/by/login-token ${body.encode("utf8")} + Log ${response.status_code} + Log ${response.json()} + Should Be Equal As Numbers 200 ${response.status_code} + Should Be Equal As Strings successful ${response.json()["message"]} + ${getlogintoken_customer} Get From Dictionary ${response.json()} data + log ${getlogintoken_customer} + #全局token + Set Global Variable ${getlogintoken_customer} + &{cloudfactory_customer_header} Create Dictionary Content-Type=application/json;charset=UTF-8 X-APP-ID=503258978847965388 Authorization=${getlogintoken_customer} + Set Suite Variable ${cloudfactory_customer_header} + +get_customerclue_customer + Create Session yytclient ${yytclient} headers=${cloudfactory_customer_header} + ${response} Get On Session yytclient /cloud-print-user-center/get/my/customerclue + Log ${response.status_code} + log ${response.json()} + Should Be Equal As Numbers 200 ${response.status_code} + Should Be Equal As Strings successful ${response.json()["message"]} + Should Be Equal As Strings ${customer_companyname} ${response.json()["data"]["companyName"]} + Should Be Equal As Numbers ${customer_enterprisetype} ${response.json()["data"]["enterpriseType"]} + Should Be Equal As Strings ${customer_job} ${response.json()["data"]["job"]} + Should Be Equal As Strings ${customer_name} ${response.json()["data"]["name"]} + Should Be Equal As Strings ${account} ${response.json()["data"]["mobile"]} + +customerclue_verify_have_join_customer + Create Session yytclient ${yytclient} headers=${cloudfactory_customer_header} + ${response} POST On Session yytclient /cloud-print-user-center/verify/have-join-and-fill + Log ${response.status_code} + log ${response.json()} + Should Be Equal As Strings False ${response.json()["data"]} #是否加入企业 False未加入 True已加入 + +customerclue_uploadpictures_customer + Disable Warnings + Create Session yytclient ${yytclient} headers=${cloudfactory_customer_header} + ${customer_businesslicense} Set Variable https://qncloudprintfiletest.oss-cn-shenzhen.aliyuncs.com/cloudprint/1632378545847.jpg + ${customer_idcardback} Set Variable https://qncloudprintfiletest.oss-cn-shenzhen.aliyuncs.com/cloudprint/1632378545847.jpg + ${customer_idcardfront} Set Variable https://qncloudprintfiletest.oss-cn-shenzhen.aliyuncs.com/cloudprint/1632378545847.jpg + ${customerclue_type} Set Variable 1 #线索类型 1企业认证 2授信申请 + ${body} Set Variable {"businessLicense": "${customer_businesslicense}","idCardBack": "${customer_idcardback}","idCardFront": "${customer_idcardfront}","type": ${customerclue_type}} + ${response} POST On Session yytclient /cloud-print-user-center/customerclue/upload-pictures ${body.encode("utf8")} + Log ${response.status_code} + Log ${response.json()} + Should Be Equal As Numbers 200 ${response.status_code} + Should Be Equal As Strings successful ${response.json()["message"]} + +get_user_register_list + Create Session yytops ${yytops} headers=${operationbackend_header} + ${response} Get On Session yytops /cloud-print-user-center/admin/user/get/user-list + Log ${response.status_code} + log ${response.json()} + Should Be Equal As Numbers 200 ${response.status_code} + Should Be Equal As Strings successful ${response.json()["message"]} + Should Be Equal As Strings ${account} ${response.json()["data"]["records"][0]["mobile"]} + +get_user_register_search + Create Session yytops ${yytops} headers=${operationbackend_header} + ${param} Set Variable createTimeBegin=${current_date}&createTimeEnd=${current_date}&mobile=${account} + ${response} Get On Session yytops /cloud-print-user-center/admin/user/get/user-list params=${param} + Log ${response.status_code} + log ${response.json()} + Should Be Equal As Numbers 200 ${response.status_code} + Should Be Equal As Strings successful ${response.json()["message"]} + Should Be Equal As Strings ${account} ${response.json()["data"]["records"][0]["mobile"]} + +get_customerclue_list + Create Session yytops ${yytops} headers=${operationbackend_header} + ${response} Get On Session yytops /cloud-print-user-center/admin/get/customerclue/page + Log ${response.status_code} + log ${response.json()} + Should Be Equal As Numbers 200 ${response.status_code} + Should Be Equal As Strings successful ${response.json()["message"]} + Should Be Equal As Strings ${account} ${response.json()["data"]["records"][0]["mobile"]} + Should Be Equal As Strings ${customer_companyname} ${response.json()["data"]["records"][0]["companyName"]} + Should Be Equal As Numbers ${customer_enterprisetype} ${response.json()["data"]["records"][0]["enterpriseType"]} + Should Be Equal As Strings ${customer_job} ${response.json()["data"]["records"][0]["job"]} + Should Be Equal As Strings ${customer_name} ${response.json()["data"]["records"][0]["name"]} + Should Be Equal As Strings ${userid_customer} ${response.json()["data"]["records"][0]["userId"]} + +get_customerclue_search + Create Session yytops ${yytops} headers=${operationbackend_header} + ${param} Set Variable status=1 #客户线索状态 1待处理 2已处理 + ${response} Get On Session yytops /cloud-print-user-center/admin/get/customerclue/page params=${param} + Log ${response.status_code} + log ${response.json()} + Should Be Equal As Numbers 200 ${response.status_code} + Should Be Equal As Strings successful ${response.json()["message"]} + Should Be Equal As Strings ${account} ${response.json()["data"]["records"][0]["mobile"]} + Should Be Equal As Strings ${customer_companyname} ${response.json()["data"]["records"][0]["companyName"]} + Should Be Equal As Numbers ${customer_enterprisetype} ${response.json()["data"]["records"][0]["enterpriseType"]} + Should Be Equal As Strings ${customer_job} ${response.json()["data"]["records"][0]["job"]} + Should Be Equal As Strings ${customer_name} ${response.json()["data"]["records"][0]["name"]} + Should Be Equal As Strings ${userid_customer} ${response.json()["data"]["records"][0]["userId"]} + ${customerclue_id} Get From Dictionary ${response.json()["data"]["records"][0]} id + Set Global Variable ${customerclue_id} + +operate_handle_customerclue + Create Session yytops ${yytops} headers=${operationbackend_header} + ${customerclue_remark} Set Variable autotest_customerclue_remark + ${body} Set Variable {"id":"${customerclue_id}","adminId":"${operate_adminid}","name":"${operate_adminname}","remark":"${customerclue_remark}"} + ${response} POST On Session yytops /cloud-print-user-center/admin/handle/customerclue ${body.encode("utf8")} + Log ${response.status_code} + log ${response.json()} + Should Be Equal As Numbers 200 ${response.status_code} + Should Be Equal As Strings successful ${response.json()["message"]} + +database_delete_user_customerclue + Connect To Database Using Custom Params pymysql database='uec', user='root', password='password', host='8.135.8.221', port=3306, charset='utf8' + Execute Sql String update qn_account set is_delete = 1 where tid = "${account}" + ${query} Query select user_id from qn_account where tid = "${account}" + ${query_list} Get From List ${query} 0 + ${userid} Get From List ${query_list} 0 + Execute Sql String update qn_user set is_delete = 1 where id = ${userid} + sleep 1 + Connect To Database Using Custom Params pymysql database='yyt_user_center', user='root', password='password', host='8.135.8.221', port=3306, charset='utf8' + Execute Sql String update qn_customer_clue set is_delete = 1 where mobile = "${account}" + Disconnect From Database diff --git a/002_user_register/supplier_user_register.robot b/002_user_register/supplier_user_register.robot index c033c1a..b441120 100644 --- a/002_user_register/supplier_user_register.robot +++ b/002_user_register/supplier_user_register.robot @@ -1,4 +1,5 @@ *** Settings *** +Library DatabaseLibrary Library RequestsLibrary Library Collections Library urllib3 @@ -7,5 +8,169 @@ Library urllib3 &{cloud_factory_supplier_header} Content-Type=application/json;charset=UTF-8 X-APP-ID=503258978847956666 ${uecclient} https://api-client-uec-test.qniao.cn ${yytclient} https://api-client-yyt-test.qniao.cn +${yytops} https://api-ops-yyt-test.qniao.cn *** Test Cases *** +supplier_phone_captcha + Disable Warnings + Create Session uecclient ${uecclient} headers=${cloud_factory_supplier_header} + ${accounttype} Set Variable 2 #账号类型 1微信 2手机号 3邮箱 4苹果 5自定义账号 + ${account} Set Variable 13123456789 + ${body} Set Variable {"accountType":${accounttype},"account":"${account}","captcha":"888888"} + Set Suite Variable ${account} + ${response} POST On Session uecclient /uec/authorize/by-captcha ${body} + Log ${response.status_code} + Log ${response.text} + Log ${response.json()} + Should Be Equal As Numbers 200 ${response.status_code} + Should Be Equal As Strings successful ${response.json()["message"]} + ${gettoken_supplier} Get From Dictionary ${response.json()["data"]} token + log ${gettoken_supplier} + Set Suite Variable ${gettoken_supplier} + ${userid_supplier} Get From Dictionary ${response.json()["data"]} userId + log ${userid_supplier} + #未转业务线token + Set Suite Variable ${userid_supplier} + &{cloudfactorysupplierheader} Create Dictionary Content-Type=application/json;charset=UTF-8 X-APP-ID=503258978847956666 Authorization=${gettoken_supplier} + Set Suite Variable ${cloudfactorysupplierheader} + +customerclue_supplier + Disable Warnings + Create Session yytclient ${yytclient} headers=${cloudfactorysupplierheader} + ${supplier_companyname} Set Variable autotest_companyname_supplier + ${supplier_enterprisetype} Set Variable 5 #企业类型 1云印客户 2印刷包装厂 3造纸厂 4打包厂 5原纸供应商 6设备供应商 7其他 + ${supplier_job} Set Variable autotest_job_supplier + ${supplier_name} Set Variable autotest_name_supplier + ${body} Set Variable {"companyName": "${supplier_companyname}","enterpriseType": ${supplier_enterprisetype},"job": "${supplier_job}","name": "${supplier_name}"} + Set Suite Variable ${supplier_companyname} + Set Suite Variable ${supplier_enterprisetype} + Set Suite Variable ${supplier_job} + Set Suite Variable ${supplier_name} + ${response} POST On Session yytclient /cloud-print-user-center/save/customerclue ${body.encode("utf8")} + Log ${response.status_code} + Log ${response.json()} + Should Be Equal As Numbers 200 ${response.status_code} + Should Be Equal As Strings successful ${response.json()["message"]} + sleep 1 + +supplier_login_token + Disable Warnings + Create Session yytclient ${yytclient} headers=${cloudfactorysupplierheader} + ${body} Set Variable {"loginToken":"${gettoken_supplier}"} + ${response} POST On Session yytclient /cloud-print-user-center/authorize/get/product-line-token/by/login-token ${body.encode("utf8")} + Log ${response.status_code} + Log ${response.json()} + Should Be Equal As Numbers 200 ${response.status_code} + Should Be Equal As Strings successful ${response.json()["message"]} + ${getlogintoken_supplier} Get From Dictionary ${response.json()} data + log ${getlogintoken_supplier} + #全局token + Set Global Variable ${getlogintoken_supplier} + &{cloudfactory_supplier_header} Create Dictionary Content-Type=application/json;charset=UTF-8 X-APP-ID=503258978847965388 Authorization=${getlogintoken_supplier} + Set Suite Variable ${cloudfactory_supplier_header} + +get_customerclue_supplier + Create Session yytclient ${yytclient} headers=${cloudfactory_supplier_header} + ${response} Get On Session yytclient /cloud-print-user-center/get/my/customerclue + Log ${response.status_code} + log ${response.json()} + Should Be Equal As Numbers 200 ${response.status_code} + Should Be Equal As Strings successful ${response.json()["message"]} + Should Be Equal As Strings ${supplier_companyname} ${response.json()["data"]["companyName"]} + Should Be Equal As Numbers ${supplier_enterprisetype} ${response.json()["data"]["enterpriseType"]} + Should Be Equal As Strings ${supplier_job} ${response.json()["data"]["job"]} + Should Be Equal As Strings ${supplier_name} ${response.json()["data"]["name"]} + Should Be Equal As Strings ${account} ${response.json()["data"]["mobile"]} + +customerclue_verify_have_join_supplier + Create Session yytclient ${yytclient} headers=${cloudfactory_supplier_header} + ${response} POST On Session yytclient /cloud-print-user-center/verify/have-join-and-fill + Log ${response.status_code} + log ${response.json()} + Should Be Equal As Strings False ${response.json()["data"]} #是否加入企业 False未加入 True已加入 + +customerclue_uploadpictures_supplier + Disable Warnings + Create Session yytclient ${yytclient} headers=${cloudfactory_supplier_header} + ${supplier_businesslicense} Set Variable https://qncloudprintfiletest.oss-cn-shenzhen.aliyuncs.com/cloudprint/1632378545847.jpg + ${supplier_idcardback} Set Variable https://qncloudprintfiletest.oss-cn-shenzhen.aliyuncs.com/cloudprint/1632378545847.jpg + ${supplier_idcardfront} Set Variable https://qncloudprintfiletest.oss-cn-shenzhen.aliyuncs.com/cloudprint/1632378545847.jpg + ${customerclue_type} Set Variable 1 #线索类型 1企业认证 2授信申请 + ${body} Set Variable {"businessLicense": "${supplier_businesslicense}","idCardBack": "${supplier_idcardback}","idCardFront": "${supplier_idcardfront}","type": ${customerclue_type}} + ${response} POST On Session yytclient /cloud-print-user-center/customerclue/upload-pictures ${body.encode("utf8")} + Log ${response.status_code} + Log ${response.json()} + Should Be Equal As Numbers 200 ${response.status_code} + Should Be Equal As Strings successful ${response.json()["message"]} + +get_user_register_list + Create Session yytops ${yytops} headers=${operationbackend_header} + ${response} Get On Session yytops /cloud-print-user-center/admin/user/get/user-list + Log ${response.status_code} + log ${response.json()} + Should Be Equal As Numbers 200 ${response.status_code} + Should Be Equal As Strings successful ${response.json()["message"]} + Should Be Equal As Strings ${account} ${response.json()["data"]["records"][0]["mobile"]} + +get_user_register_search + Create Session yytops ${yytops} headers=${operationbackend_header} + ${param} Set Variable createTimeBegin=${current_date}&createTimeEnd=${current_date}&mobile=${account} + ${response} Get On Session yytops /cloud-print-user-center/admin/user/get/user-list params=${param} + Log ${response.status_code} + log ${response.json()} + Should Be Equal As Numbers 200 ${response.status_code} + Should Be Equal As Strings successful ${response.json()["message"]} + Should Be Equal As Strings ${account} ${response.json()["data"]["records"][0]["mobile"]} + +get_customerclue_list + Create Session yytops ${yytops} headers=${operationbackend_header} + ${response} Get On Session yytops /cloud-print-user-center/admin/get/customerclue/page + Log ${response.status_code} + log ${response.json()} + Should Be Equal As Numbers 200 ${response.status_code} + Should Be Equal As Strings successful ${response.json()["message"]} + Should Be Equal As Strings ${account} ${response.json()["data"]["records"][0]["mobile"]} + Should Be Equal As Strings ${supplier_companyname} ${response.json()["data"]["records"][0]["companyName"]} + Should Be Equal As Numbers ${supplier_enterprisetype} ${response.json()["data"]["records"][0]["enterpriseType"]} + Should Be Equal As Strings ${supplier_job} ${response.json()["data"]["records"][0]["job"]} + Should Be Equal As Strings ${supplier_name} ${response.json()["data"]["records"][0]["name"]} + Should Be Equal As Strings ${userid_supplier} ${response.json()["data"]["records"][0]["userId"]} + +get_customerclue_search + Create Session yytops ${yytops} headers=${operationbackend_header} + ${param} Set Variable status=1 #客户线索状态 1待处理 2已处理 + ${response} Get On Session yytops /cloud-print-user-center/admin/get/customerclue/page params=${param} + Log ${response.status_code} + log ${response.json()} + Should Be Equal As Numbers 200 ${response.status_code} + Should Be Equal As Strings successful ${response.json()["message"]} + Should Be Equal As Strings ${account} ${response.json()["data"]["records"][0]["mobile"]} + Should Be Equal As Strings ${supplier_companyname} ${response.json()["data"]["records"][0]["companyName"]} + Should Be Equal As Numbers ${supplier_enterprisetype} ${response.json()["data"]["records"][0]["enterpriseType"]} + Should Be Equal As Strings ${supplier_job} ${response.json()["data"]["records"][0]["job"]} + Should Be Equal As Strings ${supplier_name} ${response.json()["data"]["records"][0]["name"]} + Should Be Equal As Strings ${userid_supplier} ${response.json()["data"]["records"][0]["userId"]} + ${customerclue_id} Get From Dictionary ${response.json()["data"]["records"][0]} id + Set Global Variable ${customerclue_id} + +operate_handle_customerclue + Create Session yytops ${yytops} headers=${operationbackend_header} + ${customerclue_remark} Set Variable autotest_customerclue_remark + ${body} Set Variable {"id":"${customerclue_id}","adminId":"${operate_adminid}","name":"${operate_adminname}","remark":"${customerclue_remark}"} + ${response} POST On Session yytops /cloud-print-user-center/admin/handle/customerclue ${body.encode("utf8")} + Log ${response.status_code} + log ${response.json()} + Should Be Equal As Numbers 200 ${response.status_code} + Should Be Equal As Strings successful ${response.json()["message"]} + +database_delete_user_customerclue + Connect To Database Using Custom Params pymysql database='uec', user='root', password='password', host='8.135.8.221', port=3306, charset='utf8' + Execute Sql String update qn_account set is_delete = 1 where tid = "${account}" + ${query} Query select user_id from qn_account where tid = "${account}" + ${query_list} Get From List ${query} 0 + ${userid} Get From List ${query_list} 0 + Execute Sql String update qn_user set is_delete = 1 where id = ${userid} + sleep 1 + Connect To Database Using Custom Params pymysql database='yyt_user_center', user='root', password='password', host='8.135.8.221', port=3306, charset='utf8' + Execute Sql String update qn_customer_clue set is_delete = 1 where mobile = "${account}" + Disconnect From Database diff --git a/007_paper_variety_management/paper_category.robot b/007_paper_variety_management/paper_category.robot index 40b82ed..133b227 100644 --- a/007_paper_variety_management/paper_category.robot +++ b/007_paper_variety_management/paper_category.robot @@ -54,7 +54,5 @@ supplierfocus_disable_paper_category database_delete_paper_category Connect To Database Using Custom Params pymysql database='trading_center', user='root', password='password', host='8.135.8.221', port=3306, charset='utf8' Execute Sql String update qn_category set is_delete = 1 where id = ${paper_category_id} and name = "${paper_category_name}" - ${query} Query select is_delete from qn_category where id = ${paper_category_id} and name = "${paper_category_name}" - log ${query} - Should Be Equal As Strings ((1,),) ${query} + Query select is_delete from qn_category where id = ${paper_category_id} and name = "${paper_category_name}" Disconnect From Database