def test_b_edit(self):
     open_homepage(self)
     requst = login(self)
     driver = self.driver
     status = 0
     code = random.randint(100, 9999)
     code = str(code)
     driver.find_element_by_xpath(
         "//div[@id='app']/div/nav/ul/li[4]/div").click()
     driver.find_element_by_id("main_navigation_member_template").click()
     time.sleep(2)
     driver.find_element_by_xpath("(//button[@type='button'])[5]").click()
     time.sleep(5)
     driver.find_element_by_xpath(
         "//div[@id='member_template_input_name']/input").clear()
     driver.find_element_by_xpath(
         "//div[@id='member_template_input_name']/input").send_keys(
             u"生日祝福短信" + code)
     driver.find_element_by_xpath(
         "//div[@id='member_template_input_sign']/input").clear()
     driver.find_element_by_xpath(
         "//div[@id='member_template_input_sign']/input").send_keys(
             u"短信签名信息" + code)
     driver.find_element_by_xpath(
         "//div[@id='member_template_input_smsList']/textarea").clear()
     driver.find_element_by_xpath(
         "//div[@id='member_template_input_smsList']/textarea").send_keys(
             u"祝你生日快乐" + code)
     driver.find_element_by_id("member_template_btn_save").click()
예제 #2
0
 def test_a_update(self):
     open_homepage(self)
     requst = login(self)
     driver = self.driver
     code = random.randint(1000,9999)
     code = str(code)
     driver.find_element_by_xpath("//div[@id='app']/div/nav/ul/li/div/i[2]").click()
     driver.find_element_by_id("main_navigation_system_enterprise").click()
     driver.implicitly_wait(30)
     driver.find_element_by_xpath("//div[@id='system_enterprise_companyinfo_input_name']/input").clear()
     driver.find_element_by_xpath("//div[@id='system_enterprise_companyinfo_input_name']/input").send_keys(u"企业名称"+code)
     # driver.find_element_by_css_selector("span.ivu-select-selected-value").click()
     driver.find_element_by_xpath("//div[@id='system_enterprise_companyinfo_input_modelprovince']/div/i[2]").click()
     driver.find_element_by_xpath("//div[@id='system_enterprise_companyinfo_input_modelprovince']/div[2]/ul[2]/li[13]").click()
     time.sleep(2)
     driver.find_element_by_xpath("//div[@id='system_enterprise_companyinfo_input_modelcity']/div/i[2]").click()
     driver.find_element_by_xpath("//div[@id='system_enterprise_companyinfo_input_modelcity']/div[2]/ul[2]/li[2]").click()
     time.sleep(2)
     driver.find_element_by_xpath("//div[@id='system_enterprise_companyinfo_input_enttype']/div/i[2]").click()
     driver.find_element_by_xpath("//div[@id='system_enterprise_companyinfo_input_enttype']/div[2]/ul[2]/li[2]").click()
     driver.find_element_by_xpath("//div[@id='system_enterprise_companyinfo_input_contactname']/input").clear()
     time.sleep(2)
     driver.find_element_by_xpath("//div[@id='system_enterprise_companyinfo_input_contactname']/input").send_keys(u"关云长"+code)
     driver.find_element_by_xpath("//div[@id='system_enterprise_companyinfo_input_contactphone']/input").clear()
     driver.find_element_by_xpath("//div[@id='system_enterprise_companyinfo_input_contactphone']/input").send_keys("1380013"+code)
     driver.find_element_by_xpath("//div[@id='system_enterprise_companyinfo_input_introduce']/textarea").clear()
     driver.find_element_by_xpath("//div[@id='system_enterprise_companyinfo_input_introduce']/textarea").send_keys(u"这个企业很牛逼"+code)
     driver.find_element_by_xpath("//div[@id='system_enterprise_companyinfo_input_valueweb']/input").clear()
     driver.find_element_by_xpath("//div[@id='system_enterprise_companyinfo_input_valueweb']/input").send_keys("http://www.baidu.com")
     driver.find_element_by_xpath("//button[@id='system_enterprise_companyinfo_button_createqr']").click()
     driver.find_element_by_xpath("//button[@id='system_enterprise_companyinfo_button_submit']").click()
     msg_text=u"企业信息保存成功"
     chk_msg(self,msg_text)
    def test_a_add(self):
        open_homepage(self)
        requst = login(self)
        driver = self.driver
        status = 0
        driver.find_element_by_xpath("//div[@id='app']/div/nav/ul/li[3]/div").click()
        driver.find_element_by_id("main_navigation_product_line").click()
        for i in range(10):
            try:
                if u"还没有产品线" == driver.find_element_by_xpath("//div[@id='product_line_list_error_view']/h2").text:
                    status=1
                    break
            except: pass
            time.sleep(1)
        else:
            print(u"已经有产品线数据")

        if (status==1):
            print(u"中间按钮")
            driver.find_element_by_xpath("//div[@id='product_line_list_error_view']/button").click()
        else:
            print(u"点击顶部按钮")
            driver.find_element_by_id("product_line_add").click()
        time.sleep(2)
        driver.find_element_by_xpath("//div[@id='product_line_edit_name']/input").clear()
        driver.find_element_by_xpath("//div[@id='product_line_edit_name']/input").send_keys(u"哈根达斯流水线")
        #driver.find_element_by_xpath("//div[@id='product_line_edit_desc']/textarea").clear()
        #driver.find_element_by_xpath("//div[@id='product_line_edit_desc']/textarea").send_keys(u"哈根达斯流水线产业1仓")
        driver.find_element_by_id("product_line_edit_submit").click()
        msg_text=u"更新产品线成功"
        chk_msg(self,msg_text)
