def test_chk_cost_apply_reject_batch(self): with allure.step('海川系统新增投放预算申请记录'): if rc.get_env() != 'pre': login.login_action('t0385252771', '123456') self._fbm.add_flow_budget(gather=3, mode=1) self._fbm.add_flow_budget(gather=3, mode=2) with allure.step('查询未审核的流量预算'): if rc.get_env() != 'pre': login.login_action('t0385252771', '123456') self._fbm.qry_flow_budget() with allure.step('售前数据中心审核流量预算'): if rc.get_env() != 'pre': login.login_action('t0385252771', '123456') self._fbm.chk_flow_budget() with allure.step('查询投放预算申请记录'): if rc.get_env() != 'pre': login.login_action('t0384223793', '123456') res = self._bm.qry_cost_apply(auditState=3) rs = res['data']['list'] id_list = [] if len(rs): for i in range(len(rs)): id = rs[i]['id'] id_list.append(id) ids = ','.join(str(i) for i in id_list) with allure.step('流量部门审核审核-通过'): if rc.get_env() != 'pre': login.login_action('t0384223793', '123456') self._bm.chk_cost_apply(ids=ids, auditState=0, auditRemark='拒绝')
def test_record_cost_apply(self): with allure.step('查询投放预算申请记录'): if rc.get_env() != 'pre': login.login_action('t0384223793', '123456') self._bm.qry_cost_apply(auditState=4) with allure.step('查看未审核的投放预算申请记录的操作记录'): if rc.get_env() != 'pre': login.login_action('t0384223793', '123456') self._bm.record_cost_apply()
def test_query_flow_allot_for_admin(self): if rc.get_env() == 'pre': login.login_action('t0396753586') else: login.login_action('t0373492024') self._fas.query_flow_allot_data() assert int(GLOBAL_VAR['totalItem']) > 0
def test_query_nonage_list(self): if rc.get_env() == 'pre': login.login_action('t0322511032') else: login.login_action('t0373492024') res = self.prq.put_record_list(isAdult=0) assert int(res['data']['totalItem']) > 0
def test_query_flow_allot_for_admin_turn_page(self): if rc.get_env() == 'pre': login.login_action('t0322511032') else: login.login_action('t0373492024') self._fas.query_flow_allot_data(pageIndex=2) assert int(GLOBAL_VAR['totalItem']) > 0
def test_apply_flow(self): if rc.get_env() == 'pre': login.login_action('t0322511032') self.af.apply_flow(promotionerDeptIdChain='1001-3003-12504-12505') else: login.login_action('t0383212689') self.af.apply_flow()
def test_query_budget_data_for_sales(self): if rc.get_env() == 'pre': login.login_action('t0322511032') else: login.login_action('t0373492024') self._bm.query_budget_data( receiveDeptIdChain='1001-8006-8007-8008-8009')
def import_wx_flow_free(self, token=None, type=1, subject_id=280, subject_name='PHP'): """ 学员录入--导入(微信流量)--拥有【免费流量组】 """ if type == 1: data = self._data.get('student_input_import_for_wx_free') else: data = self._data.get('student_input_import_for_wx_free_perssion') url, method, header, params, shared, check = cotool.deal_data(data) excel = { "1": ['客户姓名', '手机号码', 'QQ号码', '微信号', 'QQ群'], "2": ['lily', '13012345678', '23121231', '123456', '123456'] } if token is None: if rc.get_env() == 'pre': token = login.login_action('t0322511032') else: token = login.login_action('m17673155297') file_data, content_type, file_path = oe.send_file(excel, params) header['content-type'] = content_type header['token'] = token params['subjectId'] = subject_id params['subjectName'] = subject_name res = httprequest(url, method, header, file_data) cotool.extract_variable(res, shared) cotool.assert_res(res, check) oe.delete(file_path)
def test2_edit_identify(self): if rc.get_env() == 'pre': login.login_action('t0396753586') else: login.login_action('t0373492024') self.prq.query_identify() self.prq.edit_identify()
def test_query_budget_data_for_tissue(self): if rc.get_env() == 'pre': login.login_action('t0322511032') else: login.login_action('t0373492024') self._bm.query_budget_data( promotionerDeptIdChain='1001-8006-8007-8008-8009')
def test4_delete_identify(self): if rc.get_env() == 'pre': login.login_action('t0396753586') else: login.login_action('t0373492024') self.prq.query_identify(identifie='自动化识别词Auto-Edit') self.prq.delete_identify()
def test_import_xlsx_budget_data(self): month = random.randint(1, 7) year = GLOBAL_VAR['yearAndMonth'] if rc.get_env() == 'pre': login.login_action('t0396753586') excel = { "1": [ "预算月份", "推广组织", "售前组织", "科目", "获客方式", "投放模式", "周次", "工作日", "入职1月内人数", "入职1月以上未转正人数", "已转正人数", "人均名片数", "预估转化率", "预估客单价", "申请备注(非必填)" ], "2": [ year, "潭州教育>华西三区>华西三区成都第二分公司>成二分流量第一事业部>成二分流量二院", "潭州教育>华西二区>华西二区哈尔滨分公司>哈尔滨综合第一事业部>哈尔滨插画一院", "Python", "手机流量", "高转VIP课", month, 2, 10, 20, 30, 20, 0.07, 1000 ] } else: login.login_action('t0373492024') excel = { "1": [ "预算月份", "推广组织", "售前组织", "科目", "获客方式", "投放模式", "周次", "工作日", "入职1月内人数", "入职1月以上未转正人数", "已转正人数", "人均名片数", "预估转化率", "预估客单价", "申请备注(非必填)" ], "2": [ year, "潭州教育>熙悦测试分公司>熙悦测试事业部>熙悦测试院", "潭州教育>长沙分公司>潭州课堂>日语一院", "Python", "手机流量", "高转VIP课", month, 2, 10, 20, 30, 20, 0.07, 1000 ] } self._bm.import_budget_data(excel)
def test_prepare_export(self): if rc.get_env() == 'pre': login.login_action('t0322511032') else: login.login_action('t0373492024') local_time = GLOBAL_VAR['yesterday'] self._ad.prepare_export_ad_data(queryParams='{"来源日期":"2019-07-01 至 %s"}' % local_time)
def test_qry_apply_flow_record(self): if rc.get_env() == 'pre': login.login_action('t0396753586') else: login.login_action('t0383212689') res = self.far.flow_apply_record_query(applyDateValue=3) assert res['data']['totalItem'] != 0
def test_query_adult_list(self): if rc.get_env() == 'pre': login.login_action('t0322511032') else: login.login_action('t0373492024') res = self.prq.put_record_list(gatherTimeStart=1596211200000, channelId=3) assert res['data']['totalItem'] > 0
def test_failure_budget_data(self): if rc.get_env() == 'pre': login.login_action('t0396753586') else: login.login_action('t0373492024') with step('先查询获得历史数据'): self._bm.query_budget_data() self._bm.failure_budget_data()
def test_put_record_list(self): if rc.get_env() == 'pre': login.login_action('t0322511032') else: login.login_action('t0373492024') self.prq.put_record_list(allocStatus=None, gatherTimeStart=1596211200000, channelId=3)
def test_chk_cost_apply(self): with allure.step('海川系统新增投放预算申请记录'): if rc.get_env() != 'pre': login.login_action('t0385252771', '123456') self._fbm.add_flow_budget(gather=1, mode=2) with allure.step('查询未审核的流量预算'): if rc.get_env() != 'pre': login.login_action('t0385252771', '123456') self._fbm.qry_flow_budget() with allure.step('售前数据中心审核流量预算'): if rc.get_env() != 'pre': login.login_action('t0385252771', '123456') self._fbm.chk_flow_budget() with allure.step('流量部门审核审核-通过'): if rc.get_env() != 'pre': login.login_action('t0384223793', '123456') self._bm.chk_cost_apply()
def test_query_budget_data_for_month(self): if rc.get_env() == 'pre': login.login_action('t0322511032') else: login.login_action('t0373492024') last_month = GLOBAL_VAR['monthAgoTimeStart'] now_time = GLOBAL_VAR['gatherTimeEnd'] self._bm.query_budget_data(startCostMonth=last_month, endCostMonth=now_time)
def test_failure_update(self): if rc.get_env() == 'pre': login.login_action('t0396753586') else: login.login_action('t0373492024') with step('先查询获得历史数据,让该数据失效'): self._bm.query_budget_data() self._bm.failure_budget_data() with step('点击该已失效得修改功能'): self._bm.failure_update_record()
def test_allot_flow(self): if rc.get_env() == 'pre': login.login_action('t0322511032') else: login.login_action('t0373492024') self.prq.put_record_list(allocStatus=0, gatherTimeStart=1596211200000, gatherTimeEnd=1598889599000, putMode=1) self.prq.allot_flow()
def test_turn_page_query_ad_data(self): if rc.get_env() == 'pre': login.login_action('t0322511032') else: login.login_action('t0373492024') with step('查询'): self._ad.query_ad_data() with step('翻页查询'): self._ad1 = AdData() self._ad1.query_ad_data(pageIndex=2)
def test_qry_apply_flow_record3(self): if rc.get_env() == 'pre': login.login_action('t0322511032') else: login.login_action('t0383212689') res = self.far.flow_apply_record_query(subjectId=277, gatherType=1, applyDateValue=3) print(type(res['data']['totalItem'])) assert res['data']['totalItem'] != 0
def setup(self): if rc.get_env() == 'pre': login.login_action('t0322511032', '123456') else: login.login_action('t0384223793', '123456') # login.login_action('t0384223793', '123456') self._tmf = GLOBAL_VAR['thisMonthFirst'] self._nmf = GLOBAL_VAR['nextMonthFirst'] self._nml = GLOBAL_VAR['nextMonthLast'] self._bm = BudgetMgt() self._fbm = FlowBudgetMgt()
def add_student(self, type, token=None, subject_id=280, subject_name='PHP', rdc='1001-2001-4569-4570-4571-4572'): """ 录入 :param rdc: 部门连 :param subject_name: 科目名称 :param subject_id: 科目id :param type:1,手机流量 2,QQ流量 3,微信流量 :param token:1,拥有免费流量组 2,未拥有免费流量组 :return: """ _data = get_data.get_yinhe_data('flow_module/student_input.yaml') data = _data['add_student'] url, method, header, params, shared, check = cotool.deal_data(data) if token == 1: if rc.get_env() == 'pre': token = login.login_action('t0322511032') header['token'] = token else: token = login.login_action('m17673155297') header['token'] = token elif token == 2: if rc.get_env() == 'pre': token = login.login_action('t0322511032') header['token'] = token else: token = login.login_action('m17673155296') header['token'] = token params['gatherType'] = type params['subjectId'] = subject_id params['subjectName'] = subject_name params['receiveDeptIdChain'] = rdc # data['phoneNumber'] = phone_number res = httprequest(url, method, header, params) cotool.extract_variable(res, shared) cotool.assert_res(res, check)
def test_import_public_account(self): if rc.get_env() == 'pre': excel = { "1": [ "公众号名称(必填)", "科目(必填,输入的科目请和CRM系统保持一致)", "渠道(必填)", "合同时间(必填,格式YYYY-MM-DD)", "打款时间(必填,格式YYYY-MM-DD)", "号主联系方式(必填)", "价格(必填,请输入标准的数字)", "投放时间(YYYY-MM-DD)", "微信号", "流量数(标准数字)", "报名数(标准数字)", "发文链接", "创建人潭州账号(必填,请输入CRM系统中存在的潭州账号)" ], "2": [ "张三", "C++", "公众号", "2019-10-25", "2019-10-25", "ksmebaby", "436", "2019-10-25", "tzyhMax", "52", "0", "www.test.com", "t0322511032" ], "3": [ "李四", "C++", "公众号", "2019-10-25", "2019-10-25", "ksmebaby", "436", "2019-10-25", "tzyhMax", "52", "0", "www.test.com", "t0322511032" ], "4": [ "王五", "C++", "公众号", "2019-10-25", "2019-10-25", "ksmebaby", "436", "2019-10-25", "tzyhMax", "52", "0", "www.test.com", "t0322511032" ], } else: excel = { "1": [ "公众号名称(必填)", "科目(必填,输入的科目请和CRM系统保持一致)", "渠道(必填)", "合同时间(必填,格式YYYY-MM-DD)", "打款时间(必填,格式YYYY-MM-DD)", "号主联系方式(必填)", "价格(必填,请输入标准的数字)", "投放时间(YYYY-MM-DD)", "微信号", "流量数(标准数字)", "报名数(标准数字)", "发文链接", "创建人潭州账号(必填,请输入CRM系统中存在的潭州账号)" ], "2": [ "张三", "PHP", "公众号", "2019-10-25", "2019-10-25", "ksmebaby", "436", "2019-10-25", "tzyhMax", "52", "0", "www.test.com", "t0383212689" ], "3": [ "李四", "PHP", "公众号", "2019-10-25", "2019-10-25", "ksmebaby", "436", "2019-10-25", "tzyhMax", "52", "0", "www.test.com", "t0383212689" ], "4": [ "王五", "PHP", "公众号", "2019-10-25", "2019-10-25", "ksmebaby", "436", "2019-10-25", "tzyhMax", "52", "0", "www.test.com", "t0383212689" ], } self._pam.import_public_account(excel=excel)
def test_export_wx_dept_allot(self): if rc.get_env() == 'pre': login.login_action('t0322511032') else: login.login_action('t0373492024') self._das.export_wx_dept_allot_data() # @step('数据/数据统计/部门分配统计-微信CPC-预约导出') # @logger('case') # 目前数据不足5000 # def test_prepare_wx_export_query_dept_allot(self): # login.login_action('t0373492024') # self._das.export_wx_dept_allot_data()
def test_apply_flow_with_wechat(self): if rc.get_env() == 'pre': login.login_action('t0322511032') self.af.apply_flow(gatherType=3, subjectName='软件测试', subjectId=381, putMode=1, promotionerDeptIdChain='1001-3003-12504-12505') else: login.login_action('t0383212689') self.af.apply_flow(gatherType=3, subjectName='软件测试', subjectId=381, putMode=1)
def setup_class(self): if rc.get_env() == 'pre': login.login_action('t0322511032', '123456') else: login.login_action('t0384223793', '123456') self._time = datetime.datetime.now().strftime('%Y-%m-%d') i = datetime.datetime.now().day subject_list = [ 'PHP', 'C', 'C++', 'C#', 'Java', 'Python', 'Git', 'Boot', 'RFG', 'G', '基础英语', '雅思', '四六级', '托福', '职场/行业用语', '意式英语', '同程翻译', '出国托福', '出国雅思', 'SAT', '留学指导', '其他出国留学', '其他英语应试', '英语四六级', '日语零基础', '日语中高级', '日语初级', '兴趣日语', '日语考试', '日本留学', '韩语初级' ] self._sub = subject_list[i - 1]
def setup_class(self): if rc.get_env() == 'pre': login.login_action('t0322511032', '123456') else: login.login_action('t0384223793', '123456') i = datetime.datetime.now().day self._cm = GLOBAL_VAR['thisMonthFirst'] self.new_time = GLOBAL_VAR['twoMonthAgoTimeStart'] self.next_end = GLOBAL_VAR['newTwoMonth'] subject_list = [ {"id": "269", "name": "产品策划"}, {"id": "270", "name": "游戏策划"}, {"id": "271", "name": "产品运营"}, {"id": "373", "name": "SEM"}, {"id": "375", "name": "Android开发"}, {"id": "376", "name": "IOS"}, {"id": "272", "name": "游戏运营"}, {"id": "273", "name": "品牌营销"}, {"id": "274", "name": "电商运营"}, {"id": "275", "name": "新媒体运营"}, {"id": "276", "name": "SEO"}, {"id": "283", "name": "HTML5"}, {"id": "284", "name": "JavaScript"}, {"id": "285", "name": "jQuery"}, {"id": "286", "name": "React"}, {"id": "293", "name": "其它投资"}, {"id": "295", "name": "平面设计"}, {"id": "301", "name": "瓜果"}, {"id": "373", "name": "SEM"}, {"id": "375", "name": "Android开发"}, {"id": "376", "name": "IOS"}, {"id": "377", "name": "微信开发"}, {"id": "378", "name": "android"}, {"id": "380", "name": "运维其它"}, {"id": "381", "name": "软件测试"}, {"id": "382", "name": "运维管理"}, {"id": "383", "name": "信息安全"}, {"id": "385", "name": "Unity3d游戏开发"}, {"id": "392", "name": "Phone"}, {"id": "387", "name": "Html5游戏"}, {"id": "388", "name": "VR"}, {"id": "390", "name": "敏捷开发"}, {"id": "391", "name": "软件"}, {"id": "386", "name": "Cocos2d-x游戏开发"}, {"id": "387", "name": "Html5游戏"}, {"id": "388", "name": "VR"}, {"id": "390", "name": "敏捷开发"}, {"id": "391", "name": "软件"}, {"id": "392", "name": "Phone"}, {"id": "394", "name": "云计算"}, {"id": "395", "name": "大数据"}, {"id": "396", "name": "数据库"}, {"id": "397", "name": "Hadoop开发"}, {"id": "399", "name": "嵌入式"}, {"id": "401", "name": "IT认证"}, {"id": "402", "name": "计算机基础"}, {"id": "403", "name": "基金"}, {"id": "404", "name": "股票"}, {"id": "405", "name": "期货"}, {"id": "407", "name": "婚恋"}, {"id": "408", "name": "时尚美妆"}, {"id": "409", "name": "宠物绿植"}, {"id": "410", "name": "美食烹饪"}, {"id": "411", "name": "手工DIY"}, {"id": "412", "name": "星座"}, {"id": "415", "name": "健身"}, {"id": "416", "name": "武术"}, {"id": "417", "name": "养生"}, {"id": "418", "name": "体育"}, {"id": "419", "name": "舞蹈"}, {"id": "420", "name": "其它运动"}, {"id": "421", "name": "瑜伽"}, {"id": "423", "name": "声乐乐器"}, {"id": "424", "name": "音乐制作"}, {"id": "425", "name": "书画创作"}, {"id": "482", "name": "韩语零基础"}, {"id": "484", "name": "韩语中高级"}, {"id": "485", "name": "旅游韩语"}, {"id": "486", "name": "韩流文化"}, {"id": "487", "name": "TOPIK考试/留学"}, {"id": "488", "name": "法语"}, {"id": "489", "name": "泰语"}, {"id": "490", "name": "西班牙语"}, {"id": "491", "name": "葡萄牙语"}, {"id": "492", "name": "方言"}, {"id": "493", "name": "其他"}, {"id": "494", "name": "网页设计"}, {"id": "495", "name": "形象设计"}, {"id": "496", "name": "服装设计"}, {"id": "497", "name": "网店设计"}, {"id": "498", "name": "VI设计"}, {"id": "500", "name": "交互设计"}, {"id": "501", "name": "游戏UI设计"} ] self._id = subject_list[i]['id'] self._name = subject_list[i]['name'] print(self._name) self._new_id = subject_list[80-i]['id'] self._new_name = subject_list[80-i]['name']