def setUp(self):  # 每条用例执行测试之前都要执行此方法
        # self.jsonfile = '../../../cookiejson/cookieagent.json'
        # self.operationjson = OperationJson(file_path=self.jsonfile)   #实例化
        # self.cookie = self.operationjson.get_all_data()
        # print("self.cookie:%s" % self.cookie)
        self.activeweb = ActiveWeb()  # 实例化
        self.loginurl = LoginPage().pageurl
        self.activeweb.getUrl(self.loginurl)  # 打开网址
        self.activeweb.findElementByXpathAndInput(LoginPage().account,
                                                  MANAGER_LOGIN_ACCOUNT)
        self.activeweb.findElementByXpathAndInput(LoginPage().password,
                                                  MANAGER_LOGIN_PASSWORD)
        self.activeweb.findElementByXpathAndClick(LoginPage().loginbutton)
        self.activeweb.delayTime(3)
        self.testpage = ProcesingActivityEditPage()
        self.testpageurl = self.testpage.pageurl  #测试页面url

        self.testpagehdsjendtime = self.testpage.hdsj_endtime  # ---基础信息---#   活动时间结束时间输入框路径
        self.testpagehdyszjysinput = self.testpage.hdys_zjys_input  # ---基础信息---#   增加预算输入框路径

        self.testpagejllpedit = self.testpage.y_jllp_table_cz_just_one_edit  # ---活动奖励---#   券“编辑”文字链接

        self.testpagecancelbutton = self.testpage.cancelbutton  #取消按钮
        self.testpagesubmitbutton = self.testpage.submitbutton  #提交按钮

        ######################编辑优惠券页面###############################
        self.processingticketeditpage = ProcessingTicketEditPage(
        )  #进行中的活动的编辑优惠券页

        ######################活动列表页###############################
        self.activitylistpage = ActivityListPage()  #活动列表页
        self.activitylistpage_searchtableresult = self.activitylistpage.searchtableresult