예제 #4
0
    def test_c_upload_certification(self):

        open_homepage(self)
        requst = login(self)
        username = requst[0]
        phone_num = username
        driver = self.driver
        code = random.randint(100000,999999)
        code = str(code)
        driver.find_element_by_xpath("//div[@id='app']/div/nav/ul/li/div/i[2]").click()
        driver.find_element_by_id("main_navigation_system_enterprise").click()
        driver.implicitly_wait(30)
        driver.find_element_by_id("system_enterprise_auth_button_showauthform").click()
        driver.find_element_by_xpath("//div[@id='system_enterprise_auth_input_name']/input").clear()
        driver.find_element_by_xpath("//div[@id='system_enterprise_auth_input_name']/input").send_keys(u"牛逼的企业"+code)
        driver.find_element_by_xpath("//div[@id='system_enterprise_auth_input_bizlicense']/input").clear()
        driver.find_element_by_xpath("//div[@id='system_enterprise_auth_input_bizlicense']/input").send_keys(code)
        driver.find_element_by_xpath("//div[@id='system_enterprise_auth_input_bizscope']/textarea").clear()
        driver.find_element_by_xpath("//div[@id='system_enterprise_auth_input_bizscope']/textarea").send_keys(u"啥都可以卖"+code)
        driver.find_element_by_xpath("//div[@id='system_enterprise_auth_input_legalperson']/input").clear()
        driver.find_element_by_xpath("//div[@id='system_enterprise_auth_input_legalperson']/input").send_keys(u"张飞"+code)
        driver.find_element_by_xpath("//div[@id='system_enterprise_auth_input_addrinfo']/input").clear()
        driver.find_element_by_xpath("//div[@id='system_enterprise_auth_input_addrinfo']/input").send_keys(u"三国杀"+code)
        driver.find_element_by_xpath("//div[@id='system_enterprise_auth_input_licence']/input").clear()
        driver.find_element_by_xpath("//div[@id='system_enterprise_auth_input_licence']/input").send_keys("F:\\auto_test_qrb\\update\\01.jpg")
        time.sleep(5)
        driver.find_element_by_id("system_enterprise_auth_button_submit").click()
        updata_sql= "UPDATE enterprise  SET approved =0 WHERE enterprise.id IN ( SELECT	ent_id FROM	ent_user	WHERE	mobile = '"+phone_num+"')"
        #print(updata_sql)
        update_p(sql=updata_sql)
        msg_text=u"认证信息提交成功"
        chk_msg(self,msg_text)
예제 #5
0
    def test_a_add(self):
        open_homepage(self)
        requst = login(self)
        driver = self.driver
        status = 0
        code = random.randint(100,9999)
        code = str(code)
        driver.find_element_by_xpath("//div[@id='app']/div/nav/ul/li[4]/div").click()
        driver.find_element_by_id("main_navigation_member_labels").click()
        time.sleep(2)
        for i in range(10):
            try:
                if u"还没有标签" == driver.find_element_by_xpath("//div[@id='member_labels_list_error']/h2").text:
                    status=1
                    print(status)
                    print(u"还没有标签")
                    break
            except: pass
            time.sleep(1)
        else:
            print(u"已经有标签")

        print(status)
        if (status==1):
            print(u"中间按钮")
            driver.find_element_by_xpath("(//button[@type='button'])[3]").click()
        else:
            print(u"点击顶部按钮")
            driver.find_element_by_id("member_labels_btn_add").click()

        time.sleep(5)


        # driver.find_element_by_xpath("//div[@id='member_labels_input_name']/input").clear()
        # driver.find_element_by_xpath("//div[@id='member_labels_input_name']/input").send_keys(u"标签名字")
        # time.sleep(2)
        # driver.find_element_by_css_selector("div.ivu-btn-group > button.ivu-btn").click()
        # driver.find_element_by_xpath("//div[@id='member_labels_table_rulelist']/div/div[2]/table/tbody/tr/td/div/div/div/i[2]").click()
        # driver.find_element_by_xpath("//div[@id='member_labels_table_rulelist']/div/div[2]/table/tbody/tr/td/div/div/div[2]/ul[2]/li").click()
        # driver.find_element_by_xpath("//div[@id='member_labels_table_rulelist']/div/div[2]/table/tbody/tr/td[2]/div/div/div/i[2]").click()
        # driver.find_element_by_xpath("//div[@id='member_labels_table_rulelist']/div/div[2]/table/tbody/tr/td[2]/div/div/div[2]/ul[2]/li[2]").click()
        # time.sleep(2)
        # driver.find_element_by_xpath("//div[@id='member_labels_table_rulelist']/div/div[2]/table/tbody/tr/td[3]/div/div/div[2]/div/div[2]/div/div/i").click()
        # driver.find_element_by_xpath("(//input[@type='radio'])[2]").click()
        # driver.find_element_by_id("member_labels_btn_save_label").click()

        driver.find_element_by_xpath("//div[@id='member_labels_input_name']/input").clear()
        driver.find_element_by_xpath("//div[@id='member_labels_input_name']/input").send_keys(u"标签名称")
        driver.find_element_by_css_selector("div.ivu-btn-group > button.ivu-btn").click()
        driver.find_element_by_xpath("//div[@id='member_labels_table_rulelist']/div/div[2]/table/tbody/tr/td/div/div/div/i[2]").click()
        driver.find_element_by_xpath("//div[@id='member_labels_table_rulelist']/div/div[2]/table/tbody/tr/td/div/div/div[2]/ul[2]/li[2]").click()
        time.sleep(3)
        driver.find_element_by_xpath("//div[@id='member_labels_table_rulelist']/div/div[2]/table/tbody/tr/td[2]/div/div/div/span").click()
        driver.find_element_by_xpath("//div[@id='member_labels_table_rulelist']/div/div[2]/table/tbody/tr/td[2]/div/div/div[2]/ul[2]/li[2]").click()
        time.sleep(2)
        driver.find_element_by_xpath("//div[@id='member_labels_table_rulelist']/div/div[2]/table/tbody/tr/td[3]/div/div/div/i[2]").click()
        driver.find_element_by_xpath("//div[@id='member_labels_table_rulelist']/div/div[2]/table/tbody/tr/td[3]/div/div/div[2]/div/div/div/div[2]").click()
        driver.find_element_by_xpath("//div[@id='member_labels_table_rulelist']/div/div[2]/table/tbody/tr/td[3]/div/div/div[2]/div/div[2]/div/div/i").click()
        time.sleep(2)
        driver.find_element_by_id("member_labels_btn_save_label").click()
