예제 #1
0
 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='拒绝')
예제 #2
0
 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
예제 #3
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
예제 #4
0
 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()
예제 #5
0
 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')
예제 #6
0
 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()
예제 #7
0
 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)
예제 #8
0
 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
예제 #9
0
 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')
예제 #10
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
예제 #11
0
    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)
예제 #12
0
 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)
예제 #13
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()
예제 #14
0
 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)
예제 #15
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()
예제 #16
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
예제 #17
0
 def login_tools(self):
     account = self.ui.account.text().strip()
     password = self.ui.password.text().strip()
     env = self.ui.env.currentText()
     rc.set_en(env)
     login.login_action(account=account, password=password)
     self.ui.comNum.setText('当前登录账号:' + account)
     self.ui.baudNum.setText('当前环境:' + env)
     self.ui.stackedWidget.setCurrentIndex(0)
예제 #18
0
 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)
예제 #19
0
 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()
예제 #20
0
 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
예제 #21
0
 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()
예제 #22
0
 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()
예제 #23
0
 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)
예제 #24
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()
예제 #25
0
    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()
예제 #26
0
 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]
예제 #27
0
 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)
예제 #28
0
    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']
예제 #29
0
 def test_update_budget_data(self):
     if rc.get_env() == 'pre':
         login.login_action('t0396753586')
     else:
         login.login_action('t0373492024')
     with step('先查询获得历史数据'):
         self._bm.query_budget_data()
     with step('修改'):
         self._bm.update_budget_data(workDay=5,
                                     monthEntryNum=5,
                                     monthUnCorrectNum=5,
                                     monthCorrectNum=5,
                                     avgCardNum=5,
                                     conversionRate=0.17,
                                     customerPrice=777)
         self._bm = BudgetMgt()
         self._bm.query_budget_data()
         assert GLOBAL_VAR['workDay'] == '5' and GLOBAL_VAR[
             'conversionRate'] == '0.17'
예제 #30
0
 def creativity_pageList(self):
     '''
     广告创意查询
     :return:
     '''
     data = self._cct.get('creativity_pageList')
     url, method, header, params, shared, check = cotool.deal_data(data)
     token = login.login_action('t0383212689', '123456')
     header['token'] = token
     res = httprequest(url, method, header, params)
     cotool.extract_variable(res, shared)
     cotool.assert_res(res, check)