Exemple #2
0
    def setUp(self):  # 每条用例执行测试之前都要执行此方法
        self.activeweb = ActiveWeb()  # 实例化
        self.loginurl = LoginPage().pageurl
        self.activeweb.getUrl(self.loginurl)  # 打开网址
        self.activeweb.findElementByXpathAndInput(LoginPage().account,
                                                  MANAGER_LOGIN_ACCOUNT)
        self.activeweb.findElementByXpathAndInput(LoginPage().password,
                                                  MANAGER_LOGIN_PASSWORD)
        self.activeweb.findElementByXpathAndClick(LoginPage().loginbutton)
        self.activeweb.delayTime(3)
        self.testpage = ActivityEditPage()
        self.testpageurl = self.testpage.pageurl  #测试页面url
        self.testpagehdmcinput = self.testpage.hdmc_input  # ---基础信息---#   活动名称输入框路劲
        self.testpagehdlxselect = self.testpage.hdlx_select  # ---基础信息---#   活动类型选项框路径
        self.testpagehdsjstarttime = self.testpage.hdsj_starttime  # ---基础信息---#   活动时间开始时间输入框路径
        self.testpagehdsjendtime = self.testpage.hdsj_endtime  # ---基础信息---#   活动时间结束时间输入框路径
        self.testpagehdysinput = self.testpage.hdys_input  # ---基础信息---#   活动预算输入框路径

        self.testpagehdbztextarea = self.testpage.hdbz_textarea  # ---基础信息---#  活动备注多行输入框路径

        self.testpagejllxselect = self.testpage.jllx_select  # ---活动奖励---# 奖励类型下拉框路径

        self.testpagecancelbutton = self.testpage.cancelbutton  #取消按钮
        self.testpagesubmitbutton = self.testpage.submitbutton  #提交按钮

        ######################活动列表页###############################
        self.activitylistpage = ActivityListPage()  #活动列表页
        self.activitylistpage_searchtableresult = self.activitylistpage.searchtableresult
 def test02(self):
     self.activeweb.findElementByXpathAndInput(LoginPage().account,
                                               MANAGER_LOGIN_ACCOUNT)
     self.activeweb.findElementByXpathAndInput(LoginPage().password,
                                               MANAGER_LOGIN_PASSWORD)
     self.activeweb.findElementByXpathAndClick("X")
     self.activeweb.delayTime(3)
 def testf(self):
     self.activeweb.findElementByXpathAndInput(LoginPage().account,
                                               MANAGER_LOGIN_ACCOUNT)
     self.activeweb.findElementByXpathAndInput(LoginPage().password,
                                               MANAGER_LOGIN_PASSWORD)
     self.activeweb.findElementByXpathAndClick(LoginPage().loginbutton)
     self.activeweb.delayTime(3)
     self.assertTrue(False)
    def setUp(self):  # 每条用例执行测试之前都要执行此方法
        # self.jsonfile = '../../../cookiejson/cookieagent.json'
        # self.operationjson = OperationJson(file_path=self.jsonfile)   #实例化
        # self.cookie = self.operationjson.get_all_data()
        # print("self.cookie:%s" % self.cookie)
        self.activeweb = ActiveWeb()  # 实例化
        self.loginurl = LoginPage().pageurl
        self.activeweb.getUrl(self.loginurl)  # 打开网址
        self.activeweb.findElementByXpathAndInput(LoginPage().account,
                                                  MANAGER_LOGIN_ACCOUNT)
        self.activeweb.findElementByXpathAndInput(LoginPage().password,
                                                  MANAGER_LOGIN_PASSWORD)
        self.activeweb.findElementByXpathAndClick(LoginPage().loginbutton)
        self.activeweb.delayTime(3)
        self.testpage = ActivityCreatePage()
        self.testpageurl = self.testpage.pageurl  #测试页面url
        self.testpagehdmcinput = self.testpage.hdmc_input  # ---基础信息---#   活动名称输入框路劲
        self.testpagehdlxselect = self.testpage.hdlx_select  # ---基础信息---#   活动类型选项框路径
        self.testpagehdsjstarttime = self.testpage.hdsj_starttime  # ---基础信息---#   活动时间开始时间输入框路径
        self.testpagehdsjendtime = self.testpage.hdsj_endtime  # ---基础信息---#   活动时间结束时间输入框路径
        self.testpagehdysinput = self.testpage.hdys_input  # ---基础信息---#   活动预算输入框路径

        self.testpagehdbztextarea = self.testpage.hdbz_textarea  # ---基础信息---#  活动备注多行输入框路径

        self.testpagejllxselect = self.testpage.jllx_select  # ---活动奖励---# 奖励类型下拉框路径
        self.testpagewtjlp = self.testpage.w_tjlp  # ---活动奖励---# 未添加礼品时,“添加礼品”文字链接路径

        self.testpagecancelbutton = self.testpage.cancelbutton  #取消按钮
        self.testpagesubmitbutton = self.testpage.submitbutton  #提交按钮

        ######################创建优惠券页面###############################
        self.ticketcreatepage = TicketCreatePage()  #创建优惠券页
        self.ticketcreatepage_kcsl_input = self.ticketcreatepage.kcsl_input  #第一部分# 库存数量输入框路径
        self.ticketcreatepage_qyxq_select = self.ticketcreatepage.qyxq_select  #第一部分# 券有效期选择框路径
        self.ticketcreatepage_yhqsm_areatext = self.ticketcreatepage.yhqsm_areatext  #第一部分# 优惠券说明多行输入框路径
        self.ticketcreatepage_yhqmc_input = self.ticketcreatepage.yhqmc_input  #第二部分# 优惠券名称输入框路径
        self.ticketcreatepage_yhlx_select = self.ticketcreatepage.yhlx_select  #第二部分# 优惠类型选择框路径
        self.ticketcreatepage_yhms_select = self.ticketcreatepage.yhms_select  #第二部分# 优惠模式选择框路径
        self.ticketcreatepage_zdxf_input = self.ticketcreatepage.zdxf_input  #第二部分# 最低消费输入框路径
        self.ticketcreatepage_zfqdxz_select = self.ticketcreatepage.zfqdxz_select  #第二部分# 支付渠道限制选择框路径
        self.ticketcreatepage_syfw_select = self.ticketcreatepage.syfw_select  #第二部分# 使用范围选择框路径

        self.ticketcreatepage_confirm_button = self.ticketcreatepage.confirm_button  #页面 确定按钮

        ######################活动列表页###############################
        self.activitylistpage = ActivityListPage()  #活动列表页
        self.activitylistpage_searchtableresult = self.activitylistpage.searchtableresult

        ######################待上线活动详情页###############################
        self.activitydetialspage = ActivityDetialsPage()  #活动列表页