예제 #6
0
    def test_reset_pwd(self):
        open_homepage(self)
        phone_num='17799999999'
        passwd_num='123456'
        driver = self.driver
        driver.get(self.base_url + "/signin")
        time.sleep(80)
        # 因为同一个手机号一分钟之内只能发一条短信.这里需要等待注册的短信发送超过60秒后在发送忘记重置密码的短信
        driver.find_element_by_link_text(u"找回密码").click()
        print(u"点击找回密码")
        time.sleep(10)

        driver.find_element_by_xpath("//div[@id='resetPwd_account']/input").clear()
        driver.find_element_by_xpath("//div[@id='resetPwd_account']/input").send_keys(phone_num)
        driver.find_element_by_xpath("//div[@id='resetPwd_password']/input").clear()
        driver.find_element_by_xpath("//div[@id='resetPwd_password']/input").send_keys(passwd_num)
        driver.find_element_by_xpath("//div[@id='resetPwd_password_confirm']/input").clear()
        driver.find_element_by_xpath("//div[@id='resetPwd_password_confirm']/input").send_keys(passwd_num)
        driver.find_element_by_id("resetPwd_sendsms_btn").click()
        time.sleep(10)
        Random_code = selcet_chg_pwd (phone_num)
        Random_code = bytes.decode(Random_code)
        print (Random_code)
        driver.find_element_by_xpath("//div[@id='resetPwd_sms_code']/input").clear()
        driver.find_element_by_xpath("//div[@id='resetPwd_sms_code']/input").send_keys(Random_code)
        driver.find_element_by_id("resetPwd_btn").click()
        time.sleep(3)
        login(self)
 def test_b_edit_code(self):
     open_homepage(self)
     requst = login(self)
     driver = self.driver
     driver.find_element_by_xpath(
         "//div[@id='app']/div/nav/ul/li[2]/div").click()
     driver.find_element_by_id("main_navigation_qrcode_static").click()
     driver.implicitly_wait(30)
     driver.find_element_by_xpath(
         "//div[@id='qrcode_static_qrcodelist_table']/div/div[2]/table/tbody/tr/td[2]/div/div/button"
     ).click()
     driver.find_element_by_id("qrcode_static_btn_texttype").click()
     driver.find_element_by_xpath(
         "//div[@id='qrcode_static_qrcodelist_textinput']/textarea").clear(
         )
     driver.find_element_by_xpath(
         "//div[@id='qrcode_static_qrcodelist_textinput']/textarea"
     ).send_keys(u"文本内容就是我")
     driver.find_element_by_id("qrcode_static_btn_webtype").click()
     driver.find_element_by_xpath(
         "//div[@id='qrcode_static_qrcodelist_webinput']/input").clear()
     driver.find_element_by_xpath(
         "//div[@id='qrcode_static_qrcodelist_webinput']/input").send_keys(
             "www.baiduyun.com")
     driver.find_element_by_id(
         "qrcode_static_qrcodelist_saveqrcode").click()
     msg_text = u"编辑内容成功"
     chk_msg(self, msg_text)
예제 #8
0
 def setUpClass(self):
     open_homepage(self)
     request = login(self)
     self.webdriver = self.driver
     self.webdriver.find_element_by_id("main_navigation_marketing").click()
     time.sleep(2)
     self.webdriver.find_element_by_id("main_navigation_marketing_qrcode").click()
예제 #9
0
    def setUpClass(self):
        open_homepage(self)
        request = login(self)
        self.webdriver = self.driver

        self.webdriver.find_element_by_css_selector(
            "div.ivu-menu-submenu-title").click()
        self.webdriver.find_element_by_id(
            "main_navigation_system_message").click()
