def setup(self): self._cwp = CreateAdPlan() self._cwai = CreateAdIdea() self._cqc = CreateQrCode() self._prq = PutRecordQuery() GLOBAL_VAR['projectName'] = const.projectName GLOBAL_VAR['ideaName'] = const.ideaName
def test_manual_xk(self): with step('创建微信计划'): self._cwp.create_wc_ad_plan_for_model() self._cwp.get_plan_id() with step('创建微信广告创意'): self._cwai = CreateAdIdea() self._cwai.create_wc_ad_idea() self._cwai.get_idea_id() with step('新建落地页'): self._cqc = CreateQrCode() self._cqc.create_pay_qr_code() self._cqc.publish_website() self._cqc.create_link() #create_code() with step('落地页数据列表统计查询'): self._cqc.ldy_list_data_query() with step('入库记录流量数据查询'): self._prq = PutRecordQuery() self._prq.put_record_query() with step('广告创意流量数据查询'): self._cwai.ad_idea_flow_data_query() # if __name__ == '__main__': # import pytest # pytest.main([__file__])
def setup(self): GLOBAL_VAR['landingPageName'] = const.landingPageName self.lpwa = LPWA() self.cqc = CQC() self.lpm = LandingPageMgt() self.cwai = CreateAdIdea() self.prq = PutRecordQuery()
def test_line_vip(self): with step('创建微信计划'): self._cwp.create_wc_ad_plan_for_model(put_model=3) self._cwp.get_plan_id() with step('创建微信广告创意'): self._cwai = CreateAdIdea() self._cwai.create_wc_ad_idea() self._cwai.get_idea_id() with step('新建落地页'): self._cqc = CreateQrCode() self._cqc.create_pay_qr_code() self._cqc.publish_website() self._cqc.create_link() #create_code() with step('落地页数据列表统计查询'): self._cqc.ldy_list_data_query() with step('入库记录流量数据查询'): self._prq = PutRecordQuery() self._prq.put_record_query() with step('广告创意流量数据查询'): self._cwai.ad_idea_flow_data_query()
class TestCompanyWcFlow: def setup(self): self._cwp = CreateAdPlan() self._cwai = CreateAdIdea() self._cqc = CreateQrCode() self._prq = PutRecordQuery() GLOBAL_VAR['projectName'] = const.projectName GLOBAL_VAR['ideaName'] = const.ideaName @step('企业微信流量入库_直线下发,普通投放模式') @logger('case') def test_line_common(self): with step('创建微信计划'): self._cwp.create_ad_plan() with step('创建微信广告创意'): self._cwp.get_plan_id() self._cwai = CreateAdIdea() self._cwai.create_wc_ad_idea() self._cwai.get_idea_id() with step('新建落地页'): self._cqc = CreateQrCode() self._cqc.create_qr_code() self._cqc.publish_website() self._cqc.create_link() #create_code() with step('落地页数据列表统计查询'): self._cqc.ldy_list_data_query() with step('入库记录流量数据查询'): self._prq = PutRecordQuery() self._prq.put_record_query() with step('广告创意流量数据查询'): self._cwai.ad_idea_flow_data_query() @step('企业微信流量入库_手动分配,普通投放模式') @logger('case') def test_manual_common(self): with step('创建微信计划'): self._cwp.create_wc_ad_plan_for_hand() self._cwp.get_plan_id() with step('创建微信广告创意'): self._cwai.create_wc_ad_idea() self._cwai.get_idea_id() with step('新建落地页'): self._cqc.create_qr_code() self._cqc.publish_website() self._cqc.create_link() #create_code() with step('落地页数据列表统计查询'): self._cqc.ldy_list_data_query() with step('入库记录流量数据查询'): self._prq.put_record_query() with step('广告创意流量数据查询'): self._cwai.ad_idea_flow_data_query() @step('企业微信流量入库_直线下发,接待投放模式') @logger('case') def test_reception_common(self): with step('创建微信计划'): self._cwp.create_wc_ad_plan_for_reception() self._cwp.get_plan_id() with step('创建微信广告创意'): self._cwai = CreateAdIdea() self._cwai.create_wc_ad_idea() self._cwai.get_idea_id() with step('新建落地页'): self._cqc = CreateQrCode() self._cqc.create_qr_code() self._cqc.publish_website() self._cqc.create_link() #create_code() with step('落地页数据列表统计查询'): self._cqc.ldy_list_data_query() with step('入库记录流量数据查询'): self._prq = PutRecordQuery() self._prq.put_record_query() with step('广告创意流量数据查询'): self._cwai.ad_idea_flow_data_query() @step('企业微信流量入库_直线下发,高转vip课投放模式') @logger('case') def test_line_vip(self): with step('创建微信计划'): self._cwp.create_wc_ad_plan_for_model(put_model=3) self._cwp.get_plan_id() with step('创建微信广告创意'): self._cwai = CreateAdIdea() self._cwai.create_wc_ad_idea() self._cwai.get_idea_id() with step('新建落地页'): self._cqc = CreateQrCode() self._cqc.create_pay_qr_code() self._cqc.publish_website() self._cqc.create_link() #create_code() with step('落地页数据列表统计查询'): self._cqc.ldy_list_data_query() with step('入库记录流量数据查询'): self._prq = PutRecordQuery() self._prq.put_record_query() with step('广告创意流量数据查询'): self._cwai.ad_idea_flow_data_query() @step('企业微信流量入库_微信流量手动分配,小咖投放模式') @logger('case') def test_manual_xk(self): with step('创建微信计划'): self._cwp.create_wc_ad_plan_for_model() self._cwp.get_plan_id() with step('创建微信广告创意'): self._cwai = CreateAdIdea() self._cwai.create_wc_ad_idea() self._cwai.get_idea_id() with step('新建落地页'): self._cqc = CreateQrCode() self._cqc.create_pay_qr_code() self._cqc.publish_website() self._cqc.create_link() #create_code() with step('落地页数据列表统计查询'): self._cqc.ldy_list_data_query() with step('入库记录流量数据查询'): self._prq = PutRecordQuery() self._prq.put_record_query() with step('广告创意流量数据查询'): self._cwai.ad_idea_flow_data_query() # if __name__ == '__main__': # import pytest # pytest.main([__file__])
def setup(self): self.prq = PutRecordQuery()
class TestPutRecordQuery: def setup(self): self.prq = PutRecordQuery() @allure.step('查询全部入库记录') @logger('case') 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) @allure.step('查询暂无意向记录') @logger('case') def test_query_no_intention_list(self): self.prq.no_intention_list() @allure.step('分配流量到院') @logger('case') 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() # @allure.step('批量分配流量到院-校验异常') # @logger('case') # def test_batch_allot_flow(self): # self.prq.batch_allot_flow() @allure.step('流量-入库记录查询-查询') @logger('case') def test_query_allot_plan(self): self.prq.put_record_query() @allure.step('查询-未成年流量') @logger('case') 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 @allure.step('查询-成年流量') @logger('case') 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 @allure.step('导出-成年流量') @logger('case') def test_export_adult_list(self): if rc.get_env() == 'pre': login.login_action('t0396753586') else: login.login_action('t0373492024') self.prq.export_adult_list() @allure.step('导出-未成年流量') @logger('case') def test_export_nonage_list(self): if rc.get_env() == 'pre': login.login_action('t0322511032') else: login.login_action('t0373492024') self.prq.export_nonage_list() @allure.step('新增-识别词') @logger('case') def test1_add_identify(self): if rc.get_env() == 'pre': login.login_action('t0396753586') else: login.login_action('t0373492024') self.prq.add_identify() @allure.step('编辑-识别词') @logger('case') 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() @allure.step('查询-识别词') @logger('case') def test3_query_identify(self): if rc.get_env() == 'pre': login.login_action('t0396753586') else: login.login_action('t0373492024') self.prq.query_identify(identifie='自动化测试-勿删') @allure.step('删除-识别词') @logger('case') 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()
class TestPersonalWechatScenario(): def setup(self): self._cwap = CreateAdPlan() self._cwai = CreateAdIdea() self._cqc = CreateQrCode() self._prq = PutRecordQuery() GLOBAL_VAR['projectName'] = const.projectName @logger('case') @allure.step('个人微信流量入库_直线下发,普通投放模式') def test_linear_distributed_of_general(self): with allure.step('新建广告计划-微信'): self._cwap = CreateAdPlan() self._cwap.create_ad_plan() with allure.step('创建微信广告创意'): self._cwap.get_plan_id() self._cwai = CreateAdIdea() self._cwai.create_personal_wechat_ad_ideas() self._cwai.get_idea_id() with allure.step('新建落地页'): self._cqc = CreateQrCode() self._cqc.add_personal_code() self._cqc.publish_website() self._cqc.create_link(accountId="wx359bdedd5d18907a", releaseChannel=3) # tools.create_code() with allure.step('落地页数据列表统计查询'): self._cqc.ldy_list_data_query() with allure.step('入库记录流量数据查询'): self._prq.put_record_query() with allure.step('广告创意流量数据查询'): self._cwai.ad_idea_flow_data_query() @logger('case') @allure.step('个人微信流量入库_手动分配,普通投放模式') def test_manual_allocation_of_general(self): with allure.step('新建广告计划-微信'): self._cwap.create_wc_ad_plan_for_hand() with allure.step('创建微信广告创意'): self._cwap.get_plan_id() self._cwai.create_personal_wechat_ad_ideas() self._cwai.get_idea_id() with allure.step('新建落地页'): self._cqc.add_personal_code() self._cqc.publish_website() self._cqc.create_link(accountId="wx359bdedd5d18907a", releaseChannel=3) #tools.create_code() with allure.step('落地页数据列表统计查询'): self._cqc.ldy_list_data_query() with allure.step('入库记录流量数据查询'): self._prq.put_record_query() with allure.step('广告创意流量数据查询'): self._cwai.ad_idea_flow_data_query() @logger('case') @allure.step('个人微信流量入库_直线下发,接待投放模式') def test_linear_distributed_of_reception(self): with allure.step('新建广告计划-微信'): self._cwap.create_wc_ad_plan_for_reception() with allure.step('创建微信广告创意'): self._cwap.get_plan_id() self._cwai = CreateAdIdea() self._cwai.create_personal_wechat_ad_ideas() self._cwai.get_idea_id() with allure.step('新建落地页'): self._cqc.add_personal_code() self._cqc.publish_website() self._cqc.create_link(accountId="wx359bdedd5d18907a", releaseChannel=3) #tools.create_code() with allure.step('落地页数据列表统计查询'): self._cqc.ldy_list_data_query() with allure.step('入库记录流量数据查询'): self._prq.put_record_query() with allure.step('广告创意流量数据查询'): self._cwai.ad_idea_flow_data_query() @logger('case') @allure.step('个人微信流量入库_直线下发,高转vip课投放模式') def test_linear_distributed_of_vip(self): with allure.step('新建广告计划-微信'): self._cwap.create_ad_plan(putMode=3) with allure.step('创建微信广告创意'): self._cwap.get_plan_id() self._cwai = CreateAdIdea() self._cwai.create_personal_wechat_ad_ideas() self._cwai.get_idea_id() with allure.step('新建落地页'): self._cqc.add_personal_code() self._cqc.publish_website() self._cqc.create_link(accountId="wx359bdedd5d18907a", releaseChannel=3) #tools.create_code() with allure.step('落地页数据列表统计查询'): self._cqc.ldy_list_data_query() with allure.step('入库记录流量数据查询'): self._prq.put_record_query() with allure.step('广告创意流量数据查询'): self._cwai.ad_idea_flow_data_query() @logger('case') @allure.step('个人微信流量入库_微信流量手动分配,小咖投放模式') def test_linear_distributed_of_small_cafe(self): with allure.step('新建广告计划-微信'): self._cwap.create_wc_xiaoka_ad_plan() with allure.step('创建微信广告创意'): self._cwap.get_plan_id() self._cwai = CreateAdIdea() self._cwai.create_personal_wechat_ad_ideas() self._cwai.get_idea_id() with allure.step('新建落地页'): self._cqc.add_personal_code() self._cqc.publish_website() self._cqc.create_link(accountId="wx359bdedd5d18907a", releaseChannel=3) #tools.create_code() with allure.step('落地页数据列表统计查询'): self._cqc.ldy_list_data_query() with allure.step('入库记录流量数据查询'): self._prq.put_record_query() with allure.step('广告创意流量数据查询'): self._cwai.ad_idea_flow_data_query()