Exemple #6
0
 def setUp(self):  # 每条用例执行测试之前都要执行此方法
     # self.jsonfile = '../../../cookiejson/cookieagent.json'
     # self.operationjson = OperationJson(file_path=self.jsonfile)   #实例化
     # self.cookie = self.operationjson.get_all_data()
     # print("self.cookie:%s" % self.cookie)
     self.activeweb = ActiveWeb()  # 实例化
     self.loginurl = LoginPage().pageurl
     self.activeweb.getUrl(self.loginurl)  # 打开网址
     self.activeweb.findElementByXpathAndInput(LoginPage().account,MANAGER_LOGIN_ACCOUNT)
     self.activeweb.findElementByXpathAndInput(LoginPage().password,MANAGER_LOGIN_PASSWORD)
     self.activeweb.findElementByXpathAndClick(LoginPage().loginbutton)
     self.activeweb.delayTime(3)
     self.testpage = ActivityListPage()
     self.testpageurl =self.testpage.pageurl   #测试页面url
 def setUp(self):  # 每条用例执行测试之前都要执行此方法
     # self.jsonfile = '../../../cookiejson/cookieagent.json'
     # self.operationjson = OperationJson(file_path=self.jsonfile)   #实例化
     # self.cookie = self.operationjson.get_all_data()
     # print("self.cookie:%s" % self.cookie)
     self.activeweb = ActiveWeb()  # 实例化
     self.loginurl = LoginPage().pageurl
     self.activeweb.getUrl(self.loginurl)  # 打开网址
     self.activeweb.findElementByXpathAndInput(LoginPage().account,MANAGER_LOGIN_ACCOUNT)
     self.activeweb.findElementByXpathAndInput(LoginPage().password,MANAGER_LOGIN_PASSWORD)
     self.activeweb.findElementByXpathAndClick(LoginPage().loginbutton)
     self.activeweb.delayTime(3)
     self.DSX = "nereus/marketing/admin/v/#/activityManage/missionAct/modifyOnLine"
     self.JXZ = "nereus/marketing/admin/v/#/activityManage/missionAct/modifyOffLine"
     self.DETAIL = "nereus/marketing/admin/v/#/activityManage/missionAct/missionDetail"
    def setUp(self):  # 每条用例执行测试之前都要执行此方法
        # self.jsonfile = '../../../cookiejson/cookieagent.json'
        # self.operationjson = OperationJson(file_path=self.jsonfile)   #实例化
        # self.cookie = self.operationjson.get_all_data()
        # print("self.cookie:%s" % self.cookie)
        self.activeweb = ActiveWeb()  # 实例化
        self.loginurl = LoginPage().pageurl
        self.activeweb.getUrl(self.loginurl)  # 打开网址
        self.activeweb.findElementByXpathAndInput(LoginPage().account,MANAGER_LOGIN_ACCOUNT)
        self.activeweb.findElementByXpathAndInput(LoginPage().password,MANAGER_LOGIN_PASSWORD)
        self.activeweb.findElementByXpathAndClick(LoginPage().loginbutton)
        self.activeweb.delayTime(3)
        self.testpage = MerchantListPage()
        self.testpageurl = self.testpage.pageurl   #测试页面url
        self.testpagesearchbutton = self.testpage.searchbutton   #测试页面搜索按钮
        self.testpagesearchresultxpathtrue = self.testpage.searchtableresult   #测试页面找到相应数据结果xpath路径
        self.testpagesearchresultxpathfalse = self.testpage.searchtableresult2  #测试页面没有找到相应数据结果xpath路径

        #审核页
        self.reviewpage = ReviewPage()