예제 #10
0
    def test_chang_phone_num(self):
        open_homepage(self)
        requst = login(self)
        username = requst[0]
        phone_num = username
        newphone_num = '15881015817'
        driver = self.driver
        driver.implicitly_wait
        driver.find_element_by_css_selector(
            "div.ivu-menu-submenu-title").click()
        driver.find_element_by_id("main_navigation_system_profile").click()
        driver.implicitly_wait(30)
        driver.find_element_by_id("userprofile_phone_change").click()
        driver.find_element_by_id("userprofile_phone_change_sms_send").click()
        time.sleep(5)
        Random_code = selcet_chg_mobile(phone_num)
        Random_code = bytes.decode(Random_code)
        print(Random_code)
        driver.find_element_by_xpath(
            "//div[@id='userprofile_phone_change_current_sms_code']/input"
        ).clear()
        driver.find_element_by_xpath(
            "//div[@id='userprofile_phone_change_current_sms_code']/input"
        ).send_keys(Random_code)
        driver.find_element_by_id("userprofile_phone_change_next").click()
        time.sleep(2)
        driver.find_element_by_xpath(
            "//div[@id='userprofile_phone_change_new']/input").clear()
        driver.find_element_by_xpath(
            "//div[@id='userprofile_phone_change_new']/input").send_keys(
                newphone_num)
        driver.find_element_by_id(
            "userprofile_phone_change_new_sms_send").click()
        time.sleep(5)
        print(u"获取新号码的验证码")
        Random_code = selcet_chg_mobile(newphone_num)
        Random_code = bytes.decode(Random_code)
        print(Random_code)
        driver.find_element_by_xpath(
            "//div[@id='userprofile_phone_change_new_sms_code']/input").clear(
            )
        driver.find_element_by_xpath(
            "//div[@id='userprofile_phone_change_new_sms_code']/input"
        ).send_keys(Random_code)
        driver.find_element_by_id("userprofile_phone_change_save").click()

        updat_sql = "UPDATE ent_user SET mobile = '" + phone_num + "' WHERE mobile='" + newphone_num + "'"
        update_p(sql=updat_sql)

        user_idsql = "SELECT id FROM  ent_user where  mobile='" + phone_num + "'"
        userid = get_id(sql=user_idsql)
        print(userid)
        delete_cache(userid)

        msg_text = u"新手机号绑定成功"
        chk_msg(self, msg_text)
예제 #11
0
    def test_a_add(self):
        open_homepage(self)
        requst = login(self)
        driver = self.driver
        status = 0
        code = random.randint(100, 9999)
        code = str(code)
        driver.find_element_by_xpath(
            "//div[@id='app']/div/nav/ul/li[3]/div").click()
        driver.find_element_by_id("main_navigation_product_management").click()
        for i in range(30):
            try:
                if u"还没有产品" == driver.find_element_by_xpath(
                        "//div[@id='product_product_list_error']/h2").text:
                    status = 1
                    break
            except:
                pass
            time.sleep(1)
        else:
            print(u"已经有产品")

        if (status == 1):
            print(u"中间按钮")
            driver.find_element_by_xpath(
                "//div[@id='product_product_list_error']/button").click()
        else:
            print(u"点击顶部按钮")
            driver.find_element_by_id("product_product_btn_addproduct").click()

        driver.find_element_by_xpath(
            "//div[@id='product_addproduct_input_name']/input").clear()
        driver.find_element_by_xpath(
            "//div[@id='product_addproduct_input_name']/input").send_keys(
                u"可爱多" + code)
        driver.find_element_by_xpath(
            "//div[@id='product_addproduct_select_line']/div/span").click()
        driver.find_element_by_xpath(
            "//div[@id='product_addproduct_select_line']/div[2]/ul[2]/li"
        ).click()
        driver.find_element_by_xpath(
            "//div[@id='product_addproduct_input_units']/input").clear()
        driver.find_element_by_xpath(
            "//div[@id='product_addproduct_input_units']/input").send_keys(
                u"东莞1厂" + code)
        driver.find_element_by_xpath(
            "//div[@id='product_addproduct_input_specification']/input").clear(
            )
        driver.find_element_by_xpath(
            "//div[@id='product_addproduct_input_specification']/input"
        ).send_keys(u"袋装" + code)
        driver.find_element_by_id("product_addproduct_btn_save").click()
        msg_text = u"添加成功"
        chk_msg(self, msg_text)
예제 #12
0
    def test_b_chang_pwd(self):
        open_homepage(self)
        requst = login(self)
        #passwordmd5='RNqbeGeD9GVLiSj3/J4b9MDF$dFXY0/jsYom8ehysg006T69Mimpm3crDnfmfB9I1Yls='
        passwordmd5 = 'yEmTu+yT0VVEB6xOdZnGp3x/$5QY6GCt7PIxLEpIHqSTPSZNS/RCOQAybLg11wUPHuHw='
        #passwordmd5='OkDK/+Myx6lueyGvhFrI5Iac$Y1nPHwhfgl2lmz1fveVZim0lpNfHs5VNwz6xRLfDBC4='
        username = requst[0]
        phone_num = username
        passwd = requst[1]
        newpasswd = '123456a'
        driver = self.driver
        driver.implicitly_wait
        driver.find_element_by_css_selector(
            "div.ivu-menu-submenu-title").click()
        driver.find_element_by_id("main_navigation_system_profile").click()
        driver.implicitly_wait(30)
        driver.find_element_by_id("userprofile_password_change").click()
        driver.find_element_by_xpath("//input[@type='password']").clear()
        driver.find_element_by_xpath("//input[@type='password']").send_keys(
            passwd)
        driver.find_element_by_xpath(
            "//div[@id='userprofile_password_change_new']/input").clear()
        driver.find_element_by_xpath(
            "//div[@id='userprofile_password_change_new']/input").send_keys(
                newpasswd)
        driver.find_element_by_xpath(
            "//div[@id='userprofile_password_change_new_confirm']/input"
        ).clear()
        driver.find_element_by_xpath(
            "//div[@id='userprofile_password_change_new_confirm']/input"
        ).send_keys(newpasswd)
        driver.find_element_by_id(
            "userprofile_password_change_sms_send").click()
        time.sleep(5)
        Random_code = selcet_chg_pwd(phone_num)
        Random_code = bytes.decode(Random_code)
        print(Random_code)
        driver.find_element_by_xpath(
            "//div[@id='userprofile_password_change_sms_code']/input").clear()
        driver.find_element_by_xpath(
            "//div[@id='userprofile_password_change_sms_code']/input"
        ).send_keys(Random_code)
        driver.find_element_by_id("userprofile_password_change_save").click()

        updat_sql = "UPDATE ent_user SET password = '******' WHERE mobile='" + phone_num + "'"
        update_p(sql=updat_sql)

        msg_text = u"更新账户密码成功"
        chk_msg(self, msg_text)

        user_idsql = "SELECT id FROM  ent_user where  mobile='" + phone_num + "'"
        userid = get_id(sql=user_idsql)
        print(userid)
        delete_cache(userid)
