Commit e5edbd8ad02b62bed66ad8380d6eeef5032ab35a
1 parent
c0c486d6
更改文件目录,让用例按市场进行区分,避免个别市场由于基础配置的客观原因导致用例执行失败的问题。
Showing
73 changed files
with
1339 additions
and
3 deletions
Too many changes to show.
To preserve performance only 73 of 83 files are displayed.
commons/basic/listCarType.py
config/global_data.conf
main.py
testcase/CZFW/__init__.py renamed to testcase/heb/CZFW/__init__.py
testcase/CZFW/test_weightBizBill_doRefund.py renamed to testcase/heb/CZFW/test_weightBizBill_doRefund.py
testcase/CZFW/test_weightBizBill_listPage.py renamed to testcase/heb/CZFW/test_weightBizBill_listPage.py
testcase/feedbackCustomerController/__init__.py renamed to testcase/heb/FeedbackCustomerController/__init__.py
testcase/feedbackCustomerController/test_fc_add.py renamed to testcase/heb/FeedbackCustomerController/test_fc_add.py
testcase/feedbackCustomerController/test_fc_edit.py renamed to testcase/heb/FeedbackCustomerController/test_fc_edit.py
testcase/feedbackCustomerController/test_fc_view.py renamed to testcase/heb/FeedbackCustomerController/test_fc_view.py
testcase/feedbackCustomerController/test_feedback_customer_disable.py renamed to testcase/heb/FeedbackCustomerController/test_feedback_customer_disable.py
testcase/feedbackCustomerController/test_feedback_customer_enable.py renamed to testcase/heb/FeedbackCustomerController/test_feedback_customer_enable.py
testcase/feedbackCustomerController/test_feedback_customer_query.py renamed to testcase/heb/FeedbackCustomerController/test_feedback_customer_query.py
testcase/feedbackOrderController/__init__.py renamed to testcase/heb/FeedbackOrderController/__init__.py
testcase/feedbackOrderController/test_feedback_order_settlement.py renamed to testcase/heb/FeedbackOrderController/test_feedback_order_settlement.py
testcase/feedbackOrderController/test_feedback_order_settlement_query.py renamed to testcase/heb/FeedbackOrderController/test_feedback_order_settlement_query.py
testcase/entranceFeeBill_detail/__init__.py renamed to testcase/heb/__init__.py
testcase/entranceFeeBill_proves/__init__.py renamed to testcase/heb/entranceFeeBill_detail/__init__.py
testcase/entranceFeeBill_detail/test_entranceFeeBill_details.py renamed to testcase/heb/entranceFeeBill_detail/test_entranceFeeBill_details.py
testcase/weightBizBill/__init__.py renamed to testcase/heb/entranceFeeBill_proves/__init__.py
testcase/entranceFeeBill_proves/test_entranceFeeBill_provesPage.py renamed to testcase/heb/entranceFeeBill_proves/test_entranceFeeBill_provesPage.py
testcase/feedbackAccounrecordController_list/__init__.py renamed to testcase/heb/feedbackAccounrecordController_list/__init__.py
testcase/feedbackAccounrecordController_list/test_feedbackAccounrecordController_list.py renamed to testcase/heb/feedbackAccounrecordController_list/test_feedbackAccounrecordController_list.py
testcase/feedbackOrderController_settlementlist/__init__.py renamed to testcase/heb/feedbackOrderController_settlementlist/__init__.py
testcase/feedbackOrderController_settlementlist/feedbackOrderController_querySumAmount.py renamed to testcase/heb/feedbackOrderController_settlementlist/feedbackOrderController_querySumAmount.py
testcase/feedbackOrderController_settlementlist/test_feedbackOrderController_settlementlist.py renamed to testcase/heb/feedbackOrderController_settlementlist/test_feedbackOrderController_settlementlist.py
testcase/test_HP/__init__.py renamed to testcase/heb/test_HP/__init__.py
testcase/test_HP/test_HP.py renamed to testcase/heb/test_HP/test_HP.py
testcase/test_SJ/__init__.py renamed to testcase/heb/test_SJ/__init__.py
testcase/test_SJ/test_SJ.py renamed to testcase/heb/test_SJ/test_SJ.py
testcase/test_ZC/__init__.py renamed to testcase/heb/test_ZC/__init__.py
testcase/test_ZC/demo.py renamed to testcase/heb/test_ZC/demo.py
testcase/test_ZC/demo_ZC.py renamed to testcase/heb/test_ZC/demo_ZC.py
testcase/test_ZC/demo_a.html renamed to testcase/heb/test_ZC/demo_a.html
testcase/test_ZC/demo_b.html renamed to testcase/heb/test_ZC/demo_b.html
testcase/test_ZC/test_ZCBasic.py renamed to testcase/heb/test_ZC/test_ZCBasic.py
testcase/test_ZC/test_ZCCreate.py renamed to testcase/heb/test_ZC/test_ZCCreate.py
testcase/test_listPage/__init__.py renamed to testcase/heb/test_listPage/__init__.py
testcase/test_listPage/test_listPageOperation.py renamed to testcase/heb/test_listPage/test_listPageOperation.py
testcase/test_listPage/test_searchByAttrName.py renamed to testcase/heb/test_listPage/test_searchByAttrName.py
testcase/test_listPage/test_searchByOther.py renamed to testcase/heb/test_listPage/test_searchByOther.py
testcase/heb/weightBizBill/__init__.py
0 → 100644
testcase/weightBizBill/test_weighingServiceSave.py renamed to testcase/heb/weightBizBill/test_weighingServiceSave.py
testcase/sy/CZFW/__init__.py
0 → 100644
testcase/sy/CZFW/test_weightBizBill_doRefund.py
0 → 100644
1 | +#!/usr/bin/python | |
2 | +# -*- coding: UTF-8 -*- | |
3 | +import unittest | |
4 | +import urllib3 | |
5 | +from commons import common as com | |
6 | +from commons import ConfigDB as db | |
7 | +from commons.MySession import my,sy1 | |
8 | +from commons.api.weightBizBill_doRefund import weightBizBill_doRefund | |
9 | +from commons.api.weighingServiceSave import weighingServiceSave | |
10 | +from commons.basic.listCarType import listCarType | |
11 | +urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) | |
12 | +do=weightBizBill_doRefund() | |
13 | +ad=weighingServiceSave(sy1) | |
14 | +ca=listCarType(sy1) | |
15 | + | |
16 | + | |
17 | +class test_weightBizBill_doRefund(unittest.TestCase): | |
18 | + "称重服务-称重服务单列表" | |
19 | + | |
20 | + | |
21 | + def setUp(self): | |
22 | + "数据准备:新增一条称重单" | |
23 | + #刷新增防重码 | |
24 | + ad.refresh_commit_token() | |
25 | + #新增称重单 | |
26 | + body=ad.body.copy() | |
27 | + car=ca.car_list()["data"] | |
28 | + body["carTypeId"]=car[0]["id"] | |
29 | + body["carTypeName"]=car[0]["carTypeName"] | |
30 | + body["carTypeCode"]=car[0]["code"] | |
31 | + self.re=sy1.post(url=ad.url,headers=ad.header,json=body) | |
32 | + | |
33 | + @unittest.case_mark(my.mark()) | |
34 | + def test_weightBizBill_doRefund_01(self): | |
35 | + "称重服务单列表-退款:成功退款一个现金交费的称重单" | |
36 | + body=do.body.replace("206",str(self.re.json()["data"]["id"])) | |
37 | + re=sy1.post(url=do.url,headers=do.header,data=body.encode('utf-8')) | |
38 | + print(re.json()) | |
39 | + #获取退款后称重单的状态,3为已退款 | |
40 | + bill_status=db.mysql_selectOne( | |
41 | + "SELECT status FROM `weight_biz_bill` WHERE id={};".format(self.re.json()["data"]["id"]))[0] | |
42 | + self.assertEqual(re.status_code, 200) | |
43 | + self.assertTrue("'result':'操作成功!'" in str(re.json()).replace(" ","")) | |
44 | + self.assertEqual(bill_status ,3) | |
45 | + | |
46 | +if __name__ == "__main__": | |
47 | + | |
48 | + unittest.main(verbosity=2) | |
49 | + | |
50 | + # com.run_one(test_weightBizBill_listPage("test_weightBizBill_listPage_01")) | ... | ... |
testcase/sy/CZFW/test_weightBizBill_listPage.py
0 → 100644
1 | +#!/usr/bin/python | |
2 | +# -*- coding: UTF-8 -*- | |
3 | +import unittest | |
4 | +import urllib3 | |
5 | +import time | |
6 | +from commons import common as com | |
7 | +from commons.MySession import my,sy1 | |
8 | +from commons.api.weightBizBill_listPage import weightBizBill_listPage | |
9 | +from commons.api.weighingServiceSave import weighingServiceSave | |
10 | +from commons.basic.listCarType import listCarType | |
11 | +urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) | |
12 | +bi=weightBizBill_listPage() | |
13 | +ad=weighingServiceSave(sy1) | |
14 | +ca=listCarType(sy1) | |
15 | + | |
16 | + | |
17 | +class test_weightBizBill_listPage(unittest.TestCase): | |
18 | + "称重服务-称重服务单列表" | |
19 | + | |
20 | + def setUp(self): | |
21 | + "数据准备:新增一条称重单" | |
22 | + #获取当前时间 | |
23 | + self.time=time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()) | |
24 | + #刷新增防重码 | |
25 | + ad.refresh_commit_token() | |
26 | + #新增数据 | |
27 | + body=ad.body.copy() | |
28 | + car=ca.car_list()["data"] | |
29 | + body["carTypeId"]=car[0]["id"] | |
30 | + body["carTypeName"]=car[0]["carTypeName"] | |
31 | + body["carTypeCode"]=car[0]["code"] | |
32 | + self.re=sy1.post(url=ad.url,headers=ad.header,json=body) | |
33 | + | |
34 | + | |
35 | + @unittest.case_mark(my.mark()) | |
36 | + def test_weightBizBill_listPage_01(self): | |
37 | + "称重服务单列表-查询:查询条件为“单据编号”,其余查询条件输入合法值,查询一条指定数据" | |
38 | + body=bi.body.replace("202108030900001",self.re.json()["data"]["number"]).replace( | |
39 | + "carTypeId=53","carTypeId={}".format(ca.car_list()["data"][0]["id"])).replace( | |
40 | + "depId=139","depId={}".format(sy1.user["sy_user01"]["departmentId"])) | |
41 | + re=sy1.post(url=bi.url,headers=bi.header,data=body) | |
42 | + print(re.json()) | |
43 | + self.assertEqual(re.status_code, 200) | |
44 | + self.assertTrue("'total':1" in str(re.json()).replace(" ","")) | |
45 | + self.assertTrue(self.re.json()["data"]["number"] in str(re.json()).replace(" ","")) | |
46 | + | |
47 | + @unittest.case_mark(my.mark()) | |
48 | + def test_weightBizBill_listPage_02(self): | |
49 | + "称重服务单列表-查询:查询条件为“车号”,其余查询条件输入合法值,查询一条指定数据" | |
50 | + body=bi.body.replace("attr=number","attr=plate").replace( | |
51 | + "202108030900001","{}".format(ad.body["plate"])).replace( | |
52 | + "2020-08-03 00:00:00","{}".format(self.time)).replace( | |
53 | + "carTypeId=53", "carTypeId={}".format(ca.car_list()["data"][0]["id"])).replace( | |
54 | + "depId=139", "depId={}".format(sy1.user["sy_user01"]["departmentId"])) | |
55 | + re=sy1.post(url=bi.url,headers=bi.header,data=body.encode('utf-8')) | |
56 | + print(re.json()) | |
57 | + self.assertEqual(re.status_code, 200) | |
58 | + self.assertTrue(ad.body["plate"] in str(re.json()).replace(" ","")) | |
59 | + | |
60 | + | |
61 | +if __name__ == "__main__": | |
62 | + | |
63 | + unittest.main(verbosity=2) | |
64 | + | |
65 | + # com.run_one(test_weightBizBill_listPage("test_weightBizBill_listPage_01")) | ... | ... |
testcase/sy/FeedbackCustomerController/__init__.py
0 → 100644
testcase/sy/FeedbackCustomerController/test_fc_add.py
0 → 100644
1 | +import unittest | |
2 | +import urllib3 | |
3 | +from commons.MySession import my,sy1 | |
4 | +from commons.api.fc_add import fc_add | |
5 | +urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) | |
6 | +from commons.Faker import random_data | |
7 | +import commons.ConfigDB as db | |
8 | +fc=fc_add() | |
9 | +ra = random_data() | |
10 | + | |
11 | +""" | |
12 | +进门收费——返点管理——返还人管理——新增返还人 | |
13 | +""" | |
14 | + | |
15 | +class test_fc_add(unittest.TestCase): | |
16 | + "返还人管理——新增返还人" | |
17 | + @classmethod | |
18 | + def setUpClass(cls): | |
19 | + pass | |
20 | + def setUp(self): | |
21 | + self.cardnb = db.mysql_selectOne('''SELECT card_no FROM `dili_account`.`account_user_card` WHERE state = 1 | |
22 | + AND firm_id = '''+str(sy1.user["sy_user01"]["firmId"])+''' ORDER BY id LIMIT 1''')[0] | |
23 | + def test_fc_add_01(self): | |
24 | + "新增返还人" | |
25 | + body = fc.body.replace("18828281176",ra.phone_number()).\ | |
26 | + replace("你好",ra.name()).\ | |
27 | + replace("888810054630",str(self.cardnb)) | |
28 | + # body = fc.body.replace("18828281176", ra.phone_number()). \ | |
29 | + # replace("你好", ra.name()). \ | |
30 | + # replace("888810054630", str(self.cardnb)). \ | |
31 | + # replace("relationCardTemp=888810054630", "relationCardTemp=888810054630"). \ | |
32 | + # replace("relationalCard[0].cardNumber=888810054630", "relationalCard[0].cardNumber=888810054630") | |
33 | + # print(body) | |
34 | + re = sy1.post(url=fc.url, headers=fc.header, data=body.encode('utf-8')) | |
35 | + # print(re.headers) | |
36 | + print(re.json()) | |
37 | + self.assertTrue("操作成功" in str(re.json())) | |
38 | + return re | |
39 | + | |
40 | + @classmethod | |
41 | + def tearDownClass(cls): | |
42 | + pass | |
43 | + | |
44 | + | |
45 | +if __name__ == '__main__': | |
46 | + unittest.main() | ... | ... |
testcase/sy/FeedbackCustomerController/test_fc_edit.py
0 → 100644
1 | +import unittest | |
2 | +import urllib3 | |
3 | +from commons.MySession import my,sy1 | |
4 | +from commons.api.fc_edit import fc_edit | |
5 | +urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) | |
6 | +from commons.Faker import random_data | |
7 | +from commons.api.fc_add import fc_add | |
8 | +ra = random_data() | |
9 | +fca = fc_add() | |
10 | +import commons.ConfigDB as db | |
11 | + | |
12 | +""" | |
13 | +进门收费——返点管理——返还人管理——修改返还人 | |
14 | +""" | |
15 | + | |
16 | +fc=fc_edit() | |
17 | +class test_fc_edit(unittest.TestCase): | |
18 | + "返还人管理——修改返还人" | |
19 | + @classmethod | |
20 | + def setUpClass(cls): | |
21 | + pass | |
22 | + def setUp(self): | |
23 | + # body = fc.body.replace("18828281176", ra.phone_number()). \ | |
24 | + # replace("你好", ra.name()). \ | |
25 | + # replace("888810054630", "888810054630") | |
26 | + # | |
27 | + # # body = fca.body.replace("888810054630", "888810054630"). \ | |
28 | + # # replace("你好", ra.name()). \ | |
29 | + # # replace("relationCardTemp=888810054630", "relationCardTemp=888810054630"). \ | |
30 | + # # replace("relationalCard[0].cardNumber=888810054630", "relationalCard[0].cardNumber=888810054630") | |
31 | + # # print(body) | |
32 | + # re = sy1.post(url = fc.url, headers = fc.header, data = body.encode('utf-8'), proxies = my.proxies) | |
33 | + self.mesg = db.mysql_selectOne('''SELECT id,name,mobile,card_number | |
34 | +FROM `dili_jmsf`.`feedback_customer` WHERE market_id = '''+str(sy1.user["sy_user01"]["firmId"])+''' ORDER BY `id` DESC LIMIT 1''') | |
35 | + # print(self.mesg) | |
36 | + def test_fc_edit_01(self): | |
37 | + "修改返还人" | |
38 | + body = fc.body.replace("id=40","id="+str(self.mesg[0])).\ | |
39 | + replace("农交",str(self.mesg[1])).\ | |
40 | + replace("18828281176",str(self.mesg[2])).\ | |
41 | + replace("888810054630",str(self.mesg[3])) | |
42 | + # body = fc.body.replace("id=40", "id=" + str(self.mesg[0])). \ | |
43 | + # replace("农交", str(self.mesg[1])). \ | |
44 | + # replace("18828281176", str(self.mesg[2])). \ | |
45 | + # replace("888810054630", str(self.mesg[3])). \ | |
46 | + # replace("relationalCard[0].cardNumber=210720131533", "relationalCard[0].cardNumber=210720125142") | |
47 | + # print(body) | |
48 | + re = sy1.post(url=fc.url, headers=fc.header, data=body.encode('utf-8')) | |
49 | + # print(re.headers) | |
50 | + # print(re.json()) | |
51 | + self.assertTrue("操作成功" in str(re.json())) | |
52 | + | |
53 | + @classmethod | |
54 | + def tearDownClass(cls): | |
55 | + pass | |
56 | + | |
57 | + | |
58 | +if __name__ == '__main__': | |
59 | + unittest.main() | ... | ... |
testcase/sy/FeedbackCustomerController/test_fc_view.py
0 → 100644
1 | +import unittest | |
2 | +import urllib3 | |
3 | +import commons.ConfigDB as db | |
4 | +from commons.MySession import my,sy1 | |
5 | +from commons.api.fc_view import fc_view | |
6 | +from commons.api.fc_add import fc_add | |
7 | +urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) | |
8 | +ad = fc_add() | |
9 | +vi = fc_view() | |
10 | + | |
11 | +""" | |
12 | +进门收费——返点管理——返还人管理——查看返还人 | |
13 | +""" | |
14 | + | |
15 | +class test_fc_view(unittest.TestCase): | |
16 | + "返还人管理——查看返还人" | |
17 | + | |
18 | + @classmethod | |
19 | + def setUpClass(cls): | |
20 | + pass | |
21 | + | |
22 | + def setUp(self): | |
23 | + # 获取数据:从MYSQL获取新增返还人的id号 | |
24 | + self.code = db.mysql_selectOne('''SELECT * FROM `dili_jmsf`.`feedback_customer` WHERE | |
25 | + market_id = '''+str(sy1.user["sy_user01"]["firmId"])+''' ORDER BY `id` DESC LIMIT 1''')[0] | |
26 | + | |
27 | + | |
28 | + # @unittest.case_mark(my.mark()) | |
29 | + def test_fc_view_01(self): | |
30 | + "查看返还人" | |
31 | + # 请求url中的需要替换为新增返还人的id | |
32 | + url = vi.url.replace("40", str(self.code)) | |
33 | + # print("数据处理后的url", url) | |
34 | + # 进行GET请求 | |
35 | + re = sy1.get(url=url, headers=vi.header) | |
36 | + # 打印请求结果(可删除该代码,一般只在调试时使用) | |
37 | + # print(re.text) | |
38 | + # 断言响应数据中是否存在期望字符串 | |
39 | + self.assertTrue('关联交费卡号' in str(re.text)) | |
40 | + | |
41 | + | |
42 | + @classmethod | |
43 | + def tearDownClass(cls): | |
44 | + pass | |
45 | + | |
46 | + if __name__ == '__main__': | |
47 | + unittest.main() | |
0 | 48 | \ No newline at end of file | ... | ... |
testcase/sy/FeedbackCustomerController/test_feedback_customer_disable.py
0 → 100644
1 | +import unittest | |
2 | +import urllib3 | |
3 | +from commons.MySession import my,sy1 | |
4 | +from commons.api.feedback_customer_disable import feedback_customer_disable | |
5 | +urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) | |
6 | +fcd = feedback_customer_disable() | |
7 | +import commons.ConfigDB as db | |
8 | + | |
9 | +""" | |
10 | +进门收费——返点管理——返还人管理——禁用返还人 | |
11 | +""" | |
12 | + | |
13 | +class test_feedback_customer_disable(unittest.TestCase): | |
14 | + "返还人管理——返还人禁用" | |
15 | + @classmethod | |
16 | + def setUpClass(cls): | |
17 | + pass | |
18 | + | |
19 | + def setUp(self): | |
20 | + self.ids = db.mysql_selectOne('''SELECT id FROM `dili_jmsf`.`feedback_customer` | |
21 | + WHERE `status` = '1' and market_id = '''+str(sy1.user["sy_user01"]["firmId"])+''' | |
22 | + ORDER BY `id` DESC LIMIT 1''')[0] | |
23 | + # print("查询出返还人id", self.id) | |
24 | + | |
25 | + def test_feedback_customer_disable_01(self): | |
26 | + "返还人禁用" | |
27 | + url = fcd.url.replace("44", str(self.ids)) | |
28 | + re = sy1.post(url=url, headers=fcd.header) | |
29 | + # print(re.headers) | |
30 | + # print(re.json()) | |
31 | + self.assertTrue("操作成功" in str(re.json())) | |
32 | + | |
33 | + @classmethod | |
34 | + def tearDownClass(cls): | |
35 | + pass | |
36 | + | |
37 | +if __name__ == '__main__': | |
38 | + unittest.main() | ... | ... |
testcase/sy/FeedbackCustomerController/test_feedback_customer_enable.py
0 → 100644
1 | +import unittest | |
2 | +import urllib3 | |
3 | +from commons.MySession import my,sy1 | |
4 | +from commons.api.feedback_customer_enable import feedback_customer_enable | |
5 | +from commons.api.feedback_customer_disable import feedback_customer_disable | |
6 | +urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) | |
7 | +fce = feedback_customer_enable() | |
8 | +fcd = feedback_customer_disable | |
9 | +import commons.ConfigDB as db | |
10 | + | |
11 | +""" | |
12 | +进门收费——返点管理——返还人管理——启用返还人 | |
13 | +""" | |
14 | + | |
15 | +class test_feedback_customer_enable(unittest.TestCase): | |
16 | + "返还人管理——返还人启用" | |
17 | + @classmethod | |
18 | + def setUpClass(cls): | |
19 | + pass | |
20 | + | |
21 | + def setUp(self): | |
22 | + self.ids = db.mysql_selectOne(''' | |
23 | + SELECT id FROM `dili_jmsf`.`feedback_customer` WHERE `status` = '2' and | |
24 | + market_id='''+str(sy1.user["sy_user01"]["firmId"])+''' ORDER BY `id` DESC LIMIT 1''')[0] | |
25 | + print(self.ids) | |
26 | + def test_feedback_customer_enable_01(self): | |
27 | + "返还人启用" | |
28 | + url = fce.url.replace("49",str(self.ids)) | |
29 | + re = sy1.post(url = url, headers = fce.header) | |
30 | + # print(fce.url) | |
31 | + # print(re.headers) | |
32 | + # print(re.json()) | |
33 | + self.assertTrue("操作成功" in str(re.json())) | |
34 | + @classmethod | |
35 | + def tearDownClass(cls): | |
36 | + pass | |
37 | + | |
38 | +if __name__ == '__main__': | |
39 | + unittest.main() | ... | ... |
testcase/sy/FeedbackCustomerController/test_feedback_customer_query.py
0 → 100644
1 | +import unittest | |
2 | +import urllib3 | |
3 | +from commons.MySession import my,sy1 | |
4 | +from commons.api.feedback_customer_query import feedback_customer_query | |
5 | +urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) | |
6 | +import datetime | |
7 | +import commons.ConfigDB as db | |
8 | +fcq = feedback_customer_query() | |
9 | + | |
10 | +""" | |
11 | +进门收费——返点管理——返还人管理——返还人列表查询 | |
12 | +""" | |
13 | + | |
14 | +class test_feedback_customer_query(unittest.TestCase): | |
15 | + "返还人管理——返还人列表查询" | |
16 | + @classmethod | |
17 | + def setUpClass(cls): | |
18 | + pass | |
19 | + def setUp(self): | |
20 | + self.name1 = db.mysql_selectOne('''SELECT name FROM `dili_jmsf`.`feedback_customer` | |
21 | + WHERE market_id = ''' + str(sy1.user["sy_user01"]["firmId"]) + ''' ORDER BY `id` DESC LIMIT 1''')[0] | |
22 | + def test_feedback_customer_query_01(self): | |
23 | + "返还人列表查询" | |
24 | + print(fcq.url) | |
25 | + body = fcq.body\ | |
26 | + .replace("潘婷婷", str(self.name1))\ | |
27 | + .replace("2021-08-11 00:00:00",(datetime.datetime.now() - datetime.timedelta(days = 30)).strftime("%Y-%m-%d %H:%M:%S")).\ | |
28 | + replace("2021-08-11 23:59:59",datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")) | |
29 | + # print(body) | |
30 | + re = sy1.post(url = fcq.url, data = body.replace("\n","").encode('utf-8'),headers = fcq.header) | |
31 | + # print(re.headers) | |
32 | + # print(re.text) | |
33 | + # print("士大夫十",str(self.name1)) | |
34 | + self.assertTrue(str(self.name1) in str(re.text)) | |
35 | + | |
36 | + @classmethod | |
37 | + def tearDownClass(cls): | |
38 | + pass | |
39 | + | |
40 | + | |
41 | +if __name__ == '__main__': | |
42 | + unittest.main() | ... | ... |
testcase/sy/FeedbackOrderController/__init__.py
0 → 100644
testcase/sy/FeedbackOrderController/test_feedback_order_settlement.py
0 → 100644
1 | +import json | |
2 | +import unittest | |
3 | +import urllib3 | |
4 | +from commons.MySession import my,sy1 | |
5 | +from commons.api.feedback_order_settlement import feedback_order_settlement | |
6 | +urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) | |
7 | +from commons.api.feedback_order_settlement_query import feedback_order_settlement_query | |
8 | +fosq = feedback_order_settlement_query() | |
9 | +import datetime | |
10 | +fos = feedback_order_settlement() | |
11 | + | |
12 | +""" | |
13 | +进门收费——返点管理——结账管理——选择需要返点的订单进行结账 | |
14 | +""" | |
15 | + | |
16 | +class test_feedback_order_settlement(unittest.TestCase): | |
17 | + "结账管理——选择需要返点的订单进行结账" | |
18 | + @classmethod | |
19 | + def setUpClass(cls): | |
20 | + pass | |
21 | + | |
22 | + def setUp(self): | |
23 | + body = fosq.body.replace("feedbackCustomerId=25", "feedbackCustomerId=16").replace("2021-07-22 00:00:00", "\ | |
24 | + 2021-07-03 00:00:00").replace("2021-08-03 23:59:59", str(datetime.datetime.now())) | |
25 | + re = sy1.post(url = fosq.url, data = body, headers = fosq.header) | |
26 | + | |
27 | + self.Amount = re.json()["rows"][0]["unsettledAmount"] | |
28 | + self.ids = re.json()["rows"][0]["id"] | |
29 | + self.billIds = re.json()["rows"][0]["billId"] | |
30 | + #查询出结账金额、结算单id和与之相关联的进门单id | |
31 | + url = "http://test.jmsf.diligrp.com:8385/FeedbackOrderController/settleAccount.action" | |
32 | + header = { | |
33 | + "X-Requested-With": "XMLHttpRequest", | |
34 | + "User-Agent": "Mozilla/5.0(WindowsNT6.2;WOW64)AppleWebKit/537.36(KHTML,likeGecko)Chrome/84.0.4147.105Safari/537.36", | |
35 | + "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8" | |
36 | + } | |
37 | + body = "customerId=16" | |
38 | + re2 = sy1.post(url = url,headers = header,data = body) | |
39 | + self.idd = re2.json()["id"] | |
40 | + self.name = re2.json()["name"] | |
41 | + self.cardNumber = re2.json()["cardNumber"] | |
42 | + #查询出结账单的id、name、cardnumber | |
43 | + | |
44 | + def test_feedback_order_settlement_01(self): | |
45 | + "选择需要返点的订单进行结账." | |
46 | + body = fos.body.replace("id=25","id="+str(self.idd)).\ | |
47 | + replace("888810057654",str(self.cardNumber)).\ | |
48 | + replace("settleAmount=2","settleAmount="+str(self.Amount)).\ | |
49 | + replace("ids=12034","ids="+str(self.ids)).\ | |
50 | + replace("feedbackCustomerId=25","feedbackCustomerId="+str(self.idd)).\ | |
51 | + replace("feedbackCustomerName=验证员工推送到CRM","feedbackCustomerName="+str(self.name)).\ | |
52 | + replace("billIds=3621","billIds="+str(self.billIds)).\ | |
53 | + replace("settledAmounts=2","settledAmounts="+str(self.Amount)) | |
54 | + # print(body) | |
55 | + re = sy1.post(url = fos.url, headers = fos.header, data = body.encode('utf-8')) | |
56 | + # print(re.headers) | |
57 | + | |
58 | + # print(re.json()) | |
59 | + self.assertTrue("操作成功" in str(re.json())) | |
60 | + return re | |
61 | + | |
62 | + @classmethod | |
63 | + def tearDownClass(cls): | |
64 | + pass | |
65 | + | |
66 | + | |
67 | +if __name__ == '__main__': | |
68 | + unittest.main() | |
0 | 69 | \ No newline at end of file | ... | ... |
testcase/sy/FeedbackOrderController/test_feedback_order_settlement_query.py
0 → 100644
1 | +import unittest | |
2 | +import urllib3 | |
3 | +from commons.MySession import my,sy1 | |
4 | +from commons.api.feedback_order_settlement_query import feedback_order_settlement_query | |
5 | +urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) | |
6 | +fosq = feedback_order_settlement_query() | |
7 | +import datetime | |
8 | + | |
9 | +""" | |
10 | +进门收费——返点管理——结账管理——根据返还人和缴费时间进行查询 | |
11 | +""" | |
12 | + | |
13 | +class test_feedback_order_settlement_query(unittest.TestCase): | |
14 | + "结账管理列表查询——根据返还人和缴费时间进行查询" | |
15 | + @classmethod | |
16 | + def setUpClass(cls): | |
17 | + pass | |
18 | + | |
19 | + def test_feedback_order_settlement_query_01(self): | |
20 | + "根据返还人和缴费时间进行查询" | |
21 | + print(fosq.url) | |
22 | + body = fosq.body.replace("feedbackCustomerId=25", "feedbackCustomerId=16").\ | |
23 | + replace("2021-07-22 00:00:00", (datetime.datetime.now() - datetime.timedelta(days = 30)).strftime("%Y-%m-%d %H:%M:%S")).\ | |
24 | + replace("2021-08-03 23:59:59", datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")) | |
25 | + # print(body) | |
26 | + re = sy1.post(url = fosq.url, data = body,headers = fosq.header) | |
27 | + # print(re.headers) | |
28 | + # print(re.json()) | |
29 | + self.assertTrue("rows" in str(re.json())) | |
30 | + | |
31 | + @classmethod | |
32 | + def tearDownClass(cls): | |
33 | + pass | |
34 | + | |
35 | + | |
36 | +if __name__ == '__main__': | |
37 | + unittest.main() | ... | ... |
testcase/sy/__init__.py
0 → 100644
testcase/sy/entranceFeeBill_detail/__init__.py
0 → 100644
testcase/sy/entranceFeeBill_detail/test_entranceFeeBill_details.py
0 → 100644
1 | +#!/usr/bin/python | |
2 | +# -*- coding: UTF-8 -*- | |
3 | +import unittest | |
4 | +import urllib3 | |
5 | +from commons import ConfigDB as db | |
6 | +from commons import common as com | |
7 | +from commons.MySession import my,sy1 | |
8 | +from commons.api.entranceFeeBill_details import entranceFeeBill_details | |
9 | +urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) | |
10 | +en=entranceFeeBill_details() | |
11 | + | |
12 | + | |
13 | +class test_entranceFeeBill_details(unittest.TestCase): | |
14 | + "进门收费管理-收费单标记" | |
15 | + | |
16 | + @classmethod | |
17 | + def setUpClass(cls): | |
18 | + cls.data=db.mysql_selectOne(en.sql) | |
19 | + | |
20 | + | |
21 | + @unittest.case_mark(my.mark()) | |
22 | + def test_entranceFeeBill_details_01(self): | |
23 | + "收费单标记-查询:查询条件为“收费单号”,其余查询条件输入合法值,查询一条指定数据" | |
24 | + url= en.url.replace("202108120900001", self.data[9]).\ | |
25 | + replace("carTypeId=53", "carTypeId={}".format(self.data[0])).\ | |
26 | + replace("categoryId=14436", "categoryId={}".format(self.data[1])).\ | |
27 | + replace("dep=58", "dep={}".format(self.data[2])).\ | |
28 | + replace("regionId=72", "regionId={}".format(self.data[3])).\ | |
29 | + replace("status=4", "status={}".format(self.data[4])).\ | |
30 | + replace("type=1", "type={}".format(self.data[5])).\ | |
31 | + replace("backSkinStatus=-1", "backSkinStatus={}".format(self.data[6])).\ | |
32 | + replace("companyId=9", "companyId={}".format(self.data[8])) | |
33 | + re=sy1.get(url=url,headers=en.header) | |
34 | + print(re.json()) | |
35 | + self.assertEqual(re.status_code, 200) | |
36 | + self.assertTrue("'total':1" in str(re.json()).replace(" ","")) | |
37 | + self.assertTrue("'number':'{}'".format(self.data[9]) in str(re.json()).replace(" ","")) | |
38 | + | |
39 | + @unittest.case_mark(my.mark()) | |
40 | + def test_entranceFeeBill_details_02(self): | |
41 | + "收费单标记-查询:查询条件为“车牌号”,其余查询条件输入合法值,查询一条指定数据" | |
42 | + url= en.url.replace("202108120900001", self.data[10]).\ | |
43 | + replace("carTypeId=53", "carTypeId={}".format(self.data[0])).\ | |
44 | + replace("categoryId=14436", "categoryId={}".format(self.data[1])).\ | |
45 | + replace("dep=58", "dep={}".format(self.data[2])).\ | |
46 | + replace("regionId=72", "regionId={}".format(self.data[3])).\ | |
47 | + replace("status=4", "status={}".format(self.data[4])).\ | |
48 | + replace("type=1", "type={}".format(self.data[5])).\ | |
49 | + replace("backSkinStatus=-1", "backSkinStatus={}".format(self.data[6])).\ | |
50 | + replace("companyId=9", "companyId={}".format(self.data[8])).\ | |
51 | + replace("attr=number", "attr=likePlate") | |
52 | + re=sy1.get(url=url,headers=en.header) | |
53 | + print(re.json()) | |
54 | + self.assertEqual(re.status_code, 200) | |
55 | + self.assertTrue("'number':'{}'".format(self.data[9]) in str(re.json()).replace(" ","")) | |
56 | + | |
57 | + @unittest.case_mark(my.mark()) | |
58 | + def test_entranceFeeBill_details_03(self): | |
59 | + "收费单标记-查询:查询条件为“商品”,其余查询条件输入合法值,查询一条指定数据" | |
60 | + url= en.url.replace("202108120900001", self.data[11]).\ | |
61 | + replace("carTypeId=53", "carTypeId={}".format(self.data[0])).\ | |
62 | + replace("categoryId=14436", "categoryId={}".format(self.data[1])).\ | |
63 | + replace("dep=58", "dep={}".format(self.data[2])).\ | |
64 | + replace("regionId=72", "regionId={}".format(self.data[3])).\ | |
65 | + replace("status=4", "status={}".format(self.data[4])).\ | |
66 | + replace("type=1", "type={}".format(self.data[5])).\ | |
67 | + replace("backSkinStatus=-1", "backSkinStatus={}".format(self.data[6])).\ | |
68 | + replace("companyId=9", "companyId={}".format(self.data[8])).\ | |
69 | + replace("attr=number", "attr=goods") | |
70 | + re=sy1.get(url=url,headers=en.header) | |
71 | + print(re.json()) | |
72 | + self.assertEqual(re.status_code, 200) | |
73 | + self.assertTrue("'number':'{}'".format(self.data[9]) in str(re.json()).replace(" ","")) | |
74 | + | |
75 | + @unittest.case_mark(my.mark()) | |
76 | + def test_entranceFeeBill_details_04(self): | |
77 | + "收费单标记-查询:查询条件为“收费员”,其余查询条件输入合法值,查询一条指定数据" | |
78 | + url= en.url.replace("202108120900001", self.data[12]).\ | |
79 | + replace("carTypeId=53", "carTypeId={}".format(self.data[0])).\ | |
80 | + replace("categoryId=14436", "categoryId={}".format(self.data[1])).\ | |
81 | + replace("dep=58", "dep={}".format(self.data[2])).\ | |
82 | + replace("regionId=72", "regionId={}".format(self.data[3])).\ | |
83 | + replace("status=4", "status={}".format(self.data[4])).\ | |
84 | + replace("type=1", "type={}".format(self.data[5])).\ | |
85 | + replace("backSkinStatus=-1", "backSkinStatus={}".format(self.data[6])).\ | |
86 | + replace("companyId=9", "companyId={}".format(self.data[8])).\ | |
87 | + replace("attr=number", "attr=pay") | |
88 | + re=sy1.get(url=url,headers=en.header) | |
89 | + print(re.json()) | |
90 | + self.assertEqual(re.status_code, 200) | |
91 | + self.assertTrue("'number':'{}'".format(self.data[9]) in str(re.json()).replace(" ","")) | |
92 | + | |
93 | + @unittest.case_mark(my.mark()) | |
94 | + def test_entranceFeeBill_details_05(self): | |
95 | + "收费单标记-查询:查询条件为“客户姓名”,其余查询条件输入合法值,查询一条指定数据" | |
96 | + url= en.url.replace("202108120900001", self.data[13]).\ | |
97 | + replace("carTypeId=53", "carTypeId={}".format(self.data[0])).\ | |
98 | + replace("categoryId=14436", "categoryId={}".format(self.data[1])).\ | |
99 | + replace("dep=58", "dep={}".format(self.data[2])).\ | |
100 | + replace("regionId=72", "regionId={}".format(self.data[3])).\ | |
101 | + replace("status=4", "status={}".format(self.data[4])).\ | |
102 | + replace("type=1", "type={}".format(self.data[5])).\ | |
103 | + replace("backSkinStatus=-1", "backSkinStatus={}".format(self.data[6])).\ | |
104 | + replace("companyId=9", "companyId={}".format(self.data[8])).\ | |
105 | + replace("attr=number", "attr=cname") | |
106 | + re=sy1.get(url=url,headers=en.header) | |
107 | + print(re.json()) | |
108 | + self.assertEqual(re.status_code, 200) | |
109 | + self.assertTrue("'number':'{}'".format(self.data[9]) in str(re.json()).replace(" ","")) | |
110 | + | |
111 | + @unittest.case_mark(my.mark()) | |
112 | + def test_entranceFeeBill_details_06(self): | |
113 | + "收费单标记-查询:查询条件为“卡号”,其余查询条件输入合法值,查询一条指定数据" | |
114 | + url= en.url.replace("202108120900001", self.data[15]).\ | |
115 | + replace("carTypeId=53", "carTypeId={}".format(self.data[0])).\ | |
116 | + replace("categoryId=14436", "categoryId={}".format(self.data[1])).\ | |
117 | + replace("dep=58", "dep={}".format(self.data[2])).\ | |
118 | + replace("regionId=72", "regionId={}".format(self.data[3])).\ | |
119 | + replace("status=4", "status={}".format(self.data[4])).\ | |
120 | + replace("type=1", "type={}".format(self.data[5])).\ | |
121 | + replace("backSkinStatus=-1", "backSkinStatus={}".format(self.data[6])).\ | |
122 | + replace("companyId=9", "companyId={}".format(self.data[8])).\ | |
123 | + replace("attr=number", "attr=ic") | |
124 | + re=sy1.get(url=url,headers=en.header) | |
125 | + print(re.json()) | |
126 | + self.assertEqual(re.status_code, 200) | |
127 | + self.assertTrue("'number':'{}'".format(self.data[9]) in str(re.json()).replace(" ","")) | |
128 | + | |
129 | + @unittest.case_mark(my.mark()) | |
130 | + def test_entranceFeeBill_details_07(self): | |
131 | + "收费单标记-查询:查询条件为“手机号”,其余查询条件输入合法值,查询一条指定数据" | |
132 | + url= en.url.replace("202108120900001", self.data[14]).\ | |
133 | + replace("carTypeId=53", "carTypeId={}".format(self.data[0])).\ | |
134 | + replace("categoryId=14436", "categoryId={}".format(self.data[1])).\ | |
135 | + replace("dep=58", "dep={}".format(self.data[2])).\ | |
136 | + replace("regionId=72", "regionId={}".format(self.data[3])).\ | |
137 | + replace("status=4", "status={}".format(self.data[4])).\ | |
138 | + replace("type=1", "type={}".format(self.data[5])).\ | |
139 | + replace("backSkinStatus=-1", "backSkinStatus={}".format(self.data[6])).\ | |
140 | + replace("companyId=9", "companyId={}".format(self.data[8])).\ | |
141 | + replace("attr=number", "attr=phone") | |
142 | + re=sy1.get(url=url,headers=en.header) | |
143 | + print(re.json()) | |
144 | + self.assertEqual(re.status_code, 200) | |
145 | + self.assertTrue("'number':'{}'".format(self.data[9]) in str(re.json()).replace(" ","")) | |
146 | + | |
147 | + | |
148 | +if __name__ == "__main__": | |
149 | + | |
150 | + # unittest.main(verbosity=2) | |
151 | + com.run_one(test_entranceFeeBill_details("test_entranceFeeBill_details_01")) | ... | ... |
testcase/sy/entranceFeeBill_proves/__init__.py
0 → 100644
testcase/sy/entranceFeeBill_proves/test_entranceFeeBill_provesPage.py
0 → 100644
1 | +#!/usr/bin/python | |
2 | +# -*- coding: UTF-8 -*- | |
3 | +import unittest | |
4 | +import urllib3 | |
5 | +from commons import ConfigDB as db | |
6 | +from commons import common as com | |
7 | +from commons.MySession import my,sy1 | |
8 | +from commons.api.entranceFeeBill_provesPage import entranceFeeBill_provesPage | |
9 | +urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) | |
10 | +en=entranceFeeBill_provesPage() | |
11 | + | |
12 | + | |
13 | +class test_entranceFeeBill_provesPage(unittest.TestCase): | |
14 | + "进门收费管理-证明类型明细" | |
15 | + | |
16 | + @classmethod | |
17 | + def setUpClass(cls): | |
18 | + cls.data=db.mysql_selectOne(en.sql) | |
19 | + print(cls.data) | |
20 | + | |
21 | + | |
22 | + @unittest.case_mark(my.mark()) | |
23 | + def test_entranceFeeBill_provesPage_01(self): | |
24 | + "证明类型明细-查询:查询条件为“收费单号”,其余查询条件输入合法值,查询一条指定数据" | |
25 | + body= ((en.body.replace("202108110900139", self.data[1]). | |
26 | + replace("14436", str(self.data[9])). | |
27 | + replace("雪莲果", self.data[11]).replace("14158", str(self.data[10])). | |
28 | + replace("103", str(self.data[0]))).replace("1621",str(self.data[8]))).replace( | |
29 | + "companyId=9","companyId={}".format(str(self.data[6]))) | |
30 | + re=sy1.post(url=en.url,headers=en.header,data=body.encode("utf-8")) | |
31 | + print(re.json()) | |
32 | + self.assertEqual(re.status_code, 200) | |
33 | + self.assertTrue("'total':1" in str(re.json()).replace(" ","")) | |
34 | + self.assertTrue("'number':'{}'".format(self.data[1]) in str(re.json()).replace(" ","")) | |
35 | + | |
36 | + @unittest.case_mark(my.mark()) | |
37 | + def test_entranceFeeBill_provesPage_02(self): | |
38 | + "证明类型明细-查询:查询条件为“车号”,其余查询条件输入合法值,查询一条指定数据" | |
39 | + body= ((en.body.replace("number", "likePlate"). | |
40 | + replace("202108110900139",self.data[2]). | |
41 | + replace("14436", str(self.data[9])). | |
42 | + replace("雪莲果", self.data[11]). | |
43 | + replace("14158", str(self.data[10])). | |
44 | + replace("103", str(self.data[0]))). | |
45 | + replace("1621",str(self.data[8]))).\ | |
46 | + replace("companyId=9","companyId={}".format(str(self.data[6]))) | |
47 | + re=sy1.post(url=en.url,headers=en.header,data=body.encode("utf-8")) | |
48 | + print(re.json()) | |
49 | + self.assertEqual(re.status_code, 200) | |
50 | + self.assertTrue("'number':'{}'".format(self.data[1]) in str(re.json()).replace(" ","")) | |
51 | + | |
52 | + @unittest.case_mark(my.mark()) | |
53 | + def test_entranceFeeBill_provesPage_03(self): | |
54 | + "证明类型明细-查询:查询条件为“客户姓名”,其余查询条件输入合法值,查询一条指定数据" | |
55 | + body= ((en.body.replace("number", "cname"). | |
56 | + replace("202108110900139",self.data[3]). | |
57 | + replace("14436", str(self.data[9])). | |
58 | + replace("雪莲果", self.data[11]). | |
59 | + replace("14158", str(self.data[10])). | |
60 | + replace("103", str(self.data[0]))). | |
61 | + replace("1621",str(self.data[8]))).\ | |
62 | + replace("companyId=9","companyId={}".format(str(self.data[6]))) | |
63 | + re=sy1.post(url=en.url,headers=en.header,data=body.encode("utf-8")) | |
64 | + print(re.json()) | |
65 | + self.assertEqual(re.status_code, 200) | |
66 | + self.assertTrue("'number':'{}'".format(self.data[1]) in str(re.json()).replace(" ","")) | |
67 | + | |
68 | + @unittest.case_mark(my.mark()) | |
69 | + def test_entranceFeeBill_provesPage_04(self): | |
70 | + "证明类型明细-查询:查询条件为“客户卡号”,其余查询条件输入合法值,查询一条指定数据" | |
71 | + body= ((en.body.replace("number", "ic"). | |
72 | + replace("202108110900139",self.data[5]). | |
73 | + replace("14436", str(self.data[9])). | |
74 | + replace("雪莲果", self.data[11]). | |
75 | + replace("14158", str(self.data[10])). | |
76 | + replace("103", str(self.data[0]))). | |
77 | + replace("1621",str(self.data[8]))).\ | |
78 | + replace("companyId=9","companyId={}".format(str(self.data[6]))) | |
79 | + re=sy1.post(url=en.url,headers=en.header,data=body.encode("utf-8")) | |
80 | + print(re.json()) | |
81 | + self.assertEqual(re.status_code, 200) | |
82 | + self.assertTrue("'number':'{}'".format(self.data[1]) in str(re.json()).replace(" ","")) | |
83 | + | |
84 | + @unittest.case_mark(my.mark()) | |
85 | + def test_entranceFeeBill_provesPage_05(self): | |
86 | + "证明类型明细-查询:查询条件为“手机号”,其余查询条件输入合法值,查询一条指定数据" | |
87 | + body = ((en.body.replace("number", "phone"). | |
88 | + replace("202108110900139", self.data[4]). | |
89 | + replace("14436", str(self.data[9])). | |
90 | + replace("雪莲果", self.data[11]). | |
91 | + replace("14158", str(self.data[10])). | |
92 | + replace("103", str(self.data[0]))). | |
93 | + replace("1621", str(self.data[8]))). \ | |
94 | + replace("companyId=9", "companyId={}".format(str(self.data[6]))) | |
95 | + re = sy1.post(url=en.url, headers=en.header, data=body.encode("utf-8")) | |
96 | + print(re.json()) | |
97 | + self.assertEqual(re.status_code, 200) | |
98 | + self.assertTrue("'number':'{}'".format(self.data[1]) in str(re.json()).replace(" ", "")) | |
99 | + | |
100 | +if __name__ == "__main__": | |
101 | + | |
102 | + unittest.main(verbosity=2) | |
103 | + # com.run_one(test_entranceFeeBill_provesPage("test_entranceFeeBill_provesPage_04")) | ... | ... |
testcase/sy/feedbackAccounrecordController_list/__init__.py
0 → 100644
testcase/sy/feedbackAccounrecordController_list/test_feedbackAccounrecordController_list.py
0 → 100644
1 | +import unittest | |
2 | +import urllib3 | |
3 | +from commons.MySession import my,sy1 | |
4 | +from commons.api.feedbackAccounrecordController_list import feedbackAccounrecordController_list | |
5 | +urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) | |
6 | +import commons.ConfigDB as db | |
7 | +farcl = feedbackAccounrecordController_list() | |
8 | + | |
9 | +""" | |
10 | +进门收费——返点管理——交易明细——根据交易时间和交易流水号查询 | |
11 | +""" | |
12 | + | |
13 | +class test_feedbackAccounrecordController_list(unittest.TestCase): | |
14 | + "交易明细——根据交易时间和交易流水号查询" | |
15 | + @classmethod | |
16 | + def setUpClass(cls): | |
17 | + print(sy1.user["sy_user01"]["firmId"]) | |
18 | + pass | |
19 | + def setUp(self): | |
20 | + self.body = db.mysql_selectOne( | |
21 | + '''SELECT dili_jmsf.feedback_account_record.created,dili_jmsf.feedback_order.record_number | |
22 | +FROM `dili_jmsf`.`feedback_order` LEFT JOIN `dili_jmsf`.`feedback_account_record` ON dili_jmsf.feedback_order.id = dili_jmsf.feedback_account_record.order_ids | |
23 | +WHERE market_id = '''+str(sy1.user["sy_user01"]["firmId"])+''' ORDER BY dili_jmsf.feedback_account_record.order_ids DESC LIMIT 1''') | |
24 | + print("查询出查询时间和交易流水号:", self.body[0],self.body[1]) | |
25 | + | |
26 | + def test_feedbackAccounrecordController_list_01(self): | |
27 | + "根据交易时间和交易流水号查询" | |
28 | + body = farcl.body.replace("2021-08-05 00:00:00", str(self.body[0])).\ | |
29 | + replace("2021-08-05 23:59:59", str(self.body[0])).\ | |
30 | + replace("1075782308694007808", self.body[1]) | |
31 | + | |
32 | + re = sy1.post(url = farcl.url, data = body,headers = farcl.header) | |
33 | + print(re.headers) | |
34 | + print(re.json()) | |
35 | + self.assertTrue(self.body[1] in str(re.json())) | |
36 | + return re | |
37 | + | |
38 | + @classmethod | |
39 | + def tearDownClass(cls): | |
40 | + pass | |
41 | + | |
42 | + | |
43 | +if __name__ == '__main__': | |
44 | + unittest.main() | ... | ... |
testcase/sy/feedbackOrderController_settlementlist/__init__.py
0 → 100644
testcase/sy/feedbackOrderController_settlementlist/feedbackOrderController_querySumAmount.py
0 → 100644
1 | +import unittest | |
2 | +import urllib3 | |
3 | +from commons.MySession import sy1 | |
4 | +from commons.api.feedbackOrderController_querySumAmount import querySumAmount | |
5 | +urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) | |
6 | +import datetime | |
7 | +qsa = querySumAmount() | |
8 | + | |
9 | +""" | |
10 | +进门收费——返点管理——已结账明细——已结账笔数已结账金额查询 | |
11 | +""" | |
12 | + | |
13 | +class test_feedbackOrderController_querySumAmount(unittest.TestCase): | |
14 | + "已结账明细——查询已结账笔数和已结账金额" | |
15 | + @classmethod | |
16 | + def setUpClass(cls): | |
17 | + pass | |
18 | + def setUp(self): | |
19 | + pass | |
20 | + | |
21 | + def test_feedbackOrderController_querySumAmount_01(self): | |
22 | + "查询已结账笔数和已结账金额" | |
23 | + body = qsa.body.replace("2021-07-05 00:00:00", (datetime.datetime.now() - datetime.timedelta(days = 30)).strftime("%Y-%m-%d %H:%M:%S")).\ | |
24 | + replace("2021-08-05 09:46:25", datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")) | |
25 | + | |
26 | + re = sy1.post(url=qsa.url, data=body, headers=qsa.header) | |
27 | + self.assertEqual(re.status_code, 200) | |
28 | + # print(re.json()) | |
29 | + | |
30 | + @classmethod | |
31 | + def tearDownClass(cls): | |
32 | + pass | |
33 | + | |
34 | + | |
35 | +if __name__ == '__main__': | |
36 | + unittest.main() | ... | ... |
testcase/sy/feedbackOrderController_settlementlist/test_feedbackOrderController_settlementlist.py
0 → 100644
1 | +import unittest | |
2 | +import urllib3 | |
3 | +from commons.MySession import my,sy1 | |
4 | +from commons.api.feedbackOrderController_settlementlist import feedbackOrderController_settlementlist | |
5 | +urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) | |
6 | +import commons.ConfigDB as db | |
7 | +import datetime | |
8 | +focsl = feedbackOrderController_settlementlist() | |
9 | + | |
10 | +""" | |
11 | +进门收费——返点管理——已结账明细——返还笔数结账时间金额查询 | |
12 | +""" | |
13 | + | |
14 | +class test_feedbackOrderController_settlementlist(unittest.TestCase): | |
15 | + "已结账明细——根据返还人和结算时间进行查询" | |
16 | + @classmethod | |
17 | + def setUpClass(cls): | |
18 | + pass | |
19 | + def setUp(self): | |
20 | + pass | |
21 | + | |
22 | + def test_feedbackOrderController_settlementlist_01(self): | |
23 | + "根据返还人和结算时间进行查询" | |
24 | + body = focsl.body.replace("2021-08-04 00:00:00", (datetime.datetime.now() - datetime.timedelta(days = 30)).strftime("%Y-%m-%d %H:%M:%S")).\ | |
25 | + replace("2021-08-05 23:59:59", datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")).\ | |
26 | + replace("feedbackCustomerId=25", "feedbackCustomerId=26") | |
27 | + # print(body) | |
28 | + re = sy1.post(url=focsl.url, data=body, headers=focsl.header) | |
29 | + self.assertEqual(re.status_code, 200) | |
30 | + # print(re.json()) | |
31 | + | |
32 | + @classmethod | |
33 | + def tearDownClass(cls): | |
34 | + pass | |
35 | + | |
36 | + | |
37 | +if __name__ == '__main__': | |
38 | + unittest.main() | ... | ... |
testcase/sy/test_HP/__init__.py
0 → 100644
testcase/sy/test_HP/test_HP.py
0 → 100644
1 | +# -*- coding: utf-8 -*- | |
2 | + | |
3 | +# @Time : 2021/8/12 17:34 | |
4 | +# @Author : Ljq | |
5 | +# @File : test_HP.py | |
6 | +# @Software: PyCharm | |
7 | + | |
8 | +""" | |
9 | +回皮功能接口测试 | |
10 | +""" | |
11 | + | |
12 | +import json | |
13 | +import unittest | |
14 | +from commons.scripts.readConf import rC | |
15 | +from commons.api import zcApi as zcA | |
16 | +from commons.api.entranceFeeBillList import entranceFeeBillList as eFBL | |
17 | +from commons.api import hpApi | |
18 | +import time,random | |
19 | + | |
20 | +class test_HPCreate(unittest.TestCase): | |
21 | + """整车-车辆回皮""" | |
22 | + def setUp(self) -> None: | |
23 | + pass | |
24 | + | |
25 | + def tearDown(self) -> None: | |
26 | + pass | |
27 | + | |
28 | + | |
29 | + @classmethod | |
30 | + def setUpClass(cls) -> None: | |
31 | + cls.gatewayHost = rC.returnOptionsItems("host", "gatewayHost") | |
32 | + cls.jmsfHost = rC.returnOptionsItems("host", "jmsfHost") | |
33 | + cls.ic = rC.returnOptionsItems("testInfo", "cardNumRe") | |
34 | + | |
35 | + @classmethod | |
36 | + def tearDownClass(cls) -> None: | |
37 | + pass | |
38 | + | |
39 | + def test_hp(self): | |
40 | + """整车-车辆回皮:创建回皮进门单""" | |
41 | + plate = f"川B{random.randint(10000,99999)}" | |
42 | + goods = "雪莲果" | |
43 | + cre_res = zcA.create_jmsf(host=self.gatewayHost,plate=plate,keyword=goods) | |
44 | + print(cre_res.json()) | |
45 | + number = cre_res.json()["data"]["number"] | |
46 | + aa = eFBL.do_freezeOrder(host=self.jmsfHost,attrValue=number) | |
47 | + res,tareWeight = hpApi.do_backSkinWeighSave(host=self.gatewayHost,number=number) | |
48 | + assert res.json()["code"]=="200","回皮失败" | |
49 | + assert "data" in res.text,"回皮失败" | |
50 | + | |
51 | + def test_SearchByPlate(self): | |
52 | + """整车-车辆回皮:根据车牌号查询""" | |
53 | + plate = f"川B{random.randint(10000,99999)}" | |
54 | + goods="火龙果" | |
55 | + cre_res = zcA.create_jmsf(host=self.gatewayHost,plate=plate,keyword=goods) | |
56 | + print(cre_res.json()) | |
57 | + number = cre_res.json()["data"]["number"] | |
58 | + aa = eFBL.do_freezeOrder(host=self.jmsfHost,attrValue=number) | |
59 | + res = hpApi.get_listBackSkinTrucks(host=self.gatewayHost,plate=plate) | |
60 | + print(res.json()) | |
61 | + assert res.json()["code"]=="200","车号查询失败" | |
62 | + assert res.json()["data"][-1]["number"]==number,"车号查询失败" | |
63 | + | |
64 | + def test_SearchByNumber(self): | |
65 | + """整车-车辆回皮:根据收费单号查询""" | |
66 | + plate = f"川B{random.randint(10000,99999)}" | |
67 | + goods="火龙果" | |
68 | + cre_res = zcA.create_jmsf(host=self.gatewayHost,plate=plate,keyword=goods) | |
69 | + print(cre_res.json()) | |
70 | + number = cre_res.json()["data"]["number"] | |
71 | + aa = eFBL.do_freezeOrder(host=self.jmsfHost,attrValue=number) | |
72 | + res = hpApi.get_listBackSkinTrucks(host=self.gatewayHost,number=number) | |
73 | + print(res.json()) | |
74 | + assert res.json()["code"]=="200","车号查询失败" | |
75 | + assert res.json()["data"][-1]["number"]==number,"车号查询失败" | |
76 | + | |
77 | + def test_SearchByCusName(self): | |
78 | + """整车-车辆回皮:根据客户查询""" | |
79 | + plate = f"川B{random.randint(10000,99999)}" | |
80 | + goods="雪莲果" | |
81 | + ic = self.ic | |
82 | + customerName= eFBL.get_icCheck(host=self.jmsfHost,ic=ic).json()["data"]["aInfo"]["customerName"] | |
83 | + print(customerName) | |
84 | + cre_res = zcA.create_jmsf(host=self.gatewayHost,plate=plate,keyword=goods) | |
85 | + print(cre_res.json()) | |
86 | + number = cre_res.json()["data"]["number"] | |
87 | + aa = eFBL.do_freezeOrder(host=self.jmsfHost,attrValue=number) | |
88 | + res = hpApi.get_listBackSkinTrucks(host=self.gatewayHost,customerName=customerName) | |
89 | + print(res.json()) | |
90 | + assert res.json()["code"]=="200","车号查询失败" | |
91 | + assert res.json()["data"][-1]["number"]==number,"车号查询失败" | |
0 | 92 | \ No newline at end of file | ... | ... |
testcase/sy/test_SJ/__init__.py
0 → 100644
testcase/sy/test_SJ/test_SJ.py
0 → 100644
1 | +# -*- coding: utf-8 -*- | |
2 | + | |
3 | +# @Time : 2021/8/11 16:35 | |
4 | +# @Author : Ljq | |
5 | +# @File : test_SJ.py | |
6 | +# @Software: PyCharm | |
7 | + | |
8 | +""" | |
9 | + | |
10 | +""" | |
11 | + | |
12 | +import json | |
13 | +import unittest | |
14 | +from commons.scripts.readConf import rC | |
15 | +from commons.api import zcApi as zcA | |
16 | +from commons.api.entranceFeeBillList import entranceFeeBillList as eFBL | |
17 | +from commons.api import sjApi | |
18 | +import time,random | |
19 | + | |
20 | +class test_ZCCreate(unittest.TestCase): | |
21 | + """整车-创建整车进门单""" | |
22 | + def setUp(self) -> None: | |
23 | + pass | |
24 | + | |
25 | + def tearDown(self) -> None: | |
26 | + pass | |
27 | + | |
28 | + | |
29 | + @classmethod | |
30 | + def setUpClass(cls) -> None: | |
31 | + cls.gatewayHost = rC.returnOptionsItems("host", "gatewayHost") | |
32 | + cls.jmsfHost = rC.returnOptionsItems("host", "jmsfHost") | |
33 | + | |
34 | + @classmethod | |
35 | + def tearDownClass(cls) -> None: | |
36 | + pass | |
37 | + | |
38 | + def test_createSJ(self): | |
39 | + """整车-创建散件进门单""" | |
40 | + # 依赖数据 | |
41 | + plate = f"川A{random.randint(10000, 99999)}" | |
42 | + trailerNumber = plate | |
43 | + productState = "1" | |
44 | + itemWeight = "10" | |
45 | + qty = "22" | |
46 | + | |
47 | + | |
48 | + # 获取车型 | |
49 | + carType = zcA.get_carType(host=self.gatewayHost) | |
50 | + print(carType.text) | |
51 | + print(carType.json()["data"][0]) | |
52 | + carTypeCode = carType.json()["data"][0]["code"] | |
53 | + carTypeId = carType.json()["data"][0]["id"] | |
54 | + carTypeName = carType.json()["data"][0]["carTypeName"] | |
55 | + | |
56 | + # 获取商品 | |
57 | + categoryByCondition = zcA.get_listCategoryByCondition(host=self.gatewayHost) | |
58 | + print(categoryByCondition.json()) | |
59 | + cateId = categoryByCondition.json()["data"][0]["id"] | |
60 | + productId = categoryByCondition.json()["data"][0]["id"] | |
61 | + productName = categoryByCondition.json()["data"][0]["name"] | |
62 | + | |
63 | + # 获取接车员 | |
64 | + listByExample = zcA.get_listByExample(host=self.gatewayHost) | |
65 | + print(listByExample.json()) | |
66 | + inGreeterId = listByExample.json()["data"][0]["id"] | |
67 | + inGreeterName = listByExample.json()["data"][0]["realName"] | |
68 | + | |
69 | + # 获取交易类型 | |
70 | + transactionType = zcA.query_transactionType(host=self.gatewayHost) | |
71 | + print(transactionType.json()) | |
72 | + tradeType = transactionType.json()["rows"][0]["code"] | |
73 | + tradeTypeId = transactionType.json()["rows"][0]["id"] | |
74 | + tradeTypeName = transactionType.json()["rows"][0]["name"] | |
75 | + | |
76 | + # 获取货物标签 | |
77 | + goodsTag = zcA.get_goodsTag(host=self.gatewayHost) | |
78 | + print(goodsTag.json()) | |
79 | + goodsTagId = goodsTag.json()["data"][0]["id"] | |
80 | + | |
81 | + # 产地信息获取 | |
82 | + address = zcA.get_address(host=self.gatewayHost) | |
83 | + print(address.json()) | |
84 | + originId = address.json()["data"][0]["id"] | |
85 | + origin = address.json()["data"][0]["name"] | |
86 | + originCode = address.json()["data"][0]["cityCode"] | |
87 | + | |
88 | + # 查询部门信息 | |
89 | + depRes = zcA.get_dep(host=self.gatewayHost) | |
90 | + print(depRes.json()) | |
91 | + feeDepId = depRes.json()["data"][0]["id"] | |
92 | + feeDepName = depRes.json()["data"][0]["name"] | |
93 | + | |
94 | + # 获取证明类型 | |
95 | + proveType = zcA.get_proveType(host=self.gatewayHost) | |
96 | + print(proveType.json()) | |
97 | + proveTypeCode = proveType.json()["data"][0]["id"] | |
98 | + proveTypeName = proveType.json()["data"][0]["name"] | |
99 | + | |
100 | + # 获取防重token | |
101 | + duplicateTokenRes = zcA.get_duplicateToken(host=self.gatewayHost) | |
102 | + print(duplicateTokenRes.json()) | |
103 | + duplicateToken = duplicateTokenRes.json()["data"] | |
104 | + | |
105 | + # 重量信息准备 | |
106 | + weight = int(itemWeight) * int(qty) | |
107 | + | |
108 | + # 创建进门单 | |
109 | + cre_res = sjApi.create_sparePartsWeighSave(host=self.gatewayHost, duplicateToken=duplicateToken, | |
110 | + carTypeCode=carTypeCode, carTypeId=carTypeId, | |
111 | + carTypeName=carTypeName, plate=plate, weight=weight, | |
112 | + productId=productId, productName=productName, proveTypeCode=proveTypeCode, | |
113 | + proveTypeName=proveTypeName, trailerNumber=trailerNumber, | |
114 | + depName=feeDepName, | |
115 | + cateId=cateId, originId=originId, origin=origin, originCode=originCode, | |
116 | + tradeType=tradeType, tradeTypeName=tradeTypeName, | |
117 | + productState=productState, | |
118 | + tradeTypeId=tradeTypeId, goodsTagId=goodsTagId, inGreeterId=inGreeterId, | |
119 | + inGreeterName=inGreeterName, dep=feeDepId) | |
120 | + print(cre_res.json()) | |
0 | 121 | \ No newline at end of file | ... | ... |
testcase/sy/test_ZC/__init__.py
0 → 100644
testcase/sy/test_ZC/demo.py
0 → 100644
1 | +# -*- coding: utf-8 -*- | |
2 | + | |
3 | +# @Time : 2021/7/28 16:59 | |
4 | +# @Author : Ljq | |
5 | +# @File : demo.py | |
6 | +# @Software: PyCharm | |
7 | + | |
8 | +""" | |
9 | + | |
10 | +""" | |
11 | +import json | |
12 | +import random | |
13 | + | |
14 | +# a = ["protocolId","pwd","clientRedirectTag","viewType","optType","optUrl","correctInfo","weightType","id","goodsId","number","modified","status","source","updateFeeItems","correctDiscount","totalAmount","customerId","fundAccount","accountId","ic","customerName","customerPhone","payway","plate","autocomplete-cartype","carTypeName","carTypeCode","carTypeId","carTypeWeight","storeTareWeight","proveType","grossWeight","tareWeight","weight","goodsNum","itemWeight","productPrice","unitPrice","depName","dep","regionId","productName","productId","productArea","originId","tradeTypeId","chargeTotalAmount","chargeTotalAmountYuan","freezeMoneySymbol","comparisonFreezeAmount","created","remark","goodsTagIds","shareRatio","handlingTeam","steveTeamId","handlingRatio","handActualAmount","handManageAmount","handCollectionAmount","marketFlag","totalMoney","receivable","collectionPrice","discountAmount","handReceivableAmount","itemReceivableAmount","correctDiscount","billItems","billItemsDic","billItemCheckIds","103","billItems","billItemDicCheckIds","billItemsDic","billItemCheckIds","106","billItems","receivableAmount","categoryName","categoryId","driverTel","grossWeightDate","tareWeightDate","grossPathName","grossPathId","tarePathId","goodsRemark","inGreeterName","inGreeterId","outGreeterId","sumPrice","shipperName","shipperId","shipperPhone","feeDepId"] | |
15 | +# b = ["protocolId","pwd","clientRedirectTag","viewType","optType","optUrl","correctInfo","weightType","id","goodsId","number","modified","status","source","updateFeeItems","correctDiscount","totalAmount","customerId","fundAccount","accountId","ic","customerName","customerPhone","payway","plate","autocomplete-cartype","carTypeName","carTypeCode","carTypeId","carTypeWeight","storeTareWeight","proveType","grossWeight","tareWeight","weight","goodsNum","itemWeight","productPrice","unitPrice","depName","calcDepId","dep","regionName","regionId","productName","productId","productArea","parentId","levelType","originId","tradeTypeId","chargeTotalAmount","chargeTotalAmountYuan","freezeMoneySymbol","comparisonFreezeAmount","created","remark","goodsTagIds","shareRatio","handlingTeam","handActualAmount","handManageAmount","handCollectionAmount","marketFlag","totalMoney","receivable","collectionPrice","discountAmount","handReceivableAmount","itemReceivableAmount","correctDiscount","billItems","billItemsDic","billItemCheckIds","103","billItems","billItemDicCheckIds","billItemsDic","billItemCheckIds","106","billItems","receivableAmount","categoryName","categoryId","driverTel","grossWeightDate","tareWeightDate","grossPathName","grossPathId","tarePathId","goodsRemark","inGreeterName","inGreeterId","outGreeterId","sumPrice","shipperName","shipperId","shipperPhone","feeDepName","calcFeeDepId","feeDepId"] | |
16 | + | |
17 | +""" | |
18 | +# a系统 | |
19 | +a = ["protocolId","pwd","clientRedirectTag","viewType","optType","optUrl","correctInfo","weightType","id","goodsId","number","modified","status","source","updateFeeItems","correctDiscount","totalAmount","customerId","fundAccount","accountId","ic","customerName","customerPhone","payway","plate","autocomplete-cartype","carTypeName","carTypeCode","carTypeId","carTypeWeight","storeTareWeight","proveTypeName","proveType","grossWeight","tareWeight","weight","goodsNum","itemWeight","productPrice","unitPrice","depName","dep","regionId","productName","productId","productArea","originId","tradeTypeId","chargeTotalAmount","chargeTotalAmountYuan","freezeMoneySymbol","comparisonFreezeAmount","created","backSkinTwo","remark","goodsTagIds","shareRatio","handlingTeam","steveTeamId","handlingRatio","handActualAmount","handManageAmount","handCollectionAmount","marketFlag","totalMoney","receivable","collectionPrice","discountAmount","handReceivableAmount","itemReceivableAmount","correctDiscount","billItems","billItemsDic","billItemCheckIds","103","billItems","billItemDicCheckIds","billItemsDic","billItemCheckIds","106","billItems","receivableAmount","categoryName","categoryId","driverTel","grossWeightDate","tareWeightDate","grossPathName","grossPathId","tarePathId","bskinWithGoods","goodsRemark","inGreeterName","inGreeterId","outGreeterName","outGreeterId","sumPrice","shipperName","shipperId","shipperPhone","feeDepName","calcFeeDepId","feeDepId"] | |
20 | +# b自己 | |
21 | +b = ["protocolId","pwd","clientRedirectTag","viewType","optType","optUrl","correctInfo","weightType","id","goodsId","number","modified","status","source","updateFeeItems","correctDiscount","totalAmount","customerId","fundAccount","accountId","ic","customerName","customerPhone","payway","plate","autocomplete-cartype","carTypeName","carTypeCode","carTypeId","carTypeWeight","storeTareWeight","grossWeight","tareWeight","weight","goodsNum","itemWeight","productPrice","unitPrice","depName","dep","regionId","productName","productId","productArea","originId","chargeTotalAmount","chargeTotalAmountYuan","freezeMoneySymbol","comparisonFreezeAmount","created","remark","goodsTagIds","shareRatio","handlingTeam","steveTeamId","handlingRatio","handActualAmount","handManageAmount","handCollectionAmount","marketFlag","totalMoney","receivable","collectionPrice","discountAmount","handReceivableAmount","itemReceivableAmount","receivableAmount","categoryName","categoryId","driverTel","grossWeightDate","tareWeightDate","grossPathName","grossPathId","tarePathId","goodsRemark","inGreeterName","inGreeterId","outGreeterId","sumPrice","shipperName","shipperId","shipperPhone","feeDepId","correctDiscount","billItems","billItemsDic","billItemCheckIds","103","billItems","billItemDicCheckIds","billItemsDic","billItemCheckIds","106","billItems"] | |
22 | + | |
23 | +c = list(set(a)^set(b)) | |
24 | +# print(c) | |
25 | + | |
26 | +aa = [] | |
27 | +bb = [] | |
28 | + | |
29 | +for i in c: | |
30 | + if i not in a: | |
31 | + aa.append(i) | |
32 | + if i not in b: | |
33 | + bb.append(i) | |
34 | + | |
35 | +print(aa) | |
36 | +print(bb) | |
37 | +""" | |
38 | + | |
39 | +from bs4 import BeautifulSoup | |
40 | +import random | |
41 | + | |
42 | +# with open("demo_a.html",encoding="utf-8") as com: | |
43 | +# data = com.read() | |
44 | + | |
45 | +# orderDetailsSoup = BeautifulSoup(data, "html.parser") | |
46 | +# selectList = orderDetailsSoup.findAll("select") | |
47 | +# print(selectList) | |
48 | +# selectDict = {} | |
49 | +# for i in selectList: | |
50 | +# for a in i.findAll("option"): | |
51 | +# if a.get("selected") == "selected": | |
52 | +# selectDict[i.get("name")]=[a.get("value"),a.text] | |
53 | +# # print(i.text) | |
54 | +# print(selectDict) | |
55 | + | |
56 | +# def do_ass(nA,tj,nB,msg): | |
57 | +# res = | |
58 | +# str = f'assert {res},"123123""' | |
59 | +# exec(str) | |
60 | + | |
61 | +# do_ass([1],"==",'[1]',"测试失败") | |
62 | +assert True | |
63 | + | ... | ... |
testcase/sy/test_ZC/demo_ZC.py
0 → 100644
1 | +# -*- coding: utf-8 -*- | |
2 | + | |
3 | +# @Time : 2021/7/28 11:15 | |
4 | +# @Author : Ljq | |
5 | +# @File : test_ZC.py | |
6 | +# @Software: PyCharm | |
7 | + | |
8 | +""" | |
9 | +整车进门测试用例 | |
10 | +""" | |
11 | + | |
12 | +import json | |
13 | +import unittest | |
14 | +from commons.scripts.readConf import rC | |
15 | +from commons.api import zcApi as zcA | |
16 | +from commons.api.entranceFeeBillList import entranceFeeBillList as eFBL | |
17 | +import time,random | |
18 | + | |
19 | +class test_demo(unittest.TestCase): | |
20 | + """整车-整车进门单创建""" | |
21 | + def setUp(self) -> None: | |
22 | + pass | |
23 | + | |
24 | + def tearDown(self) -> None: | |
25 | + pass | |
26 | + | |
27 | + | |
28 | + @classmethod | |
29 | + def setUpClass(cls) -> None: | |
30 | + cls.gatewayHost = rC.returnOptionsItems("host", "gatewayHost") | |
31 | + cls.jmsfHost = rC.returnOptionsItems("host", "jmsfHost") | |
32 | + | |
33 | + @classmethod | |
34 | + def tearDownClass(cls) -> None: | |
35 | + pass | |
36 | + | |
37 | + @unittest.skip | |
38 | + def test_get_carType(self): | |
39 | + """整车-整车创建:获取车型接口调用测试""" | |
40 | + # 依赖数据 | |
41 | + plate = "川A12323" | |
42 | + productState = "1" | |
43 | + trailerNumber = plate | |
44 | + | |
45 | + # 获取车型 | |
46 | + carType = zcA.get_carType(host=self.gatewayHost) | |
47 | + print(carType.text) | |
48 | + print(carType.json()["data"][0]) | |
49 | + carTypeCode = carType.json()["data"][0]["code"] | |
50 | + carTypeId = carType.json()["data"][0]["id"] | |
51 | + carTypeName = carType.json()["data"][0]["carTypeName"] | |
52 | + carTypeWeight = carType.json()["data"][0]["weight"] | |
53 | + | |
54 | + # 获取商品 | |
55 | + categoryByCondition = zcA.get_listCategoryByCondition(host=self.gatewayHost) | |
56 | + print(categoryByCondition.json()) | |
57 | + cateId = categoryByCondition.json()["data"][0]["id"] | |
58 | + productId = categoryByCondition.json()["data"][0]["id"] | |
59 | + productName = categoryByCondition.json()["data"][0]["name"] | |
60 | + productCode = categoryByCondition.json()["data"][0]["keycode"] | |
61 | + | |
62 | + # 获取接车员 | |
63 | + listByExample = zcA.get_listByExample(host=self.gatewayHost) | |
64 | + print(listByExample.json()) | |
65 | + inGreeterId = listByExample.json()["data"][0]["id"] | |
66 | + inGreeterName = listByExample.json()["data"][0]["realName"] | |
67 | + | |
68 | + # 获取交易类型 | |
69 | + transactionType = zcA.query_transactionType(host=self.gatewayHost) | |
70 | + print(transactionType.json()) | |
71 | + tradeType = transactionType.json()["rows"][0]["code"] | |
72 | + tradeTypeId = transactionType.json()["rows"][0]["id"] | |
73 | + tradeTypeName = transactionType.json()["rows"][0]["name"] | |
74 | + | |
75 | + # 获取货物标签 | |
76 | + goodsTag = zcA.get_goodsTag(host=self.gatewayHost) | |
77 | + print(goodsTag.json()) | |
78 | + goodsTagId = goodsTag.json()["data"][0]["id"] | |
79 | + | |
80 | + # 产地信息获取 | |
81 | + address = zcA.get_address(host=self.gatewayHost) | |
82 | + print(address.json()) | |
83 | + originId = address.json()["data"][0]["id"] | |
84 | + origin = address.json()["data"][0]["name"] | |
85 | + originCode = address.json()["data"][0]["cityCode"] | |
86 | + | |
87 | + # 查询部门信息 | |
88 | + depRes = zcA.get_dep(host=self.gatewayHost) | |
89 | + print(depRes.json()) | |
90 | + feeDepId = depRes.json()["data"][0]["id"] | |
91 | + feeDepName = depRes.json()["data"][0]["name"] | |
92 | + | |
93 | + # 获取证明类型 | |
94 | + proveType = zcA.get_proveType(host=self.gatewayHost) | |
95 | + print(proveType.json()) | |
96 | + proveTypeCode = proveType.json()["data"][0]["id"] | |
97 | + proveTypeName = proveType.json()["data"][0]["name"] | |
98 | + | |
99 | + # 获取防重token | |
100 | + duplicateTokenRes = zcA.get_duplicateToken(host=self.gatewayHost) | |
101 | + print(duplicateTokenRes.json()) | |
102 | + duplicateToken = duplicateTokenRes.json()["data"] | |
103 | + | |
104 | + # 重量信息准备 | |
105 | + grossWeight = random.randint(carTypeWeight,carTypeWeight+100) | |
106 | + tareWeight = carTypeWeight | |
107 | + weighmanRecord = {"grossWeight":None, "grossWeightDate": "", "newWeight": None,"tareWeight":None, "tareWeightDate": None, "weighImgs": []} | |
108 | + weighmanRecord["grossWeight"] = grossWeight | |
109 | + weighmanRecord["tareWeight"] = carTypeWeight | |
110 | + weighmanRecord["newWeight"] = grossWeight-carTypeWeight | |
111 | + weighmanRecord["grossWeightDate"]= time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()) | |
112 | + | |
113 | + # 创建进门单 | |
114 | + cre_res = zcA.create_wholeCarWeighSave(host=self.gatewayHost,duplicateToken=duplicateToken,carTypeCode=carTypeCode,carTypeId=carTypeId, | |
115 | + carTypeName=carTypeName,carTypeWeight=carTypeWeight,plate=plate, | |
116 | + productId=productId,productName=productName,proveTypeCode=proveTypeCode, | |
117 | + proveTypeName=proveTypeName,trailerNumber=trailerNumber,depName=feeDepName, | |
118 | + cateId=cateId,originId=originId,origin=origin,originCode=originCode, | |
119 | + tradeType=tradeType,tradeTypeName=tradeTypeName,productState=productState, | |
120 | + tradeTypeId=tradeTypeId,goodsTagId=goodsTagId,inGreeterId=inGreeterId, | |
121 | + inGreeterName=inGreeterName,dep=feeDepId,weighmanRecord=weighmanRecord) | |
122 | + print(cre_res.json()) | |
123 | + | |
124 | + @unittest.skip | |
125 | + def test_cre(self): | |
126 | + """调用方法1""" | |
127 | + cre_res = zcA.create_jmsf(host=self.gatewayHost,carTypeName="板车",plate="川B00001",keyword="雪莲果", | |
128 | + userName="ty_test",transactionName="沈阳2号",newWeight=20, | |
129 | + depName="水果部",goodsTagName="货物标签测试",proveName="绿色蔬菜") | |
130 | + print(cre_res.json()) | |
131 | + number = cre_res.json()["data"]["number"] | |
132 | + print(number) | |
133 | + # aa = eFBL.do_freezeOrder(attrValue=number) | |
134 | + aa = eFBL.do_payOrder(attrValue=number) | |
135 | + # cre_res = zcA.create_jmsf(host=self.gatewayHost) | |
136 | + # print(cre_res.json()) | |
137 | + # cre_res = zcA.create_jmsf(host=self.gatewayHost,plate="川B00002",newWeight=20) | |
138 | + # print(cre_res.json()) | |
139 | + | |
140 | + | |
141 | + | |
142 | + | |
143 | + | |
144 | + | |
145 | +# if __name__ == "__main__": | |
146 | +# unittest.main() | |
147 | +# | |
0 | 148 | \ No newline at end of file | ... | ... |