Exemple #9
0
    def setUp(self):  # 每条用例执行测试之前都要执行此方法
        # self.jsonfile = '../../../cookiejson/cookieagent.json'
        # self.operationjson = OperationJson(file_path=self.jsonfile)   #实例化
        # self.cookie = self.operationjson.get_all_data()
        # print("self.cookie:%s" % self.cookie)
        self.activeweb = ActiveWeb()  # 实例化
        self.loginurl = LoginPage().pageurl
        self.activeweb.getUrl(self.loginurl)  # 打开网址

        if ISONLINE:
            self.activeweb.findElementByXpathAndInput(
                LoginPage().account, ONLINE_MANAGER_LOGIN_ACCOUNT)
            self.activeweb.findElementByXpathAndInput(
                LoginPage().password, ONLINE_MANAGER_LOGIN_PASSWORD)
        else:
            self.activeweb.findElementByXpathAndInput(
                LoginPage().account, TEST_MANAGER_LOGIN_ACCOUNT)
            self.activeweb.findElementByXpathAndInput(
                LoginPage().password, TEST_MANAGER_LOGIN_PASSWORD)

        self.activeweb.findElementByXpathAndClick(LoginPage().loginbutton)
        self.activeweb.delayTime(3)

        self.testpage = TicketCreatePage()
        self.testpageqyxqselect = self.testpage.qyxq_select  # 第一部分# 券有效期选择框路径
        self.testpageyhmsselect = self.testpage.yhms_select  # 第二部分# 优惠模式选择框路径
        self.testpagesyfwselect = self.testpage.syfw_select  # 第二部分# 使用范围选择框路径
        self.testpageconfirmbutton = self.testpage.confirm_button_zdsh  # 页面确定按钮

        ######################创建活动页面###############################
        self.activitycreatepage = ActivityCreatePage()
        self.activitycreatepage_pageurl = self.activitycreatepage.pageurl
        self.activitycreatepage_w_tjlp = self.activitycreatepage.w_tjlp  # ---活动奖励---# 未添加礼品时,“添加礼品”文字链接路径
 def setUp(self):  # 每条用例执行测试之前都要执行此方法
     # self.jsonfile = '../../../cookiejson/cookieagent.json'
     # self.operationjson = OperationJson(file_path=self.jsonfile)   #实例化
     # self.cookie = self.operationjson.get_all_data()
     # print("self.cookie:%s" % self.cookie)
     self.activeweb = ActiveWeb()  # 实例化
     self.loginurl = LoginPage().pageurl
     self.activeweb.getUrl(self.loginurl)  # 打开网址
     if ISONLINE:
         self.activeweb.findElementByXpathAndInput(
             LoginPage().account, ONLINE_MANAGER_LOGIN_ACCOUNT)
         self.activeweb.findElementByXpathAndInput(
             LoginPage().password, ONLINE_MANAGER_LOGIN_PASSWORD)
     else:
         self.activeweb.findElementByXpathAndInput(
             LoginPage().account, TEST_MANAGER_LOGIN_ACCOUNT)
         self.activeweb.findElementByXpathAndInput(
             LoginPage().password, TEST_MANAGER_LOGIN_PASSWORD)
     self.activeweb.findElementByXpathAndClick(LoginPage().loginbutton)
     self.activeweb.delayTime(3)
     self.testpage = ActivityListPage()
     self.testpageurl = self.testpage.pageurl  #测试页面url
     self.testpagesearchbutton = self.testpage.cx_button
     self.testpagesearchresultxpathtrue = self.testpage.searchtableresult
     self.testpagesearchresultxpathfalse = self.testpage.searchtableresult2
    def setUp(self):  # 每条用例执行测试之前都要执行此方法
        # self.jsonfile = '../../../cookiejson/cookieagent.json'
        # self.operationjson = OperationJson(file_path=self.jsonfile)   #实例化
        # self.cookie = self.operationjson.get_all_data()
        # print("self.cookie:%s" % self.cookie)
        self.activeweb = ActiveWeb()  # 实例化
        self.loginurl = LoginPage().pageurl
        self.activeweb.getUrl(self.loginurl)  # 打开网址
        self.activeweb.findElementByXpathAndInput(LoginPage().account,
                                                  MANAGER_LOGIN_ACCOUNT)
        self.activeweb.findElementByXpathAndInput(LoginPage().password,
                                                  MANAGER_LOGIN_PASSWORD)
        self.activeweb.findElementByXpathAndClick(LoginPage().loginbutton)
        self.activeweb.delayTime(3)

        self.testpage = TicketCreatePage()
        self.testpageurl = self.testpage.pageurl  #测试页面url
        self.testpagekcslinput = self.testpage.kcsl_input  #第一部分# 库存数量输入框路径
        self.testpageqyxqselect = self.testpage.qyxq_select  #第一部分# 券有效期选择框路径
        self.testpageyhqsmareatext = self.testpage.yhqsm_areatext  #第一部分# 优惠券说明多行输入框路径
        self.testpageyhqmcinput = self.testpage.yhqmc_input  #第二部分# 优惠券名称输入框路径
        self.testpageyhlxselect = self.testpage.yhlx_select  #第二部分# 优惠类型选择框路径
        self.testpageyhmsselect = self.testpage.yhms_select  #第二部分# 优惠模式选择框路径
        self.testpagezdxfinput = self.testpage.zdxf_input  #第二部分# 最低消费输入框路径
        self.testpagezfqdxzselect = self.testpage.zfqdxz_select  #第二部分# 支付渠道限制选择框路径
        self.testpagesyfwselect = self.testpage.syfw_select  #第二部分# 使用范围选择框路径

        self.testpagecancelbutton = self.testpage.cancel_button  # 页面取消按钮
        self.testpageconfirmbutton = self.testpage.confirm_button  # 页面确定按钮

        ######################创建活动页面###############################
        self.activitycreatepage = ActivityCreatePage()
        self.activitycreatepage_pageurl = self.activitycreatepage.pageurl
        self.activitycreatepage_w_tjlp = self.activitycreatepage.w_tjlp  # ---活动奖励---# 未添加礼品时,“添加礼品”文字链接路径

        #pass
        ######################活动列表页###############################
        self.activitylistpage = ActivityListPage()  #活动列表页
        self.activitylistpage_searchtableresult = self.activitylistpage.searchtableresult
    def setUp(self):  # 每条用例执行测试之前都要执行此方法
        # self.jsonfile = '../../../cookiejson/cookieagent.json'
        # self.operationjson = OperationJson(file_path=self.jsonfile)   #实例化
        # self.cookie = self.operationjson.get_all_data()
        # print("self.cookie:%s" % self.cookie)
        self.activeweb = ActiveWeb()  # 实例化
        self.loginurl = LoginPage().pageurl
        self.activeweb.getUrl(self.loginurl)  # 打开网址

        if ISONLINE:
            self.activeweb.findElementByXpathAndInput(
                LoginPage().account, ONLINE_MANAGER_LOGIN_ACCOUNT)
            self.activeweb.findElementByXpathAndInput(
                LoginPage().password, ONLINE_MANAGER_LOGIN_PASSWORD)
        else:
            self.activeweb.findElementByXpathAndInput(
                LoginPage().account, TEST_MANAGER_LOGIN_ACCOUNT)
            self.activeweb.findElementByXpathAndInput(
                LoginPage().password, TEST_MANAGER_LOGIN_PASSWORD)

        self.activeweb.findElementByXpathAndClick(LoginPage().loginbutton)
        self.activeweb.delayTime(3)
        self.testpage = ActivityCreatePage()
        self.testpageurl = self.testpage.pageurl  #测试页面url
        self.testpagesubmitbutton = self.testpage.submitbutton  #提交按钮

        ######################创建优惠券页面###############################
        self.ticketcreatepage = TicketCreatePage()  #创建优惠券页
        self.ticketcreatepage_kcsl_input = self.ticketcreatepage.kcsl_input  #第一部分# 库存数量输入框路径
        self.ticketcreatepage_qyxq_select = self.ticketcreatepage.qyxq_select  #第一部分# 券有效期选择框路径
        self.ticketcreatepage_yhqsm_areatext = self.ticketcreatepage.yhqsm_areatext  #第一部分# 优惠券说明多行输入框路径
        self.ticketcreatepage_yhqmc_input = self.ticketcreatepage.yhqmc_input  #第二部分# 优惠券名称输入框路径
        self.ticketcreatepage_yhlx_select = self.ticketcreatepage.yhlx_select  #第二部分# 优惠类型选择框路径
        self.ticketcreatepage_yhms_select = self.ticketcreatepage.yhms_select  #第二部分# 优惠模式选择框路径
        self.ticketcreatepage_zdxf_input = self.ticketcreatepage.zdxf_input  #第二部分# 最低消费输入框路径
        self.ticketcreatepage_zfqdxz_select = self.ticketcreatepage.zfqdxz_select  #第二部分# 支付渠道限制选择框路径
        self.ticketcreatepage_syfw_select = self.ticketcreatepage.syfw_select  #第二部分# 使用范围选择框路径

        self.ticketcreatepage_confirm_button = self.ticketcreatepage.confirm_button  #页面 确定按钮

        ######################活动列表页###############################
        self.activitylistpage = ActivityListPage()  #活动列表页
        self.activitylistpage_searchtableresult = self.activitylistpage.searchtableresult

        ######################待上线活动详情页###############################
        self.activitydetialspage = ActivityDetialsPage()  #活动列表页
    def setUpClass(cls):
        cls.activeweb = ActiveWeb()  # 实例化
        cls.loginurl = LoginPage().pageurl
        cls.activeweb.getUrl(cls.loginurl)  # 打开网址

        if ISONLINE:
            cls.activeweb.findElementByXpathAndInput(
                LoginPage().account, ONLINE_MANAGER_LOGIN_ACCOUNT)
            cls.activeweb.findElementByXpathAndInput(
                LoginPage().password, ONLINE_MANAGER_LOGIN_PASSWORD)
        else:
            cls.activeweb.findElementByXpathAndInput(
                LoginPage().account, TEST_CHANGEPASSWORD_LOGIN_ACCOUNT)
            cls.activeweb.findElementByXpathAndInput(
                LoginPage().password, TEST_CHANGEPASSWORD_LOGIN_PASSWORD)

        cls.activeweb.findElementByXpathAndScriptClick(LoginPage().loginbutton)
        cls.activeweb.delayTime(3)
        cls.testpage = ChangePasswordPage()
    def setUp(self):  # 每条用例执行测试之前都要执行此方法
        self.activeweb = ActiveWeb()  # 实例化
        self.loginurl = LoginPage().pageurl
        self.activeweb.getUrl(self.loginurl)  # 打开网址

        if ISONLINE:
            self.activeweb.findElementByXpathAndInput(
                LoginPage().account, ONLINE_MANAGER_LOGIN_ACCOUNT)
            self.activeweb.findElementByXpathAndInput(
                LoginPage().password, ONLINE_MANAGER_LOGIN_PASSWORD)
        else:
            self.activeweb.findElementByXpathAndInput(
                LoginPage().account, TEST_MANAGER_LOGIN_ACCOUNT)
            self.activeweb.findElementByXpathAndInput(
                LoginPage().password, TEST_MANAGER_LOGIN_PASSWORD)

        self.activeweb.findElementByXpathAndScriptClick(
            LoginPage().loginbutton)
        self.activeweb.delayTime(3)
        self.testpage = ReviewPage()
        # self.testpageurl =self.testpage.pageurl   #测试页面url
        self.activeweb.getUrl(MerchantListPage().pageurl)
        self.activeweb.delayTime(3)
        pass
 def setUp(self):  # 每条用例执行测试之前都要执行此方法
     self.activeweb = ActiveWeb()  # 实例化
     self.loginurl = LoginPage().pageurl
     self.activeweb.getUrl(self.loginurl)  # 打开网址