예제 #13
0
    def test_b_upload_logo(self):
        open_homepage(self)
        requst = login(self)
        driver = self.driver
        driver.find_element_by_xpath("//div[@id='app']/div/nav/ul/li/div/i[2]").click()
        driver.find_element_by_id("main_navigation_system_enterprise").click()
        driver.implicitly_wait(30)
        driver.find_element_by_xpath("//div[@id='system_enterprise_companyinfo_input_logo']/input").clear()
        driver.find_element_by_xpath("//div[@id='system_enterprise_companyinfo_input_logo']/input").send_keys("F:\\auto_test_qrb\\update\\00.jpg")

        time.sleep(2)
    def test_a_add(self):
        open_homepage(self)
        requst = login(self)
        driver = self.driver
        status = 0
        code = random.randint(100, 9999)
        code = str(code)
        driver.find_element_by_xpath(
            "//div[@id='app']/div/nav/ul/li[4]/div").click()
        driver.find_element_by_id("main_navigation_member_template").click()
        time.sleep(2)
        for i in range(10):
            try:
                if u"还没有短信模板" == driver.find_element_by_css_selector(
                        "h2").text:
                    status = 1
                    print(status)
                    print(u"还没有短信模板")
                    break
            except:
                pass
            time.sleep(1)
        else:
            print(u"已经有短信模板")

        print(status)
        if (status == 1):
            print(u"中间按钮")
            driver.find_element_by_xpath(
                "(//button[@type='button'])[3]").click()
        else:
            print(u"点击顶部按钮")
            driver.find_element_by_id("member_template_btn_add").click()

        time.sleep(5)
        driver.find_element_by_xpath(
            "//div[@id='member_template_input_name']/input").clear()
        driver.find_element_by_xpath(
            "//div[@id='member_template_input_name']/input").send_keys(
                u"生日祝福短信" + code)
        driver.find_element_by_xpath(
            "//div[@id='member_template_input_sign']/input").clear()
        driver.find_element_by_xpath(
            "//div[@id='member_template_input_sign']/input").send_keys(
                u"短信签名信息" + code)
        driver.find_element_by_xpath(
            "//div[@id='member_template_input_smsList']/textarea").clear()
        driver.find_element_by_xpath(
            "//div[@id='member_template_input_smsList']/textarea").send_keys(
                u"祝你生日快乐" + code)
        driver.find_element_by_id("member_template_btn_save").click()
 def test_d_delete(self):
     open_homepage(self)
     requst = login(self)
     driver = self.driver
     code = random.randint(100,9999)
     code = str(code)
     driver.find_element_by_xpath("//div[@id='app']/div/nav/ul/li[3]/div").click()
     driver.find_element_by_id("main_navigation_product_batch").click()
     time.sleep(20)
     driver.find_element_by_xpath("(//button[@type='button'])[7]").click()
     driver.find_element_by_xpath("(//button[@type='button'])[15]").click()
     msg_text=u"批次删除成功"
     chk_msg(self,msg_text)
     self.test_a_add()
    def test_a_add_code(self):
        open_homepage(self)
        requst = login(self)
        status = 3
        driver = self.driver
        driver.find_element_by_xpath(
            "//div[@id='app']/div/nav/ul/li[2]/div").click()
        driver.find_element_by_id("main_navigation_qrcode_static").click()
        for i in range(30):
            try:
                if u"还没有静态码" == driver.find_element_by_xpath(
                        "//div[@id='system_employeesetting_list_error']/h2"
                ).text:
                    status = 1
                    print(status)
                    break
            except:
                pass
            time.sleep(1)
        else:
            print(u"找到内容")

        if (status == 1):
            print(u"中间按钮")
            driver.find_element_by_xpath(
                "//div[@id='system_employeesetting_list_error']/button").click(
                )
        else:
            print(u"点击顶部按钮")
            driver.find_element_by_id(
                "qrcode_static_qrcodelist_creatQRcode").click()
        driver.find_element_by_xpath(
            "//button[@id='qrcode_static_btn_texttype']").click()
        driver.find_element_by_xpath(
            "//div[@id='qrcode_static_qrcodelist_textinput']/textarea").clear(
            )
        driver.find_element_by_xpath(
            "//div[@id='qrcode_static_qrcodelist_textinput']/textarea"
        ).send_keys(u"静态码")
        driver.find_element_by_xpath(
            "//button[@id='qrcode_static_btn_webtype']").click()
        driver.find_element_by_xpath(
            "//div[@id='qrcode_static_qrcodelist_webinput']/input").clear()
        driver.find_element_by_xpath(
            "//div[@id='qrcode_static_qrcodelist_webinput']/input").send_keys(
                "www.baidu.com")
        driver.find_element_by_id(
            "qrcode_static_qrcodelist_saveqrcode").click()
        msg_text = u"新增内容成功"
        chk_msg(self, msg_text)
