diff --git a/atdd/ATDDCase.py b/atdd/ATDDCase.py index b743b06..938d087 100644 --- a/atdd/ATDDCase.py +++ b/atdd/ATDDCase.py @@ -18,7 +18,7 @@ class ATDDCase(unittest.TestCase): mobile = '17321009308' - psw = '123456' + psw = '222222' jipeihong_uid = '755DE0550A69039F0BA12102F4A4F8E1' # 季培红的UID cert = ('1_vchangyi.com_bundle.crt', '2_vchangyi.com.key') diff --git a/atdd/PcPost.py b/atdd/PcPost.py index b8cf0eb..0e5be92 100644 --- a/atdd/PcPost.py +++ b/atdd/PcPost.py @@ -10,7 +10,7 @@ class PcPost(ATDDCase): result = data['result'] if isinstance(result, list): - user = result[1] + user = result[0] if len(result) > 1: print("选择企业:", user['enterpriseInfo']['epName']) diff --git a/tests/Staff_Management/AdminSettings/Staff_attribute/test_add_Attribute.py b/tests/Staff_Management/AdminSettings/Staff_attribute/test_add_Attribute.py new file mode 100644 index 0000000..5bd7601 --- /dev/null +++ b/tests/Staff_Management/AdminSettings/Staff_attribute/test_add_Attribute.py @@ -0,0 +1,140 @@ +from atdd.PcPost import PcPost +import random + +# 新增员工属性 + +class AddAttribute(PcPost): + + interfaceUrl = "/contact/Apicp/Attribute/Save" + + # 0~10000的随机整数 + x = random.randint(0, 10000) + + def setUp(self): + self.do_login(self.host, self.mobile, self.psw, self.domain) + + # 新增单行文本属性 + def test_add_text(self): + data = { + "attr_name": "单行文本"+str(self.x), + "position": 0, + "type": 1, #类型为单行文本 + "order": 0, + "is_system": 0, + "is_open_cp": 1, + "is_open_cp_edit": 0, + "is_open": 1, + "is_open_edit": 0, + "is_required_cp": 0, + "is_required_cp_edit": 0, + "is_required": 0, + "is_required_edit": 0, + "is_show": 1, + "is_show_edit": 0 + } + result = self.PcPost(self.interfaceUrl,data) + return result + + # 新增多行文本 + def test_add_MultilineText(self): + data = { + "attr_name": "多行文本" + str(self.x), + "position": 0, + "type": 2, #类型为多行文本 + "order": 0, + "is_system": 0, + "is_open_cp": 1, + "is_open_cp_edit": 0, + "is_open": 1, + "is_open_edit": 0, + "is_required_cp": 0, + "is_required_cp_edit": 0, + "is_required": 0, + "is_required_edit": 0, + "is_show": 1, + "is_show_edit": 0 + } + result = self.PcPost(self.interfaceUrl, data) + return result + + # 新增日期 + def test_add_Date(self): + data = { + "attr_name": "日期" + str(self.x), + "position": 0, + "type": 4, # 类型为日期 + "order": 0, + "is_system": 0, + "is_open_cp": 1, + "is_open_cp_edit": 0, + "is_open": 1, + "is_open_edit": 0, + "is_required_cp": 0, + "is_required_cp_edit": 0, + "is_required": 0, + "is_required_edit": 0, + "is_show": 1, + "is_show_edit": 0 + } + result = self.PcPost(self.interfaceUrl, data) + return result + + # 新建单选 + def test_add_singleSelect(self): + data = { + "option[0][name]": "漂亮", + "option[0][value]": 0, + "option[1][name]": "可爱", + "option[1][value]": 1, + "option[2][name]": "任性", + "option[2][value]": 2, + "option[3][name]": "有钱", + "option[3][value]": 3, + "attr_name": "单选" + str(self.x), + "position": 0, + "type": 7, # 类型为单选 + "order": 0, + "is_system": 0, + "is_open_cp": 1, + "is_open_cp_edit": 0, + "is_open": 1, + "is_open_edit": 0, + "is_required_cp": 0, + "is_required_cp_edit": 0, + "is_required": 0, + "is_required_edit": 0, + "is_show": 1, + "is_show_edit": 0 + } + result = self.PcPost(self.interfaceUrl, data) + return result + + # 新建多选 + def test_add_multiSelect(self): + data = { + "option[0][name]": "漂亮", + "option[0][value]": 0, + "option[1][name]": "可爱", + "option[1][value]": 1, + "option[2][name]": "任性", + "option[2][value]": 2, + "option[3][name]": "有钱", + "option[3][value]": 3, + "attr_name": "多选" + str(self.x), + "position": 0, + "type": 8, # 类型为多选 + "order": 0, + "is_system": 0, + "is_open_cp": 1, + "is_open_cp_edit": 0, + "is_open": 1, + "is_open_edit": 0, + "is_required_cp": 0, + "is_required_cp_edit": 0, + "is_required": 0, + "is_required_edit": 0, + "is_show": 1, + "is_show_edit": 0 + } + result = self.PcPost(self.interfaceUrl, data) + return result diff --git a/tests/Staff_Management/Organization/test_add_org.py b/tests/Staff_Management/Organization/test_add_org.py index 883a34a..b02f671 100644 --- a/tests/Staff_Management/Organization/test_add_org.py +++ b/tests/Staff_Management/Organization/test_add_org.py @@ -14,7 +14,7 @@ class AddOrg(PcPost): # 添加非门店 def test_add_org(self): - x = random.randint(0,1000) + x = random.randint(0,10000) top_dpId = PulbicOrg().get_top_org() data = { "department_id": None,