예제 #17
0
 def test_d_delete(self):
     open_homepage(self)
     requst = login(self)
     driver = self.driver
     status = 0
     code = random.randint(100, 9999)
     code = str(code)
     driver.find_element_by_xpath(
         "//div[@id='app']/div/nav/ul/li[4]/div").click()
     driver.find_element_by_id("main_navigation_member_levels").click()
     time.sleep(5)
     driver.find_element_by_xpath("(//button[@type='button'])[8]").click()
     driver.find_element_by_xpath("(//button[@type='button'])[13]").click()
     self.test_a_add()
    def test_d_delete(self):
        open_homepage(self)
        requst = login(self)
        driver = self.driver
        driver.find_element_by_xpath("//div[@id='app']/div/nav/ul/li[3]/div").click()
        driver.find_element_by_id("main_navigation_product_line").click()
        driver.implicitly_wait(30)
        driver.find_element_by_xpath("//div[@id='product_line_container']/div/div[2]/div[3]/div/div/div[2]/table/tbody/tr/td[4]/div/div/button[3]").click()
        #driver.find_element_by_xpath("(//button[@type='button'])[11]").click()
        driver.find_element_by_xpath("(//button[@type='button'])[13]").click()
        msg_text=u"产品线删除成功"
        chk_msg(self,msg_text)

        self.test_a_add()
 def test_d_delete_code(self):
     open_homepage(self)
     requst = login(self)
     driver = self.driver
     driver.find_element_by_xpath(
         "//div[@id='app']/div/nav/ul/li[2]/div").click()
     driver.find_element_by_id("main_navigation_qrcode_static").click()
     driver.implicitly_wait(30)
     driver.find_element_by_xpath(
         "//div[@id='qrcode_static_qrcodelist_table']/div/div[2]/table/tbody/tr/td[2]/div/div/button[3]"
     ).click()
     driver.find_element_by_xpath("(//button[@type='button'])[14]").click()
     msg_text = u"删除静态码成功"
     chk_msg(self, msg_text)
예제 #20
0
 def test_d_delete(self):
     open_homepage(self)
     requst = login(self)
     driver = self.driver
     code = random.randint(100, 9999)
     code = str(code)
     driver.find_element_by_xpath(
         "//div[@id='app']/div/nav/ul/li[3]/div").click()
     driver.find_element_by_id("main_navigation_product_management").click()
     driver.implicitly_wait(30)
     driver.find_element_by_xpath("(//button[@type='button'])[9]").click()
     driver.find_element_by_xpath("(//button[@type='button'])[12]").click()
     msg_text = u"删除产品成功"
     chk_msg(self, msg_text)
     self.test_a_add()
 def test_b_edit(self):
     open_homepage(self)
     requst = login(self)
     driver = self.driver
     driver.find_element_by_xpath("//div[@id='app']/div/nav/ul/li[3]/div").click()
     driver.find_element_by_id("main_navigation_product_line").click()
     time.sleep(20)
     driver.find_element_by_xpath("(//button[@type='button'])[7]").click()
     driver.find_element_by_xpath("//div[@id='product_line_edit_name']/input").clear()
     driver.find_element_by_xpath("//div[@id='product_line_edit_name']/input").send_keys("8735")
     # driver.find_element_by_xpath("//div[@id='product_line_edit_desc']/textarea").clear()
     # driver.find_element_by_xpath("//div[@id='product_line_edit_desc']/textarea").send_keys(u"阿嘎松")
     driver.find_element_by_xpath("//button[@id='product_line_edit_submit']").click()
     msg_text=u"更新产品线成功"
     chk_msg(self,msg_text)
예제 #22
0
 def test_a_set(self):
     open_homepage(self)
     requst = login(self)
     driver = self.driver
     driver.find_element_by_css_selector(
         "div.ivu-menu-submenu-title").click()
     driver.find_element_by_id("main_navigation_system_payment").click()
     driver.implicitly_wait(30)
     driver.find_element_by_css_selector(
         "button.ivu-btn.payment-list-edit-btn").click()
     driver.find_element_by_xpath(
         "//div[@id='system_payment_setting_ctId']/input").clear()
     driver.find_element_by_xpath(
         "//div[@id='system_payment_setting_ctId']/input").send_keys(
             "1234567890")
     driver.find_element_by_xpath(
         "//div[@id='system_payment_setting_ctSecret']/input").clear()
     driver.find_element_by_xpath(
         "//div[@id='system_payment_setting_ctSecret']/input").send_keys(
             "WIXJLGAXMGAOSFDASJDFASDFARGSDG")
     driver.find_element_by_xpath(
         "//div[@id='system_payment_setting_AppId']/input").clear()
     driver.find_element_by_xpath(
         "//div[@id='system_payment_setting_AppId']/input").send_keys(
             "99888")
     driver.find_element_by_xpath(
         "//div[@id='system_payment_setting_AppSecret']/input").clear()
     driver.find_element_by_xpath(
         "//div[@id='system_payment_setting_AppSecret']/input").send_keys(
             "99998888")
     driver.find_element_by_xpath(
         "//div[@id='system_paymentsetting_wechat_cert_upload']/input"
     ).clear()
     driver.find_element_by_xpath(
         "//div[@id='system_paymentsetting_wechat_cert_upload']/input"
     ).send_keys("F:\\auto_test_qrb\\update\\sq.txt")
     driver.find_element_by_xpath(
         "//div[@id='system_paymentsetting_wechat_oauth_upload']/input"
     ).clear()
     driver.find_element_by_xpath(
         "//div[@id='system_paymentsetting_wechat_oauth_upload']/input"
     ).send_keys("F:\\auto_test_qrb\\update\\sqzs.txt")
     driver.find_element_by_xpath(
         "//button[@id='system_payment_setting_submit']").click()
     msg_text = u"支付网关更新成功"
     chk_msg(self, msg_text)
예제 #23
0
    def test_reg_user(self):
        open_homepage(self)
        phone_num = '17799999999'
        code = random.randint(100, 9999)
        code = str(code)
        enterprise_name = u"企业名称" + code
        print(enterprise_name)
        passwd_num = '123456'
        get_phonecode_sql = phone_num
        del_user_sql = "delete FROM ent_user where mobile ='" + phone_num + "'"
        aaa = getconn(del_user_sql)
        print(aaa)
        driver = self.driver

        driver.get(self.base_url + "/signin")
        time.sleep(5)
        driver.find_element_by_link_text(u"免费注册").click()
        driver.find_element_by_xpath(
            "//div[@id='signup_account']/input").clear()
        driver.find_element_by_xpath(
            "//div[@id='signup_account']/input").send_keys(phone_num)
        driver.find_element_by_xpath(
            "//div[@id='signup_ent_name']/input").clear()
        driver.find_element_by_xpath(
            "//div[@id='signup_ent_name']/input").send_keys(enterprise_name)
        driver.find_element_by_xpath(
            "//div[@id='signup_password']/input").clear()
        driver.find_element_by_xpath(
            "//div[@id='signup_password']/input").send_keys(passwd_num)
        driver.find_element_by_xpath(
            "//div[@id='signup_password_confirm']/input").clear()
        driver.find_element_by_xpath(
            "//div[@id='signup_password_confirm']/input").send_keys(passwd_num)
        driver.find_element_by_xpath(
            "//div[@id='signup_sms_code']/div/button").click()
        time.sleep(10)
        Random_code = selcet_reg(get_phonecode_sql)
        Random_code = bytes.decode(Random_code)
        print(Random_code)
        driver.find_element_by_xpath(
            "//div[@id='signup_sms_code']/input").clear()
        driver.find_element_by_xpath(
            "//div[@id='signup_sms_code']/input").send_keys(Random_code)
        driver.find_element_by_xpath("//button[@id='signup_btn']").click()
        login(self)
예제 #24
0
 def test_a_add(self):
     open_homepage(self)
     requst = login(self)
     driver = self.driver
     status = 0
     code = random.randint(100, 9999)
     code = str(code)
     driver.find_element_by_xpath(
         "//div[@id='app']/div/nav/ul/li[4]/div").click()
     driver.find_element_by_id("main_navigation_member_marketing").click()
     time.sleep(2)
     driver.find_element_by_xpath(
         "//div[@id='member_marketing_table_systemMessagelist']/div/div[2]/table/tbody/tr/td[5]/div/div/span"
     ).click()
     time.sleep(2)
     driver.find_element_by_xpath(
         "//div[@id='member_marketing_table_systemMessagelist']/div/div[2]/table/tbody/tr/td[5]/div/div/span"
     ).click()
예제 #25
0
 def test_b_on_off(self):
     open_homepage(self)
     requst = login(self)
     driver = self.driver
     driver.find_element_by_css_selector(
         "div.ivu-menu-submenu-title").click()
     driver.find_element_by_id("main_navigation_system_payment").click()
     driver.implicitly_wait(30)
     driver.find_element_by_xpath(
         "//div[@id='system_payment_setting_list']/div/div[2]/table/tbody/tr/td/div/div/span"
     ).click()
     msg_text = u"支付网关状态已设置为开启"
     chk_msg(self, msg_text)
     time.sleep(3)
     driver.find_element_by_xpath(
         "//div[@id='system_payment_setting_list']/div/div[2]/table/tbody/tr/td/div/div/span"
     ).click()
     msg_text = u"支付网关状态已设置为关闭"
     chk_msg(self, msg_text)
 def test_b_edit(self):
     open_homepage(self)
     requst = login(self)
     driver = self.driver
     code = random.randint(100,9999)
     code = str(code)
     driver.find_element_by_xpath("//div[@id='app']/div/nav/ul/li[3]/div").click()
     driver.find_element_by_id("main_navigation_product_batch").click()
     time.sleep(20)
     driver.find_element_by_xpath("(//button[@type='button'])[6]").click()
     driver.find_element_by_xpath("//div[@id='product_batch_edit_line_list']/div/i[2]").click()
     driver.find_element_by_xpath("//div[@id='product_batch_edit_line_list']/div[2]/ul[2]/li").click()
     time.sleep(2)
     driver.find_element_by_xpath("//div[@id='product_batch_edit_product_list']/div/i[2]").click()
     driver.find_element_by_xpath("//div[@id='product_batch_edit_product_list']/div[2]/ul[2]/li").click()
     driver.find_element_by_xpath("//div[@id='product_batch_edit_no']/input").clear()
     driver.find_element_by_xpath("//div[@id='product_batch_edit_no']/input").send_keys("201700001"+code)
     driver.find_element_by_id("product_batch_edit_submit").click()
     msg_text=u"更新批次成功"
     chk_msg(self,msg_text)
예제 #27
0
 def test_a_update_username_sex(self):
     open_homepage(self)
     driver = self.driver
     login(self)
     driver.find_element_by_css_selector(
         "div.ivu-menu-submenu-title").click()
     driver.find_element_by_id("main_navigation_system_profile").click()
     driver.implicitly_wait(30)
     driver.find_element_by_xpath(
         "//div[@id='userprofile_info_name']/input").clear()
     driver.find_element_by_xpath(
         "//div[@id='userprofile_info_name']/input").send_keys(u"这就是我的真实姓名")
     time.sleep(2)
     driver.find_element_by_xpath(
         "//div[@id='userprofile_sex']/div/i[2]").click()
     time.sleep(2)
     driver.find_element_by_id("userprofile_sex_man").click()
     time.sleep(1)
     driver.find_element_by_id("userprofile_info_save").click()
     msg_text = u"更新个人资料成功"
     chk_msg(self, msg_text)
예제 #28
0
    def test_c_edit(self):
        open_homepage(self)
        requst = login(self)
        driver = self.driver
        status = 0
        code = random.randint(100, 9999)
        code = str(code)
        driver.find_element_by_xpath(
            "//div[@id='app']/div/nav/ul/li[4]/div").click()
        driver.find_element_by_id("main_navigation_member_levels").click()
        time.sleep(5)
        driver.find_element_by_xpath("(//button[@type='button'])[4]").click()
        driver.find_element_by_xpath("(//button[@type='button'])[11]").click()
        msg_text = u"会员等级重算成功"
        chk_msg(self, msg_text)

        driver.find_element_by_xpath("(//button[@type='button'])[7]").click()
        time.sleep(2)
        driver.find_element_by_xpath("(//button[@type='button'])[7]").click()
        msg_text = u"操作成功"
        chk_msg(self, msg_text)
예제 #29
0
 def test_b_edit(self):
     open_homepage(self)
     requst = login(self)
     driver = self.driver
     code = random.randint(100, 9999)
     code = str(code)
     driver.find_element_by_xpath(
         "//div[@id='app']/div/nav/ul/li[3]/div").click()
     driver.find_element_by_id("main_navigation_product_management").click()
     driver.implicitly_wait(30)
     driver.find_element_by_xpath("(//button[@type='button'])[7]").click()
     driver.find_element_by_xpath(
         "//div[@id='product_addproduct_input_name']/input").clear()
     driver.find_element_by_xpath(
         "//div[@id='product_addproduct_input_name']/input").send_keys(
             u"可爱多" + code)
     driver.find_element_by_xpath(
         "//div[@id='product_addproduct_select_line']/div/i[2]").click()
     driver.find_element_by_xpath(
         "//div[@id='product_addproduct_select_line']/div[2]/ul[2]/li"
     ).click()
     driver.find_element_by_xpath(
         "//div[@id='product_addproduct_input_units']/input").clear()
     driver.find_element_by_xpath(
         "//div[@id='product_addproduct_input_units']/input").send_keys(
             u"东莞1厂" + code)
     driver.find_element_by_xpath(
         "//div[@id='product_addproduct_input_specification']/input").clear(
         )
     driver.find_element_by_xpath(
         "//div[@id='product_addproduct_input_specification']/input"
     ).send_keys(u"袋装" + code)
     driver.find_element_by_id("product_addproduct_btn_save").click()
     msg_text = u"编辑成功"
     chk_msg(self, msg_text)
     driver.find_element_by_xpath("//input[@type='file']").clear()
     driver.find_element_by_xpath("//input[@type='file']").send_keys(
         "F:\\auto_test_qrb\\update\\00.jpg")
    def test_a_add(self):
        open_homepage(self)
        requst = login(self)
        driver = self.driver
        status = 0
        code = random.randint(100,9999)
        code = str(code)
        driver.find_element_by_xpath("//div[@id='app']/div/nav/ul/li[3]/div").click()
        driver.find_element_by_id("main_navigation_product_batch").click()
        for i in range(10):
            try:
                if u"还没有批次" == driver.find_element_by_xpath("//div[@id='product_batch_list_error_view']/h2").text:
                    status=1
                    break
            except: pass
            time.sleep(1)
        else:
            print(u"已经有批次")

        if (status==1):
            print(u"中间按钮")
            driver.find_element_by_xpath("//div[@id='product_batch_list_error_view']/button").click()
        else:
            print(u"点击顶部按钮")
            driver.find_element_by_id("product_batch_add").click()

        time.sleep(5)
        driver.find_element_by_xpath("//div[@id='product_batch_edit_line_list']/div/i[2]").click()
        driver.find_element_by_xpath("//div[@id='product_batch_edit_line_list']/div[2]/ul[2]/li").click()
        driver.find_element_by_xpath("//div[@id='product_batch_edit_product_list']/div/span").click()
        driver.find_element_by_xpath("//div[@id='product_batch_edit_product_list']/div[2]/ul[2]/li").click()
        driver.find_element_by_xpath("//div[@id='product_batch_edit_no']/input").clear()
        driver.find_element_by_xpath("//div[@id='product_batch_edit_no']/input").send_keys("201700001"+code)
        driver.find_element_by_id("product_batch_edit_submit").click()
        msg_text=u"更新批次成功"
        chk_msg(self,msg_text)