Exemplo n.º 1
0
 def setUpClass(self):  #最开始执行
     #建立连接信息
     cnn = Connect()
     self.driver = cnn.connect()
     #创建工具类
     self.tools = Tools(self.driver)  #tools工具
     #创建_BrowseOrgSpace公有定位控件对象
     self.spaceB = _BrowseOrgSpaceHandle(self.driver)
     self.spaceC = _CreateOrgSpaceHandle(self.driver)
     #创建读取配置信息对象
     cf = GlobalParam('config', 'path_file.conf')
     #获取截图路径、日志路径、日志名
     self.screen_path = cf.getParam('space', "path_001")  #通过配置文件获取截图的路径
     self.log_path = cf.getParam('space', "log")  #通过配置文件获取日志的路径
     self.logfile = cf.getParam('space', "logfile")  #日志文件名
     #创建Createspace和Closespace对象
     self.cr = CreateSpace()
     self.cl = CloseSpace()
     sleep(2)
     #测试数据
     d = DataInfo()  #创建DataInfo()对象
     self.fullname = d.cell("test1", 2, 1)  #fullname
     self.easyname = d.cell(
         "test1",
         2,
         2,
     )  #easyname
Exemplo n.º 2
0
    def logoutHomePage(self, driver):
        #创建工具类
        tools = Tools(driver)  #tools工具
        #创建读取配置信息对象
        cf = GlobalParam('config', 'path_file.conf')
        #获取截图路径、日志路径、日志名
        screen_path = cf.getParam("login", "path_001")  #通过配置文件获取截图的路径
        try:
            #创建_Logout公有定位控件对象
            logouthandle = _Logout(driver)
            sleep(2)
            tools.getScreenShot(screen_path, "退出登录前界面")
            #点击设置界面,调出设置页
            logouthandle.Entersetting().click()

            #------------------------进行登出操作-------------------------------
            #点击系统设置
            logouthandle.Syssetting().click()
            sleep(1)
            #点击退出按钮
            logouthandle.Syssetting_logout().click()
            sleep(1)
            tools.getScreenShot(screen_path, "点击登出")
            logouthandle.Syssetting_logout_confirm().click()
            sleep(1)
            tools.getScreenShot(screen_path, "登出成功")
        finally:
            tools.getScreenShot(screen_path, 'finallylogoutHomePage')  #截图
            logging.info("finallylogoutHomePage@@!!!!!!!")  #打印错误的日志
Exemplo n.º 3
0
    def loginHomePage(self, driver, section = "login"):
        #创建工具类
        tools = Tools(driver)#tools工具
        #创建读取配置信息对象
        cf = GlobalParam('config','path_file.conf')
        #获取截图路径、日志路径、日志名
        screen_path = cf.getParam(section,"path_001")#通过配置文件获取截图的路径
        try:
            #创建_Login公有定位控件对象
            loginHandle = _Login(driver)
            sleep(2)
            tools.getScreenShot(screen_path, "app欢迎界面")
            #点击登录按钮,进入到登录界面
            loginHandle.Login().click()

            #------------------------进行登录操作-------------------------------
            #手机号13667618021
            #密码free930923

            #输入登录手机号
            loginHandle.Login_telp().send_keys(self.telp)
            sleep(1)
            #输入登录密码
            loginHandle.Login_pwd().send_keys(self.pwd)
            sleep(1)
            tools.getScreenShot(screen_path, "登录信息")
            loginHandle.Login_login().click()
            tools.getScreenShot(screen_path, "点击登录")
            sleep(2)
        finally:
            tools.getScreenShot(screen_path,'finallyloginHomePage')#截图
            logging.info("finallyloginHomePage@@!!!!!!!")#打印错误的日志
Exemplo n.º 4
0
class DeleteProduct:
    def __init__(self):  #初始化测试数据
        pass

    def deleteProduct(self, driver):
        try:
            #创建工具类
            self.tools = Tools(driver)  #tools工具
            #创建_OrgSpaceProduct公有定位控件对象
            self.spaceP = _OrgSpaceProductHandle(driver)
            #创建读取配置信息对象
            self.cf = GlobalParam('config', 'path_file.conf')
            #获取截图路径、日志路径、日志名
            self.screen_path = self.cf.getParam('space',
                                                "path_002")  #通过配置文件获取截图的路径
            sleep(2)
            #-----------------删除产品-----------------
            #1.点击菜单栏
            self.spaceP.Kjlb_browseorgspace_menu_product_unlock_list_menu_click(
            )  #点击菜单栏
            #2.点击删除
            self.spaceP.Kjlb_browseorgspace_menu_product_unlock_list_menu_delete_click(
            )  #删除产品
            self.tools.getScreenShot(self.screen_path, "删除产品后列表")
        finally:
            self.tools.getScreenShot(self.screen_path, 'finally')  #截图
            logging.info("FinishDeleteProduct@@!!!!!!!")  #打印错误的日志
Exemplo n.º 5
0
class space_Create(unittest.TestCase):
    @classmethod  #装饰器,类方法
    def setUpClass(self):  #最开始执行
        #建立连接信息
        cnn = Connect()
        self.driver = cnn.connect()
        #创建工具类
        self.tools = Tools(self.driver)  #tools工具
        #创建_BrowseOrgSpace公有定位控件对象
        self.spaceB = _BrowseOrgSpaceHandle(self.driver)
        self.spaceC = _CreateOrgSpaceHandle(self.driver)
        #创建读取配置信息对象
        cf = GlobalParam('config', 'path_file.conf')
        #获取截图路径、日志路径、日志名
        self.screen_path = cf.getParam('space', "path_001")  #通过配置文件获取截图的路径
        self.log_path = cf.getParam('space', "log")  #通过配置文件获取日志的路径
        self.logfile = cf.getParam('space', "logfile")  #日志文件名
        #创建Createspace和Closespace对象
        self.cr = CreateSpace()
        self.cl = CloseSpace()
        sleep(2)
        #测试数据
        d = DataInfo()  #创建DataInfo()对象
        self.fullname = d.cell("test1", 2, 1)  #fullname
        self.easyname = d.cell(
            "test1",
            2,
            2,
        )  #easyname

    def test_spacecreate(self):
        try:
            # self.tools.coverUpdate(self.log_path,self.screen_path)#覆盖更新日志,覆盖更新截图
            self.tools.getLog(self.logfile)  #打印日志
            #-------------创建机构空间------------
            #先进行判断,空间是否存在,如果不存在,创建;如果存在,先删除后创建
            sleep(2)
            self.spaceC.Kjlb_click()  #进入空间列表
            # name = self.driver.find_elements_by_id("com.yunlu6.stone:id/zone_company_title")[0].text
            name = self.spaceB.Kjlb_browseorgspaceByID_text(0)  #获取第一家空间
            if name == self.easyname:  #检查当前的机构简称,如果已经有了,就关闭
                self.cl.closeSpace(self.driver)  #关闭
                self.cr.createSpace(self.driver, self.fullname,
                                    self.easyname)  #关闭之后,重新创建机构空间
                self.cl.closeSpace(self.driver)
            else:
                self.cr.createSpace(self.driver, self.fullname,
                                    self.easyname)  #创建机构空间
                self.cl.closeSpace(self.driver)
            logging.info("success@@!!!!!!!")  #宣布成功
        finally:
            self.tools.getScreenShot(self.screen_path, 'finally')  #截图
            logging.info("FinishAll@@!!!!!!!")  #打印错误的日志
            self.driver.quit()
Exemplo n.º 6
0
class space_Create(unittest.TestCase):
    @classmethod  #装饰器,类方法
    def setUpClass(self):  #最开始执行
        #建立连接信息
        cnn = Connect()
        self.driver = cnn.connect()
        #创建工具类
        self.tools = Tools(self.driver)  #tools工具
        #创建_BrowseOrgSpace公有定位控件对象
        self.handle = _SPACEHANDLE5(self.driver)
        #创建读取配置信息对象
        cf = GlobalParam('config', 'path_file.conf')
        #获取截图路径、日志路径、日志名
        self.screen_path = cf.getParam('space', "path_001")  #通过配置文件获取截图的路径
        self.log_path = cf.getParam('space', "log")  #通过配置文件获取日志的路径
        self.logfile = cf.getParam('space', "logfile")  #日志文件名
        #创建Createspace和Closespace对象
        self.cr = CreateSpace()
        self.cl = CloseSpace()
        sleep(1)
        #测试数据
        d = DataInfo()  #创建DataInfo()对象
        self.fullname = d.cell("test001", 2, 1)  #fullname
        self.easyname = d.cell(
            "test001",
            2,
            2,
        )  #easyname

    def test_spacecreate(self):
        try:
            # self.tools.coverUpdate(self.log_path,self.screen_path)#覆盖更新日志,覆盖更新截图
            self.tools.getLog(self.logfile)  #打印日志
            #-------------创建机构空间------------
            #先进行判断,空间是否存在,如果不存在,创建;如果存在,先删除后创建
            sleep(1)
            self.handle.Kjlb_click()  #进入空间列表
            name = self.handle.Kjlb_browseorgspaceByID_text(0)  #获取第一家空间
            if name == self.easyname:  #检查当前的机构简称,如果已经有了,就关闭
                self.cl.closeSpace(self.driver)  #关闭
                self.cr.createSpace(self.driver, self.fullname,
                                    self.easyname)  #关闭之后,重新创建机构空间
                self.cl.closeSpace(self.driver)
            else:
                self.cr.createSpace(self.driver, self.fullname,
                                    self.easyname)  #创建机构空间
                self.cl.closeSpace(self.driver)
            logging.info("success@@!!!!!!!")  #宣布成功
        except Exception as err:
            self.tools.getScreenShot(self.screen_path, "ExceptionShot")
            logging.error("Error Information outside : %s" % err)
            raise err
        finally:
            self.driver.quit()
class perspace_Create(unittest.TestCase):
    @classmethod#装饰器,类方法
    def setUpClass(self):#最开始执行
        #1.建立连接信息
        cnn = Connect()
        self.driver = cnn.connect()
        #2.创建工具类
        self.tools = Tools(self.driver)#tools工具
        #3.创建_CreatePersonalSpaceHandle公有定位控件对象
        self.handle = _SPACEHANDLE5(self.driver)
        #4.创建读取配置信息对象
        cf = GlobalParam('config','path_file.conf')
        #5.获取截图路径、日志路径、日志名
        self.screen_path = cf.getParam('space',"path_006")#通过配置文件获取截图的路径
        self.log_path = cf.getParam('space',"log")#通过配置文件获取日志的路径
        self.logfile = cf.getParam('space',"logfile")#日志文件名
        #6.创建Createspace和Closespace对象
        self.cr = CreatePersonSpace()
        self.cl = ClosePersonSpace()
        sleep(2)
        #7.准备测试数据
        d = DataInfo()#创建DataInfo()对象
        self.spacename = d.cell("test006",2,13)#空间名:appium私人空间
        # self.foldername1 = d.cell("test006",2,14)#文件夹1名:appium文件夹
    def test_perspacecreate(self):
        try:
            self.tools.getLog(self.logfile)#打印日志
            #1.进入空间列表
            sleep(1)
            self.handle.Kjlb_click()
            # #2.点击主菜单
            # self.handle.Kjlb_mainmenu_click()
            # #3.点击+私人空间
            # self.handle.Kjlb_mainmenu_newpersonspace_click()
            #4.创建私人空间
            if self.driver.find_elements_by_name(self.spacename) != []:#检查当前的私人空间是否已经存在,如果存在就关闭
                self.cl.closePersonSpace(self.driver,self.spacename)#先关闭
                self.cr.createPersonSpace(self.driver,self.spacename)#再创建
                self.cl.closePersonSpace(self.driver,self.spacename)#再关闭
            else:
                self.cr.createPersonSpace(self.driver,self.spacename)#创建
                self.cl.closePersonSpace(self.driver,self.spacename)#关闭
            logging.info("success@@!!!!!!!")#宣布成功
        except Exception as err:
            self.tools.getScreenShot(self.screen_path,"ExceptionShot")
            logging.error("Error Information outside : %s"%err)
            raise err
        finally:
            self.driver.quit()
Exemplo n.º 8
0
 def closeSpace(self, driver):
     """
         菜单栏用坐标定位:34行,实属无奈之举
     """
     #创建工具类
     tools = Tools(driver)  #tools工具
     #创建_SPACEHANDLE5公有定位控件对象
     handle = _SPACEHANDLE5(driver)
     #测试数据
     d = DataInfo()  #创建DataInfo()对象
     # self.easyname = d.cell("test001",2,2,)
     self.menu_x = int(d.cell("test001", 2, 11))  #fullname
     self.menu_y = int(d.cell(
         "test001",
         2,
         12,
     ))  #easyname
     sleep(1)
     try:
         #为了保证不中途退出,需要第一次进入的时候检查是否存在该机构,如果存在,先关闭
         handle.Kjlb_browseorgspaceByID_click(0)  #点击进入
         sleep(1)
         handle.Kjlb_browseorgspace_menu_click()  #菜单栏
         handle.Kjlb_browseorgspace_menu_bcard_click()  #企业名片
         handle.Kjlb_browseorgspace_menu_bcard_menu_click()  #菜单栏
         handle.Kjlb_browseorgspace_menu_bcard_menu_close_click()  #关闭
         handle.Kjlb_browseorgspace_menu_bcard_menu_close_confirm_click(
         )  #确认关闭
     except Exception as err:
         logging.error("Error Information CloseSpace Inside : %s" % err)
         raise err
Exemplo n.º 9
0
 def setUpClass(self):  #最开始执行
     #建立连接信息
     cnn = Connect()
     self.driver = cnn.connect()
     #创建工具类
     self.tools = Tools(self.driver)  #tools工具
     #创建读取配置信息对象
     cf = GlobalParam('config', 'path_file.conf')
     #获取截图路径、日志路径、日志名
     self.screen_path = cf.getParam('login', "path_001")  #通过配置文件获取截图的路径
     self.log_path = cf.getParam('login', "log_001")  #通过配置文件获取日志的路径
     self.filename = cf.getParam('login', "filename_001")  #日志文件名
     #创建LoginHomePage和LogoutHomePage对象
     self.login = LoginHomePage()
     self.logout = LogoutHomePage()
     sleep(2)
Exemplo n.º 10
0
 def archivies(self, driver):
     #创建工具类
     tools = Tools(driver)  #tools工具
     #创建_SPACEHANDLE5公有定位控件对象
     handle = _SPACEHANDLE5(driver)
     sleep(1)
     try:
         #1.空间首页
         # handle.Kjlb_click()
         # tools.getScreenShot(screen_path,"空间首页")
         #2.选择空间:测试空间123
         # handle.Kjlb_browseorgspaceByName_click("测试空间123")
         #3.右上角:菜单栏选择资讯
         handle.Kjlb_browseorgspace_menu_click()
         handle.Kjlb_browseorgspace_menu_archivies_click()
         #4.各入口跳转检查
         #4.1 入口一:图片新增按钮
         handle.Kjlb_browseorgspace_menu_archivies_picadd_click()
         handle.Kjlb_browseorgspace_menu_archivies_new_back_click()  #返回
         #4.2 入口二:右上角新增
         handle.Kjlb_browseorgspace_menu_archivies_new_click()
         #5.添加资讯
         #5.1 添加照片
         handle.Kjlb_browseorgspace_menu_archivies_new_addphoto_click()
         handle.Kjlb_browseorgspace_menu_archivies_new_addphoto_album_click(
         )  #点击相册
         handle.Kjlb_browseorgspace_menu_archivies_new_addphoto_album_list_click(
             0)  #点击第一张照片
         handle.Kjlb_browseorgspace_menu_archivies_new_addphoto_album_confirm_click(
         )  #点击完成
         sleep(1)
         #5.2 标题
         handle.Kjlb_browseorgspace_menu_archivies_new_title_sendkeys(
             self.title)  #标题
         #5.3 类型
         handle.Kjlb_browseorgspace_menu_archivies_new_type_click()  #类型
         handle.Kjlb_browseorgspace_menu_archivies_new_type_typelist_click(
             self.typelist)  #经典作品
         #5.4 勾选
         handle.Kjlb_browseorgspace_menu_archivies_new_confirm_click()  #勾选
         handle.Kjlb_browseorgspace_menu_archivies_new_confirm_late_click(
         )  #保存
         #5.5 点击资讯发布
         handle.Kjlb_browseorgspace_menu_archivies_pic_click(0)  #点击第一张资讯
         handle.Kjlb_browseorgspace_menu_archivies_pic_click(0)  #点击第一张资讯
         handle.Kjlb_browseorgspace_menu_archivies_pic_menu_click()  #菜单栏
         handle.Kjlb_browseorgspace_menu_archivies_pic_menu_new_click()  #发布
         type = handle.Kjlb_browseorgspace_menu_archivies_pic_type(
         ).text  #获取资讯类型
         assert type == "经典作品(1)", "资讯类型保存错误"
         handle.Kjlb_browseorgspace_menu_archivies_pic_click(0)  #点击第一张资讯
         handle.Kjlb_browseorgspace_menu_archivies_pic_click(0)  #点击第一张资讯
         title = handle.Kjlb_browseorgspace_menu_archivies_pic_title(
         ).text  #获取资讯标题
         assert title == self.title, "资讯标题未保存成功"
     except Exception as err:
         logging.error("Error Information Archivies Inside : %s" % err)
         raise err
Exemplo n.º 11
0
 def setUpClass(self):  #最开始执行
     #建立连接信息
     cnn = Connect()
     self.driver = cnn.connect()
     #创建工具类
     self.tools = Tools(self.driver)  #tools工具
     #创建_SPACEHANDLE5公有定位控件对象
     self.handle = _SPACEHANDLE5(self.driver)
     #创建读取配置信息对象
     cf = GlobalParam('config', 'path_file.conf')
     #获取截图路径、日志路径、日志名
     self.screen_path = cf.getParam('space', "path_005")  #通过配置文件获取截图的路径
     self.log_path = cf.getParam('space', "log")  #通过配置文件获取日志的路径
     self.logfile = cf.getParam('space', "logfile")  #日志文件名
     #创建BusinessCard对象
     self.spaceBu = BusinessCard()
     sleep(2)
     #测试数据
     d = DataInfo()  #创建DataInfo()对象
     self.spacename = d.cell("test005", 2, 7)  #测试空间123
Exemplo n.º 12
0
class space_BusinessCard(unittest.TestCase):
    @classmethod  #装饰器,类方法
    def setUpClass(self):  #最开始执行
        #建立连接信息
        cnn = Connect()
        self.driver = cnn.connect()
        #创建工具类
        self.tools = Tools(self.driver)  #tools工具
        #创建_SPACEHANDLE5公有定位控件对象
        self.handle = _SPACEHANDLE5(self.driver)
        #创建读取配置信息对象
        cf = GlobalParam('config', 'path_file.conf')
        #获取截图路径、日志路径、日志名
        self.screen_path = cf.getParam('space', "path_005")  #通过配置文件获取截图的路径
        self.log_path = cf.getParam('space', "log")  #通过配置文件获取日志的路径
        self.logfile = cf.getParam('space', "logfile")  #日志文件名
        #创建BusinessCard对象
        self.spaceBu = BusinessCard()
        sleep(2)
        #测试数据
        d = DataInfo()  #创建DataInfo()对象
        self.spacename = d.cell("test005", 2, 7)  #测试空间123

    def test_businesscard(self):
        """企业名片编辑"""
        try:
            # self.tools.coverUpdate(self.log_path,self.screen_path)#覆盖更新日志,覆盖更新截图
            self.tools.getLog(self.logfile)  #打印日志
            #1.空间首页
            self.handle.Kjlb_click()
            #2.选择空间:测试空间123
            self.handle.Kjlb_browseorgspaceByName_click(self.spacename)
            #3.企业名片
            self.spaceBu.businesscard(self.driver)
            logging.info("success@@!!!!!!!")  #宣布成功
        except Exception as err:
            self.tools.getScreenShot(self.screen_path, "ExceptionShot")
            logging.error("Error Information BusinessCard Outside : %s" % err)
            raise err
        finally:
            self.driver.quit()
Exemplo n.º 13
0
 def setUpClass(self):#最开始执行
     #1.建立连接信息
     cnn = Connect()
     self.driver = cnn.connect()
     #2.创建工具类
     self.tools = Tools(self.driver)#tools工具
     #3.创建_CreatePersonalSpaceHandle公有定位控件对象
     self.handle = _SPACEHANDLE5(self.driver)
     #4.创建读取配置信息对象
     cf = GlobalParam('config','path_file.conf')
     #5.获取截图路径、日志路径、日志名
     self.screen_path = cf.getParam('space',"path_006")#通过配置文件获取截图的路径
     self.log_path = cf.getParam('space',"log")#通过配置文件获取日志的路径
     self.logfile = cf.getParam('space',"logfile")#日志文件名
     #6.创建Createspace和Closespace对象
     self.cr = CreatePersonSpace()
     self.cl = ClosePersonSpace()
     sleep(2)
     #7.准备测试数据
     d = DataInfo()#创建DataInfo()对象
     self.spacename = d.cell("test006",2,13)#空间名:appium私人空间
Exemplo n.º 14
0
 def loginapp(self, driver, section = "login"):#最开始执行
     #创建工具类
     tools = Tools(driver)#tools工具
     #创建读取配置信息对象
     cf = GlobalParam('config','path_file.conf')
     #获取截图路径、日志路径、日志名
     screen_path = cf.getParam(section,"path_001")#通过配置文件获取截图的路径
     #创建LoginHomePage和LogoutHomePage对象
     cr = LoginHomePage()
     cl = LogoutHomePage()
     sleep(2)
     try:
         #-------------判断进入应用时是否处于登录状态------------
         #先进行判断,是否处于登录状态,如果处于登录状态,则登出
         #对于已登录的用户,在左上方会有一个设置按钮,对于未登录用户,没有这个按钮,通过查找这个元素来判断用户是否登录
         if driver.find_elements_by_id("com.yunlu6.stone:id/iv_left") == []:
             #-------------若用户未登录,进行登录操作------------
             LoginHomePage().loginHomePage(driver, section)
             logging.info("success@@!!!!!!!")#宣布成功
     except Exception as err:
         tools.getScreenShot(screen_path,'finally')#截图
         logging.info("finally@@!!!!!!!")#打印错误的日志
Exemplo n.º 15
0
 def setUpClass(self):#最开始执行
     #建立连接信息
     cnn = Connect()
     self.driver = cnn.connect()
     #创建工具类
     self.tools = Tools(self.driver)#tools工具
     #创建_BrowseOrgSpace公有定位控件对象
     self.spaceB = _BrowseOrgSpaceHandle(self.driver)
     #创建_OrgSpaceProduct公有定位控件对象
     self.spaceP = _OrgSpaceProductHandle(self.driver)
     #创建读取配置信息对象
     cf = GlobalParam('config','path_file.conf')
     #获取截图路径、日志路径、日志名
     self.screen_path = cf.getParam('space',"path_002")#通过配置文件获取截图的路径
     self.log_path = cf.getParam('space',"log")#通过配置文件获取日志的路径
     self.logfile = cf.getParam('space',"logfile")#日志文件名
     sleep(2)
     #创建CreateProduct和DeleteProduct对象
     self.cr = CreateProduct()
     self.dl = DeleteProduct()
     #测试数据
     d = DataInfo()#创建DataInfo()对象
     self.spacename = d.cell("test2",2,1)#空间名
     self.proname = d.cell("test2",2,3)
Exemplo n.º 16
0
 def createPerSFolder(self,
                      driver,
                      spacename,
                      foldername1=None,
                      foldername2=None,
                      foldername3=None):  #最多三个文件夹
     #创建工具类
     tools = Tools(driver)  #tools工具
     #创建_SPACEHANDLE5公有定位控件对象
     handle = _SPACEHANDLE5(driver)
     sleep(2)
     try:
         #1.空间-菜单栏
         driver.find_element_by_name(spacename).click()
         # handle.Kjlb_browseperspaceByName(spacename).click()
         handle.Kjlb_browseperspace_menu_click()
         #2.+文件夹
         handle.Kjlb_browseperspace_menu_addfolder_click()
         #3.输入文件夹名称-确定
         handle.Kjlb_browseperspace_menu_addfolder_foldername_sendkeys(
             foldername1)
         handle.Kjlb_browseperspace_menu_addfolder_confirm_click()
         #4.检查文件夹是否成功新建
         foldername = handle.Kjlb_browseperspace_foldername()[0].text
         assert self.foldername1 == foldername, "Error : Floder Name Is Wrong"
         #5.+数据:相册-照片列表-完成
         #5.1+数据
         handle.Kjlb_browseperspace_piclist_click(0)
         #5.2相册方式
         handle.Kjlb_browseperspace_addData_ByAlbum_click()
         #5.3点击第一张照片
         handle.Kjlb_browseperspace_addData_ByAlbum_piclist_click(0)
         #5.4完成
         handle.Kjlb_browseperspace_addData_ByAlbum_confirm_click()
         sleep(1)
         #5.5返回控件主页
         handle.Kjlb_browseperspace_addData_ByAlbum_confirm_back_click()
         #6.检查上传是否成功
         picLen = len(handle.Kjlb_browseperspace_piclist())  #照片列表长度应该为2
         assert picLen == 2, 'Error : Picture Upload Failed'
         #7.返回
         handle.Kjlb_browseperspace_back_click()
     except Exception as err:
         logging.error("Error Information CreatePerSFolder Inside : %s" %
                       err)
         raise err
Exemplo n.º 17
0
 def deleteProduct(self,driver):
     try:
         #创建工具类
         self.tools = Tools(driver)#tools工具
         #创建_SPACEHANDLE5公有定位控件对象
         self.handle = _SPACEHANDLE5(driver)
         #创建读取配置信息对象
         self.cf = GlobalParam('config','path_file.conf')
         #获取截图路径、日志路径、日志名
         self.screen_path = self.cf.getParam('space',"path_002")#通过配置文件获取截图的路径
         sleep(1)
         #-----------------删除产品-----------------
     #1.点击菜单栏
         self.handle.Kjlb_browseorgspace_menu_product_unlock_list_menu_click()#点击菜单栏
     #2.点击删除
         self.handle.Kjlb_browseorgspace_menu_product_unlock_list_menu_delete_click()#删除产品
     except Exception as err:
         logging.error("Error Information DeleteProduct Inside : %s"%err)
         raise err
Exemplo n.º 18
0
 def closeSpace(self, driver):
     """
         菜单栏用坐标定位:34行,实属无奈之举
     """
     #创建工具类
     tools = Tools(driver)  #tools工具
     #创建_OrgSpaceBCard公有定位控件对象
     spaceB = _OrgSpaceBCardHandle(driver)
     #创建读取配置信息对象
     cf = GlobalParam('config', 'path_file.conf')
     #获取截图路径、日志路径、日志名
     screen_path = cf.getParam('space', "path_001")  #通过配置文件获取截图的路径
     #测试数据
     d = DataInfo()  #创建DataInfo()对象
     # self.easyname = d.cell("test1",2,2,)
     self.menu_x = int(d.cell("test1", 2, 11))  #fullname
     self.menu_y = int(d.cell(
         "test1",
         2,
         12,
     ))  #easyname
     sleep(2)
     try:
         #为了保证不中途退出,需要第一次进入的时候检查是否存在该机构,如果存在,先关闭
         spaceB.Kjlb_browseorgspaceByID_click(0)  #点击进入
         sleep(2)
         # driver.tap([(self.menu_x,self.menu_y)], 500)#菜单栏
         spaceB.Kjlb_browseorgspace_menu_click()  #菜单栏
         spaceB.Kjlb_browseorgspace_menu_bcard_click()  #企业名片
         spaceB.Kjlb_browseorgspace_menu_bcard_menu_click()  #菜单栏
         spaceB.Kjlb_browseorgspace_menu_bcard_menu_close_click()  #关闭
         tools.getScreenShot(screen_path, "关闭空间确认")
         spaceB.Kjlb_browseorgspace_menu_bcard_menu_close_confirm_click(
         )  #确认关闭
         tools.getScreenShot(screen_path, "存在该机构将其关闭了")
     finally:
         tools.getScreenShot(screen_path, 'finallyclosespace')  #截图
         logging.info("FinishCloseSpace@@!!!!!!!")  #打印错误的日志
Exemplo n.º 19
0
class team_Assign(unittest.TestCase):
    @classmethod#装饰器,类方法
    def setUpClass(self):#最开始执行
        #建立连接信息
        cnn = Connect()
        self.driver = cnn.connect()
        #创建工具类
        self.tools = Tools(self.driver)#tools工具
        #创建_SPACEHANDLE5公有定位控件对象
        self.handle = _SPACEHANDLE5(self.driver)
        #创建读取配置信息对象
        cf = GlobalParam('config','path_file.conf')
        #获取截图路径、日志路径、日志名
        self.screen_path = cf.getParam('space',"path_003")#通过配置文件获取截图的路径
        self.log_path = cf.getParam('space',"log")#通过配置文件获取日志的路径
        self.logfile = cf.getParam('space',"logfile")#日志文件名
        #创建TeamAssignJob和Closespace对象
        self.SpaceTa = TeamAssignJob()
        sleep(1)
        #测试数据
        d = DataInfo()#创建DataInfo()对象
        self.spacename = d.cell("test003",2,1)#测试空间123
    def test_teamassign(self):
        """团队人事任免"""
        try:
            # self.tools.coverUpdate(self.log_path,self.screen_path)#覆盖更新日志,覆盖更新截图
            self.tools.getLog(self.logfile)#打印日志
        #1.空间首页
            self.handle.Kjlb_click()
            self.tools.getScreenShot(self.screen_path,"空间首页")
        #2.选择空间:测试空间123
            self.handle.Kjlb_browseorgspaceByName_click(self.spacename)
        #3.任免+移除
            self.SpaceTa.teamAssignJob(self.driver)
            logging.info("success@@!!!!!!!")#宣布成功
        except Exception as err:
            self.tools.getScreenShot(self.screen_path,"ExceptionShot")
            logging.error("Error Information TeamAssignJob Outside : %s"%err)
            raise err
        finally:
            self.driver.quit()
Exemplo n.º 20
0
class space_Create(unittest.TestCase):
    @classmethod  #装饰器,类方法
    def setUpClass(self):  #最开始执行
        #建立连接信息
        cnn = Connect()
        self.driver = cnn.connect()
        #创建工具类
        self.tools = Tools(self.driver)  #tools工具
        #创建读取配置信息对象
        cf = GlobalParam('config', 'path_file.conf')
        #获取截图路径、日志路径、日志名
        self.screen_path = cf.getParam('login', "path_001")  #通过配置文件获取截图的路径
        self.log_path = cf.getParam('login', "log_001")  #通过配置文件获取日志的路径
        self.filename = cf.getParam('login', "filename_001")  #日志文件名
        #创建LoginHomePage和LogoutHomePage对象
        self.login = LoginHomePage()
        self.logout = LogoutHomePage()
        sleep(2)

    def test_login(self):
        try:
            self.tools.coverUpdate(self.log_path,
                                   self.screen_path)  #覆盖更新日志,覆盖更新截图
            self.tools.getLog(self.filename)  #打印日志
            #-------------判断进入应用时是否处于登录状态------------
            #先进行判断,是否处于登录状态,如果处于登录状态,则登出
            #对于已登录的用户,在左上方会有一个设置按钮,对于未登录用户,没有这个按钮,通过查找这个元素来判断用户是否登录
            if self.driver.find_elements_by_id(
                    "com.yunlu6.stone:id/iv_left") != []:
                self.logout.logoutHomePage(self.driver)
            #-------------进行登录操作------------
            self.login.loginHomePage(self.driver)
            logging.info("success@@!!!!!!!")  #宣布成功

        finally:
            self.tools.getScreenShot(self.screen_path, 'finally')  #截图
            logging.info("finally@@!!!!!!!")  #打印错误的日志
            self.driver.quit()
Exemplo n.º 21
0
 def businesscard(self, driver):
     #创建工具类
     tools = Tools(driver)  #tools工具
     #创建 _SPACEHANDLE5公有定位控件对象
     handle = _SPACEHANDLE5(driver)
     sleep(2)
     try:
         #1.空间首页
         # handle.Kjlb_click()
         # tools.getScreenShot(screen_path,"空间首页")
         #2.选择空间:测试空间123
         # handle.Kjlb_browseorgspaceByName_click("测试空间123")
         #3.右上角:企业名片
         handle.Kjlb_browseorgspace_menu_click()  #点击菜单栏
         handle.Kjlb_browseorgspace_menu_bcard_click()  #点击企业名片
         #4.右上角菜单栏-编辑
         handle.Kjlb_browseorgspace_menu_bcard_menu_click()
         handle.Kjlb_browseorgspace_menu_bcard_menu_edit_click()
         #5.编辑企业名片详情
         #5.1 联系人
         if handle.Kjlb_browseorgspace_menu_bcard_menu_edit_contact(
         ).text is not None:
             handle.Kjlb_browseorgspace_menu_bcard_menu_edit_contact(
             ).clear()
             # pya.clear(handle.Kjlb_browseorgspace_menu_bcard_menu_edit_contact())
         handle.Kjlb_browseorgspace_menu_bcard_menu_edit_contact_sendkeys(
             self.contact)
         #5.2 手机号
         if handle.Kjlb_browseorgspace_menu_bcard_menu_edit_phone(
         ).text is not None:
             handle.Kjlb_browseorgspace_menu_bcard_menu_edit_phone().clear()
         handle.Kjlb_browseorgspace_menu_bcard_menu_edit_phone_sendkeys(
             self.phone)
         #5.3 座机号
         if handle.Kjlb_browseorgspace_menu_bcard_menu_edit_landline(
         ).text is not None:
             handle.Kjlb_browseorgspace_menu_bcard_menu_edit_landline(
             ).clear()
         handle.Kjlb_browseorgspace_menu_bcard_menu_edit_landline_sendkeys(
             self.tel)
         #5.4 邮箱
         if handle.Kjlb_browseorgspace_menu_bcard_menu_edit_email(
         ).text is not None:
             handle.Kjlb_browseorgspace_menu_bcard_menu_edit_email().clear()
         handle.Kjlb_browseorgspace_menu_bcard_menu_edit_email_sendkeys(
             self.email)
         #5.5 QQ
         if handle.Kjlb_browseorgspace_menu_bcard_menu_edit_QQ(
         ).text is not None:
             handle.Kjlb_browseorgspace_menu_bcard_menu_edit_QQ().clear()
         handle.Kjlb_browseorgspace_menu_bcard_menu_edit_QQ_sendkeys(
             self.QQ)
         #5.6 网址
         if handle.Kjlb_browseorgspace_menu_bcard_menu_edit_website(
         ).text is not None:
             handle.Kjlb_browseorgspace_menu_bcard_menu_edit_website(
             ).clear()
         handle.Kjlb_browseorgspace_menu_bcard_menu_edit_website_sendkeys(
             self.website)
         #6.勾选+点击检查
         handle.Kjlb_browseorgspace_menu_bcard_menu_edit_confirm_click(
         )  #勾选
         sleep(1)
         assert len(handle.Kjlb_browseorgspace_menu_bcard_contactlist()
                    ) == 5, "部分联系方式未保存成功"
         #6.1 手机号
         handle.Kjlb_browseorgspace_menu_bcard_contactlist_click(0)
         sleep(1)
         driver.keyevent('4')
         sleep(3)
         #6.2 座机号
         handle.Kjlb_browseorgspace_menu_bcard_contactlist_click(1)
         sleep(1)
         driver.keyevent('4')
         sleep(2)
         #6.3 邮箱
         handle.Kjlb_browseorgspace_menu_bcard_contactlist_click(2)
         sleep(1)
         driver.keyevent('4')
         sleep(2)
         driver.find_element_by_id(
             "android:id/button2").click()  #点击放弃,三星手机自带邮箱
         #6.4 QQ
         handle.Kjlb_browseorgspace_menu_bcard_contactlist_click(3)
         sleep(2)
         driver.keyevent('4')
         sleep(2)
         #6.5 网址
         handle.Kjlb_browseorgspace_menu_bcard_contactlist_click(4)
         driver.keyevent('4')
         sleep(2)
         driver.keyevent('4')
         sleep(2)
         #7.检查数据
         handle.Kjlb_browseorgspace_menu_bcard_menu_click()  #菜单栏
         handle.Kjlb_browseorgspace_menu_bcard_menu_edit_click()  #编辑
         #7.1 联系人
         assert handle.Kjlb_browseorgspace_menu_bcard_menu_edit_contact(
         ).text == self.contact, "Contact:Save Failed"
         #7.2 手机号
         assert int(handle.Kjlb_browseorgspace_menu_bcard_menu_edit_phone().
                    text) == self.phone, "Phone:Save Failed"
         #7.3 座机号
         assert int(
             handle.Kjlb_browseorgspace_menu_bcard_menu_edit_landline(
             ).text) == self.tel, "Tel:Save Failed"
         #7.4 邮箱
         assert handle.Kjlb_browseorgspace_menu_bcard_menu_edit_email(
         ).text == self.email, "Email:Save Failed"
         #7.5 QQ
         assert int(handle.Kjlb_browseorgspace_menu_bcard_menu_edit_QQ().
                    text) == self.QQ, "QQ:Save Failed"
         #7.6 网址
         assert handle.Kjlb_browseorgspace_menu_bcard_menu_edit_website(
         ).text == self.website, "Website:Save Failed"
         #8.清空名片数据
         #8.1 清空联系人
         handle.Kjlb_browseorgspace_menu_bcard_menu_edit_contact().clear()
         #8.2 清空手机号
         handle.Kjlb_browseorgspace_menu_bcard_menu_edit_phone().clear()
         #8.3 清空座机号
         handle.Kjlb_browseorgspace_menu_bcard_menu_edit_landline().clear()
         #8.4 清空邮箱
         handle.Kjlb_browseorgspace_menu_bcard_menu_edit_email().clear()
         #8.5 清空QQ
         handle.Kjlb_browseorgspace_menu_bcard_menu_edit_QQ().clear()
         #8.6 清空网址
         handle.Kjlb_browseorgspace_menu_bcard_menu_edit_website().clear()
         #8.7 勾选保存
         handle.Kjlb_browseorgspace_menu_bcard_menu_edit_confirm_click()
     except Exception as err:
         logging.error("Error Information BusinessCard Inside : %s" % err)
         raise err
Exemplo n.º 22
0
class space_Product(unittest.TestCase):
    @classmethod#装饰器,类方法
    def setUpClass(self):#最开始执行
        #建立连接信息
        cnn = Connect()
        self.driver = cnn.connect()
        #创建工具类
        self.tools = Tools(self.driver)#tools工具
        #创建_BrowseOrgSpace公有定位控件对象
        self.spaceB = _BrowseOrgSpaceHandle(self.driver)
        #创建_OrgSpaceProduct公有定位控件对象
        self.spaceP = _OrgSpaceProductHandle(self.driver)
        #创建读取配置信息对象
        cf = GlobalParam('config','path_file.conf')
        #获取截图路径、日志路径、日志名
        self.screen_path = cf.getParam('space',"path_002")#通过配置文件获取截图的路径
        self.log_path = cf.getParam('space',"log")#通过配置文件获取日志的路径
        self.logfile = cf.getParam('space',"logfile")#日志文件名
        sleep(2)
        #创建CreateProduct和DeleteProduct对象
        self.cr = CreateProduct()
        self.dl = DeleteProduct()
        #测试数据
        d = DataInfo()#创建DataInfo()对象
        self.spacename = d.cell("test2",2,1)#空间名
        self.proname = d.cell("test2",2,3)
    def test_spaceproduct(self):
        """
            菜单栏用坐标定位:56行,实属无奈之举
        """
        try:
            # self.tools.coverUpdate(self.log_path,self.screen_path)#覆盖更新日志,覆盖更新截图
            self.tools.getLog(self.logfile)#打印日志
        #1.点击进入空间界面
            self.spaceP.Kjlb().click()#点击进入空间列表
            sleep(1)
            self.spaceP.Kjlb_browseorgspaceByName_click(self.spacename)#点击进入测试空间123
            sleep(2)
            self.spaceP.Kjlb_browseorgspace_menu_click()#点击菜单栏
            # self.driver.tap([(self.menu_x,self.menu_y)], 500)#菜单栏
            self.spaceP.Kjlb_browseorgspace_menu_product_click()#点击产品
            self.tools.getScreenShot(self.screen_path,"产品新建界面")
        #2.新建产品
            self.cr.createProduct(self.driver)
        #3.未发布列表:发布
            self.spaceP.Kjlb_browseorgspace_menu_product_unlock_click()#点击未发布列表
            self.tools.getScreenShot(self.screen_path,"未发布列表")
            self.spaceP.Kjlb_browseorgspace_menu_product_unlock_list_byname_click(self.proname)#点击新建的那个产品
            self.spaceP.Kjlb_browseorgspace_menu_product_unlock_list_menu_click()#点击菜单栏
            self.spaceP.Kjlb_browseorgspace_menu_product_unlock_list_menu_release_click()#点击发布
            self.spaceP.Kjlb_browseorgspace_menu_product_unlock_list_menu_release_confirm_click()#点击确定
        #4.进入已发布列表
            self.spaceP.Kjlb_browseorgspace_menu_product_lock_click()#点击进入已发布列表
            self.tools.getScreenShot(self.screen_path,"已发布列表")
            self.spaceP.Kjlb_browseorgspace_menu_product_lock_list_byname_click(self.proname)#点击新建的那个产品
        #5.下架产品
            self.spaceP.Kjlb_browseorgspace_menu_product_lock_list_offshelf_click()#点击下架
            self.spaceP.Kjlb_browseorgspace_menu_product_lock_list_offshelf_sure_click()#确定下架
        #6.删除产品,还原测试场景
            self.spaceP.Kjlb_browseorgspace_menu_product_unlock_click()#点击未发布列表
            self.spaceP.Kjlb_browseorgspace_menu_product_unlock_list_byname_click(self.proname)#点击新建的那个产品
            self.dl.deleteProduct(self.driver)#删除产品,回归
        finally:
            self.tools.getScreenShot(self.screen_path,'finally')#截图
            logging.info("FinishAll@@!!!!!!!")#打印错误的日志
            self.driver.quit()
Exemplo n.º 23
0
    def createProduct(self, driver):
        """
            菜单栏用坐标定位:68行,实属无奈之举
        """
        try:
            #创建工具类
            tools = Tools(driver)  #tools工具
            #创建_OrgSpaceProduct公有定位控件对象
            spaceP = _OrgSpaceProductHandle(driver)
            #创建读取配置信息对象
            cf = GlobalParam('config', 'path_file.conf')
            #获取截图路径、日志路径、日志名
            screen_path = cf.getParam('space', "path_002")  #通过配置文件获取截图的路径
            sleep(2)
            #-----------------新建产品-----------------
            spaceP.Kjlb_browseorgspace_menu_product_new_click()  #点击新建按钮
            tools.getScreenShot(screen_path, "添加产品")
            #1.添加照片
            spaceP.Kjlb_browseorgspace_menu_product_new_addphoto_click(
            )  #点击添加照片按钮
            spaceP.Kjlb_browseorgspace_menu_product_new_addphoto_album_click(
            )  #选择相册添加
            spaceP.Kjlb_browseorgspace_menu_product_new_addphoto_album_list_click(
                self.photo)  #选择第一张照片
            spaceP.Kjlb_browseorgspace_menu_product_new_addphoto_album_confirm_click(
            )  #点击完成
            sleep(5)
            tools.getScreenShot(screen_path, "图片上传后")
            #2.商品名称
            spaceP.Kjlb_browseorgspace_menu_product_new_proname_click(
            )  #点击商品名称
            spaceP.Kjlb_browseorgspace_menu_product_new_proname_name_sendkeys(
                self.proname)  #输入商品名称
            spaceP.Kjlb_browseorgspace_menu_product_new_proname_name_title_click(
            )  #点击顶部标题
            spaceP.Kjlb_browseorgspace_menu_product_new_proname_bclassify_click(
            )  #点击分类
            spaceP.Kjlb_browseorgspace_menu_product_new_proname_bonetag_click(
                self.tag1)  #1级标签
            spaceP.Kjlb_browseorgspace_menu_product_new_proname_btwotag_click(
                self.tag2)  #2级标签
            spaceP.Kjlb_browseorgspace_menu_product_new_proname_confirm_click(
            )  #点击确定按钮
            tools.getScreenShot(screen_path, "商品分类后")
            spaceP.Kjlb_browseorgspace_menu_product_new_proname_choose_click(
            )  #点击勾选按钮
            #3.石种属性
            spaceP.Kjlb_browseorgspace_menu_product_new_attribute_click(
            )  #点击石种属性
            spaceP.Kjlb_browseorgspace_menu_product_new_attribute_species_sendkeys(
                self.species)  #种类名
            spaceP.Kjlb_browseorgspace_menu_product_new_attribute_species_match_click(
                0)  #点击匹配出的石种名
            tools.getScreenShot(screen_path, "选择石种后")
            spaceP.Kjlb_browseorgspace_menu_product_new_attribute_confirm_click(
            )  #点击勾选
            #4.制品和表面
            spaceP.Kjlb_browseorgspace_menu_product_new_attrstone_click(
            )  #点击制品和表面
            spaceP.Kjlb_browseorgspace_menu_product_new_attrstone_type_click(
            )  #点击制品
            spaceP.Kjlb_browseorgspace_menu_product_new_attrstone_type_list_click(
                self.type)  #平板
            spaceP.Kjlb_browseorgspace_menu_product_new_attrstone_surface_click(
            )  #点击表面
            spaceP.Kjlb_browseorgspace_menu_product_new_attrstone_surface_list_click(
                self.surface)  #光面
            tools.getScreenShot(screen_path, "制品和表面")
            spaceP.Kjlb_browseorgspace_menu_product_new_attrstone_confirm_click(
            )  #勾选
            #5.产品参数
            spaceP.Kjlb_browseorgspace_menu_product_new_parameter_click(
            )  #点击产品参数
            spaceP.Kjlb_browseorgspace_menu_product_new_parameter_key_clear(
                0)  #先清空参数名

            spaceP.Kjlb_browseorgspace_menu_product_new_parameter_key_sendkeys(
                0, self.key)  #输入参数名

            spaceP.Kjlb_browseorgspace_menu_product_new_parameter_value_sendkeys(
                0, self.value)  #输入参数值
            tools.getScreenShot(screen_path, "产品参数")
            spaceP.Kjlb_browseorgspace_menu_product_new_parameter_confirm_click(
            )  #点击勾选
            #6.价格
            spaceP.Kjlb_browseorgspace_menu_product_new_price_click()  #点击价格
            #6.1 价格:0 库存:0
            spaceP.Kjlb_browseorgspace_menu_product_new_price_unitprice_sendkeys(
                -2, self.price1)  #单价0元
            spaceP.Kjlb_browseorgspace_menu_product_new_price_stock_sendkeys(
                -1, self.stock1)  #库存0
            spaceP.Kjlb_browseorgspace_menu_product_new_price_save().click(
            )  #点击保存
            #6.2 价格:123 库存:空
            spaceP.Kjlb_browseorgspace_menu_product_new_price_add_click()  #+新价
            spaceP.Kjlb_browseorgspace_menu_product_new_price_unitprice_sendkeys(
                -2, self.price2)  #单价123元
            spaceP.Kjlb_browseorgspace_menu_product_new_price_stock_sendkeys(
                -1, self.stock2)  #库存空
            spaceP.Kjlb_browseorgspace_menu_product_new_price_save_click(
            )  #点击保存
            #6.3 价格:空 库存:123
            spaceP.Kjlb_browseorgspace_menu_product_new_price_add_click()  #+新价
            spaceP.Kjlb_browseorgspace_menu_product_new_price_unitprice_sendkeys(
                -2, self.price3)  #单价空
            spaceP.Kjlb_browseorgspace_menu_product_new_price_stock_sendkeys(
                -1, self.stock3)  #库存123
            spaceP.Kjlb_browseorgspace_menu_product_new_price_save_click(
            )  #点击保存
            #6.4 价格:999 库存:999
            spaceP.Kjlb_browseorgspace_menu_product_new_price_add_click()  #+新价
            spaceP.Kjlb_browseorgspace_menu_product_new_price_unitprice_sendkeys(
                -2, self.price4)  #单价999元
            spaceP.Kjlb_browseorgspace_menu_product_new_price_stock_sendkeys(
                -1, self.stock4)  #库存999
            spaceP.Kjlb_browseorgspace_menu_product_new_price_save_click(
            )  #点击保存
            spaceP.Kjlb_browseorgspace_menu_product_new_price_back_click(
            )  #点击返回
            tools.getScreenShot(screen_path, "价格参数")
            #7.保存
            spaceP.Kjlb_browseorgspace_menu_product_new_save_click()  #点击保存
        finally:
            tools.getScreenShot(screen_path, 'finally')  #截图
            logging.info("FinishCreateProduct@@!!!!!!!")  #打印错误的日志
Exemplo n.º 24
0
 def Yk_menu_piclist_delete_click(self):
     t = Tools(self.driver)
     t.click_element_by_coordinate(self.YK_menu_piclist_delete_x,
                                   self.YK_menu_piclist_delete_y)
Exemplo n.º 25
0
class perspace_NewFloder(unittest.TestCase):
    @classmethod  #装饰器,类方法
    def setUpClass(self):  #最开始执行
        #1.建立连接信息
        cnn = Connect()
        self.driver = cnn.connect()
        #2.创建工具类
        self.tools = Tools(self.driver)  #tools工具
        #3.创建_SPACEHANDLE5公有定位控件对象
        self.handle = _SPACEHANDLE5(self.driver)
        #4.创建读取配置信息对象
        cf = GlobalParam('config', 'path_file.conf')
        #5.获取截图路径、日志路径、日志名
        self.screen_path = cf.getParam('space', "path_006")  #通过配置文件获取截图的路径
        self.log_path = cf.getParam('space', "log")  #通过配置文件获取日志的路径
        self.logfile = cf.getParam('space', "logfile")  #日志文件名
        #6.创建Createspace、Closespace、CreatePerSFolder对象
        self.cr = CreatePersonSpace()
        self.cl = ClosePersonSpace()
        self.cpf = CreatePerSFolder()
        self.cpl = DeletePerSFloder()
        sleep(2)
        #7.准备测试数据
        d = DataInfo()  #创建DataInfo()对象
        self.spacename = d.cell("test006", 2, 13)  #空间名:appium私人空间
        self.foldername1 = d.cell("test006", 2, 14)  #文件夹1:appium文件夹
        # self.foldername1 = d.cell("test006",2,14)#文件夹1名:appium文件夹
    def test_pernewfolder(self):
        try:
            self.tools.getLog(self.logfile)  #打印日志
            #1.进入空间列表
            self.handle.Kjlb_click()
            # #2.点击主菜单
            # self.handle.Kjlb_mainmenu_click()
            # #3.点击+私人空间
            # self.handle.Kjlb_mainmenu_newpersonspace_click()
            #4.创建私人空间
            if self.driver.find_elements_by_name(
                    self.spacename) != []:  #检查当前的私人空间是否已经存在,如果存在就关闭
                #4.1进入空间-菜单栏-编辑
                self.handle.Kjlb_browseorgspaceByName_click(self.spacename)
                self.handle.Kjlb_browseperspace_menu_click()
                self.handle.Kjlb_browseperspace_menu_edit_click()
                #4.2检查是否存在文件夹
                if self.driver.find_elements_by_id(
                        "com.yunlu6.stone:id/editlayout_folder_dele") != []:
                    #4.2.0返回-返回空间列表
                    self.handle.Kjlb_browseperspace_menu_edit_back_click()
                    self.handle.Kjlb_browseperspace_back_click()
                    # 4.2.1删除文件夹
                    self.cpl.deletePerSFloder(self.driver, self.spacename)
                    #4.2.2先关闭空间
                    self.cl.closePersonSpace(self.driver, self.spacename)
                    #4.2.3再创建空间
                    self.cr.createPersonSpace(self.driver, self.spacename)
                    #4.2.4创建文件夹
                    self.cpf.createPerSFolder(self.driver, self.spacename,
                                              self.foldername1)
                    #4.2.5#删除文件夹
                    self.cpl.deletePerSFloder(self.driver, self.spacename)
                    #4.2.6再关闭空间
                    self.cl.closePersonSpace(self.driver, self.spacename)
                else:
                    #4.2.7先关闭空间
                    self.cl.closePersonSpace(self.driver, self.spacename)
                    #4.2.8再创建空间
                    self.cr.createPersonSpace(self.driver, self.spacename)
                    #4.2.9创建文件夹
                    self.cpf.createPerSFolder(self.driver, self.spacename,
                                              self.foldername1)
                    #4.2.10#删除文件夹
                    self.cpl.deletePerSFloder(self.driver, self.spacename)
                    #4.2.11再关闭空间
                    self.cl.closePersonSpace(self.driver, self.spacename)
            else:
                #4.3先创建空间
                self.cr.createPersonSpace(self.driver, self.spacename)  #创建
                #4.4创建文件夹
                self.cpf.createPerSFolder(self.driver, self.spacename,
                                          self.foldername1)
                #4.5删除文件夹
                self.cpl.deletePerSFloder(self.driver, self.spacename)
                #4.6再关闭空间
                self.cl.closePersonSpace(self.driver, self.spacename)
            logging.info("success@@!!!!!!!")  #宣布成功
        except Exception as err:
            self.tools.getScreenShot(self.screen_path, "ExceptionShot")
            logging.error("Error Information outside : %s" % err)
            raise err
        finally:
            self.driver.quit()
Exemplo n.º 26
0
    def createSpace(self, driver, fullname, easyname):
        #创建工具类
        tools = Tools(driver)  #tools工具
        #创建_CreateOrgSpace公有定位控件对象
        space = _CreateOrgSpaceHandle(driver)
        #创建读取配置信息对象
        cf = GlobalParam('config', 'path_file.conf')
        #获取截图路径、日志路径、日志名
        screen_path = cf.getParam('space', "path_001")  #通过配置文件获取截图的路径
        sleep(2)
        try:
            #1.空间首页
            space.Kjlb_click()
            tools.getScreenShot(screen_path, "空间首页")
            #2.右上角主菜单
            space.Kjlb_mainmenu_click()
            #3.+机构空间
            space.Kjlb_mainmenu_newspace_click()
            tools.getScreenShot(screen_path, "新建机构空间")
            #--------------------------新建机构空间-------------------------
            # 机构名称:(fullname):appium测试空间
            # 机构简称:(easyname):appium测试空间
            # 机构类型:企业
            # 产业角色:工厂
            # 客户类型:石材
            # 所在地区:北京-东城
            # 详细地址:不填
            space.Kjlb_mainmenu_newspace_orgname_sendkeys(fullname)  #全称
            space.Kjlb_mainmenu_newspace_orgintro_sendkeys(easyname)  #简称
            space.Kjlb_mainmenu_newspace_orgtitle_click()  #点击标题
            space.Kjlb_mainmenu_newspace_orgtype_click()  #机构类型
            space.Kjlb_mainmenu_newspace_orgtype_company_click()  #机构类型:企业
            sleep(1)
            space.Kjlb_mainmenu_newspace_industry_click()  #产业角色
            space.Kjlb_mainmenu_newspace_industry_tag_click(
                self.industry)  #选择工厂
            space.Kjlb_mainmenu_newspace_customertype_click()  #客户类型
            space.Kjlb_mainmenu_newspace_customertype_tag_click(
                self.customertype)  #客户类型标签
            space.Kjlb_mainmenu_newspace_customertype_confirm_click()  #点击确定
            space.Kjlb_mainmenu_newspace_area_click()  #所在地区
            driver.find_element_by_name(self.province).click()
            driver.find_element_by_name(self.city).click()
            # space.Kjlb_mainmenu_newspace_area_address_click(self.province)#北京
            # space.Kjlb_mainmenu_newspace_area_address_click(self.city)#东城
            tools.getScreenShot(screen_path, "提交前截图")
            space.Kjlb_mainmenu_newspace_affirm_click()  #点击提交

            #------------------------验证对公账号-------------------------------
            space.Kjlb_mainmenu_newspace_verifynow_click()  #点击去验证
            tools.getScreenShot(screen_path, "收款账户验证")
            #开户银行:AAA
            #所在地区:北京-东城
            #支行:BBB
            #银行账号:123456
            space.Kjlb_mainmenu_newspace_verifynow_soverbank_sendkeys(
                self.soverbank)  #开户银行
            space.Kjlb_mainmenu_newspace_verifynow_soveraddress_click()  #所在地区
            # space.Kjlb_mainmenu_newspace_verifynow_soveraddress_list_click(self.province)#北京
            # space.Kjlb_mainmenu_newspace_verifynow_soveraddress_list_click(self.city)#东城
            driver.find_element_by_name(self.province).click()  #北京
            driver.find_element_by_name(self.city).click()  #东城
            space.Kjlb_mainmenu_newspace_verifynow_sovermybank_sendkeys(
                self.sovermybank)  #支行
            space.Kjlb_mainmenu_newspace_verifynow_soverbanknub_sendkeys(
                self.soverbanknub)  #银行账户
            tools.getScreenShot(screen_path, "收款账户验证信息填写")
            space.Kjlb_mainmenu_newspace_verifynow_soversave_click()  #确定提交
            tools.getScreenShot(screen_path, "订单详情页")
            sleep(1)
            space.Kjlb_mainmenu_newspace_verifynow_soversave_back_click(
            )  #点击返回
            sleep(1)
        finally:
            tools.getScreenShot(screen_path, 'finallycreatespace')  #截图
            logging.info("FinishCreateSpace@@!!!!!!!")  #打印错误的日志
Exemplo n.º 27
0
 def createPersonSpace(self,
                       driver,
                       spacename,
                       foldername1=None,
                       foldername2=None,
                       foldername3=None):  #最多三个文件夹
     #创建工具类
     tools = Tools(driver)  #tools工具
     #创建_SPACEHANDLE5公有定位控件对象
     space = _SPACEHANDLE5(driver)
     sleep(1)
     try:
         # #1.空间首页
         #     space.Kjlb_click()
         #2.右上角主菜单
         space.Kjlb_mainmenu_click()
         #3.+私人空间
         space.Kjlb_mainmenu_newpersonspace_click()
         #4.选择空间类型-检查类型和推荐名对应
         AllLabel = []  #把各标签下的推荐列表,存到AllLabel列表里面
         for a in range(12):  #循环12次
             space.Kjlb_mainmenu_newpersonspace_choosespacetype_click(
                 a)  #选择列表中第a个标签
             # sleep(1)
             #把该标签下的推荐空间名存到一个列表中
             EveryLabel = []
             for i in space.Kjlb_mainmenu_newpersonspace_suggestspacenametag(
             ):
                 text = i.text
                 EveryLabel.append(text)
             AllLabel.append(EveryLabel)
             # print("A",A)
             space.Kjlb_mainmenu_newpersonspace_changespacetype_click(
             )  #切换类型
         # print("AllLabel",AllLabel)
         #4.1衣
         assert self.clothesT in AllLabel[
             0], "Clothes : The recommended name does not conform to type"
         #4.2食
         assert self.foodT in AllLabel[
             1], "Food : The recommended name does not conform to type"
         #4.3住
         assert self.liveT in AllLabel[
             2], "Live : The recommended name does not conform to type"
         #4.4行
         assert self.walkT in AllLabel[
             3], "Walk : The recommended name does not conform to type"
         #4.5学习
         assert self.studyT in AllLabel[
             4], "StudyT : The recommended name does not conform to type"
         #4.6健康
         assert self.healthT in AllLabel[
             5], "HealthT : The recommended name does not conform to type"
         #4.7社交
         assert self.socialT in AllLabel[
             6], "Social : The recommended name does not conform to type"
         #4.8工作
         assert self.workT in AllLabel[
             7], "Work : The recommended name does not conform to type"
         #4.9文艺
         assert self.literatureT in AllLabel[
             8], "LiteratureT : The recommended name does not conform to type"
         #4.10娱乐
         assert self.entertainmentT in AllLabel[
             9], "Entertainment : The recommended name does not conform to type"
         #4.11美护
         assert self.beautyT in AllLabel[
             10], "Beauty : The recommended name does not conform to type"
         #4.12其它
         assert self.otherT in AllLabel[
             11], "Other : The recommended name does not conform to type"
         #5.输入空间名称、文件夹名-保存
         space.Kjlb_mainmenu_newpersonspace_choosespacetype_click(
             0)  #选择衣服类型空间
         space.Kjlb_mainmenu_newpersonspace_spacename_sendkeys(
             spacename)  #appium私人空间
         # space.Kjlb_mainmenu_newpersonspace_foldername_sendkeys(foldername1)#appium文件夹
         space.Kjlb_mainmenu_newpersonspace_save_click()  #保存
         #6.返回到空间列表
         space.Kjlb_mainmenu_newpersonspace_mainback_click()
     except Exception as err:
         logging.error("Error Information CreatePersonSpace Inside : %s" %
                       err)
         raise err
Exemplo n.º 28
0
 def createProduct(self, driver):
     """
         菜单栏用坐标定位:68行,实属无奈之举
     """
     try:
         #创建工具类
         tools = Tools(driver)  #tools工具
         #创建_SPACEHANDLE5公有定位控件对象
         handle = _SPACEHANDLE5(driver)
         #创建读取配置信息对象
         cf = GlobalParam('config', 'path_file.conf')
         #获取截图路径、日志路径、日志名
         screen_path = cf.getParam('space', "path_002")  #通过配置文件获取截图的路径
         sleep(1)
         #-----------------新建产品-----------------
         handle.Kjlb_browseorgspace_menu_product_new_click()  #点击新建按钮
         #1.添加照片
         handle.Kjlb_browseorgspace_menu_product_new_addphoto_click(
         )  #点击添加照片按钮
         handle.Kjlb_browseorgspace_menu_product_new_addphoto_album_click(
         )  #选择相册添加
         handle.Kjlb_browseorgspace_menu_product_new_addphoto_album_list_click(
             self.photo)  #选择第一张照片
         handle.Kjlb_browseorgspace_menu_product_new_addphoto_album_confirm_click(
         )  #点击完成
         sleep(4)
         #2.商品名称
         handle.Kjlb_browseorgspace_menu_product_new_proname_click(
         )  #点击商品名称
         handle.Kjlb_browseorgspace_menu_product_new_proname_name_sendkeys(
             self.proname)  #输入商品名称
         handle.Kjlb_browseorgspace_menu_product_new_proname_name_title_click(
         )  #点击顶部标题
         handle.Kjlb_browseorgspace_menu_product_new_proname_bclassify_click(
         )  #点击分类
         handle.Kjlb_browseorgspace_menu_product_new_proname_bonetag_click(
             self.tag1)  #1级标签
         handle.Kjlb_browseorgspace_menu_product_new_proname_btwotag_click(
             self.tag2)  #2级标签
         handle.Kjlb_browseorgspace_menu_product_new_proname_confirm_click(
         )  #点击确定按钮
         handle.Kjlb_browseorgspace_menu_product_new_proname_choose_click(
         )  #点击勾选按钮
         #3.石种属性
         handle.Kjlb_browseorgspace_menu_product_new_attribute_click(
         )  #点击石种属性
         handle.Kjlb_browseorgspace_menu_product_new_attribute_species_sendkeys(
             self.species)  #种类名
         handle.Kjlb_browseorgspace_menu_product_new_attribute_species_match_click(
             0)  #点击匹配出的石种名
         handle.Kjlb_browseorgspace_menu_product_new_attribute_confirm_click(
         )  #点击勾选
         #4.制品和表面
         handle.Kjlb_browseorgspace_menu_product_new_attrstone_click(
         )  #点击制品和表面
         handle.Kjlb_browseorgspace_menu_product_new_attrstone_type_click(
         )  #点击制品
         handle.Kjlb_browseorgspace_menu_product_new_attrstone_type_list_click(
             self.type)  #平板
         handle.Kjlb_browseorgspace_menu_product_new_attrstone_surface_click(
         )  #点击表面
         handle.Kjlb_browseorgspace_menu_product_new_attrstone_surface_list_click(
             self.surface)  #光面
         handle.Kjlb_browseorgspace_menu_product_new_attrstone_confirm_click(
         )  #勾选
         #5.产品参数
         handle.Kjlb_browseorgspace_menu_product_new_parameter_click(
         )  #点击产品参数
         handle.Kjlb_browseorgspace_menu_product_new_parameter_key_clear(
             0)  #先清空参数名
         handle.Kjlb_browseorgspace_menu_product_new_parameter_key_sendkeys(
             0, self.key)  #输入参数名
         handle.Kjlb_browseorgspace_menu_product_new_parameter_value_sendkeys(
             0, self.value)  #输入参数值
         handle.Kjlb_browseorgspace_menu_product_new_parameter_confirm_click(
         )  #点击勾选
         #6.价格
         handle.Kjlb_browseorgspace_menu_product_new_price_click()  #点击价格
         #6.1 价格:0 库存:0
         handle.Kjlb_browseorgspace_menu_product_new_price_unitprice_sendkeys(
             -2, self.price1)  #单价0元
         handle.Kjlb_browseorgspace_menu_product_new_price_stock_sendkeys(
             -1, self.stock1)  #库存0
         handle.Kjlb_browseorgspace_menu_product_new_price_save().click(
         )  #点击保存
         #6.2 价格:123 库存:空
         handle.Kjlb_browseorgspace_menu_product_new_price_add_click()  #+新价
         handle.Kjlb_browseorgspace_menu_product_new_price_unitprice_sendkeys(
             -2, self.price2)  #单价123元
         handle.Kjlb_browseorgspace_menu_product_new_price_stock_sendkeys(
             -1, self.stock2)  #库存空
         handle.Kjlb_browseorgspace_menu_product_new_price_save_click(
         )  #点击保存
         #6.3 价格:空 库存:123
         handle.Kjlb_browseorgspace_menu_product_new_price_add_click()  #+新价
         handle.Kjlb_browseorgspace_menu_product_new_price_stock_sendkeys(
             -1, self.stock3)  #库存123
         handle.Kjlb_browseorgspace_menu_product_new_price_unitprice_sendkeys(
             -2, self.price3)  #单价空
         handle.Kjlb_browseorgspace_menu_product_new_price_save_click(
         )  #点击保存
         #6.4 价格:999 库存:999
         handle.Kjlb_browseorgspace_menu_product_new_price_add_click()  #+新价
         handle.Kjlb_browseorgspace_menu_product_new_price_unitprice_sendkeys(
             -2, self.price4)  #单价999元
         handle.Kjlb_browseorgspace_menu_product_new_price_stock_sendkeys(
             -1, self.stock4)  #库存999
         handle.Kjlb_browseorgspace_menu_product_new_price_save_click(
         )  #点击保存
         handle.Kjlb_browseorgspace_menu_product_new_price_back_click(
         )  #点击返回
         #7.保存->发布
         handle.Kjlb_browseorgspace_menu_product_new_save_click()  #点击保存
     except Exception as err:
         logging.error("Error Information CreateProduct Inside : %s" % err)
         raise err
Exemplo n.º 29
0
    def createSpace(self, driver, fullname, easyname):
        #创建工具类
        tools = Tools(driver)  #tools工具
        #创建_SPACEHANDLE5公有定位控件对象
        handle = _SPACEHANDLE5(driver)
        sleep(1)
        try:
            #1.空间首页
            handle.Kjlb_click()
            #2.右上角主菜单
            handle.Kjlb_mainmenu_click()
            #3.+机构空间
            handle.Kjlb_mainmenu_newspace_click()
            #--------------------------新建机构空间-------------------------
            # 机构名称:(fullname):appium测试空间
            # 机构简称:(easyname):appium测试空间
            # 机构类型:企业
            # 产业角色:工厂
            # 客户类型:石材
            # 所在地区:北京-东城
            # 详细地址:不填
            handle.Kjlb_mainmenu_newspace_orgname_sendkeys(fullname)  #全称
            handle.Kjlb_mainmenu_newspace_orgintro_sendkeys(easyname)  #简称
            handle.Kjlb_mainmenu_newspace_orgtitle_click()  #点击标题
            handle.Kjlb_mainmenu_newspace_orgtype_click()  #机构类型
            handle.Kjlb_mainmenu_newspace_orgtype_company_click()  #机构类型:企业
            sleep(1)
            handle.Kjlb_mainmenu_newspace_industry_click()  #产业角色
            handle.Kjlb_mainmenu_newspace_industry_tag_click(
                self.industry)  #选择工厂
            handle.Kjlb_mainmenu_newspace_customertype_click()  #客户类型
            handle.Kjlb_mainmenu_newspace_customertype_tag_click(
                self.customertype)  #客户类型标签
            handle.Kjlb_mainmenu_newspace_customertype_confirm_click()  #点击确定
            handle.Kjlb_mainmenu_newspace_area_click()  #所在地区
            driver.find_element_by_name(self.province).click()
            driver.find_element_by_name(self.city).click()
            # handle.Kjlb_mainmenu_newspace_area_address_click(self.province)#北京
            # handle.Kjlb_mainmenu_newspace_area_address_click(self.city)#东城
            handle.Kjlb_mainmenu_newspace_affirm_click()  #点击提交

            #------------------------验证对公账号-------------------------------
            handle.Kjlb_mainmenu_newspace_verifynow_click()  #点击去验证
            #开户银行:AAA
            #所在地区:北京-东城
            #支行:BBB
            #银行账号:123456
            handle.Kjlb_mainmenu_newspace_verifynow_soverbank_sendkeys(
                self.soverbank)  #开户银行
            handle.Kjlb_mainmenu_newspace_verifynow_soveraddress_click()  #所在地区
            # handle.Kjlb_mainmenu_newspace_verifynow_soveraddress_list_click(self.province)#北京
            # handle.Kjlb_mainmenu_newspace_verifynow_soveraddress_list_click(self.city)#东城
            driver.find_element_by_name(self.province).click()  #北京
            driver.find_element_by_name(self.city).click()  #东城
            handle.Kjlb_mainmenu_newspace_verifynow_sovermybank_sendkeys(
                self.sovermybank)  #支行
            handle.Kjlb_mainmenu_newspace_verifynow_soverbanknub_sendkeys(
                self.soverbanknub)  #银行账户
            handle.Kjlb_mainmenu_newspace_verifynow_soversave_click()  #确定提交
            sleep(1)
            handle.Kjlb_mainmenu_newspace_verifynow_soversave_back_click(
            )  #点击返回
            sleep(1)
        except Exception as err:
            logging.error("Error Information CreateSpace Inside : %s" % err)
            raise err
Exemplo n.º 30
0
    def teamAssignJob(self,driver):
        #创建工具类
        tools = Tools(driver)#tools工具
        #创建_OrgSpaceTeamHandle公有定位控件对象
        handle = _SPACEHANDLE5(driver)
        sleep(1)
        try:
        #1.空间首页
            # handle.Kjlb_click()
            # tools.getScreenShot(screen_path,"空间首页")
        #2.选择空间:测试空间123
            # handle.Kjlb_browseorgspaceByName_click(self.spacename)
        #3.右上角:菜单栏选择团队
            handle.Kjlb_browseorgspace_menu_click()#右上角菜单
            handle.Kjlb_browseorgspace_menu_team_click()#点击团队
        #4.团队编辑,编辑各职位人数
            #4.1 管理员人数:2人
            handle.Kjlb_browseorgspace_menu_team_teamedit_click()#点击编辑
            # handle.Kjlb_browseorgspace_menu_team_teamedit_numeidt_click(self.AdministratorLoc)#编辑管理员人数
            driver.find_elements_by_id("com.yunlu6.stone:id/companyteam_item_edit")[0].click()

            handle.Kjlb_browseorgspace_menu_team_teamedit_numeidt_jobsnumedit().clear()#清空
            handle.Kjlb_browseorgspace_menu_team_teamedit_numeidt_jobsnumedit_sendkeys(self.AdmNum)#2人
            handle.Kjlb_browseorgspace_menu_team_teamedit_numeidt_confirm_click()#点击是
            #4.2 销售员人数:3人
            # handle.Kjlb_browseorgspace_menu_team_teamedit_numeidt_click(self.SalespersonLoc)#编辑销售员人数
            driver.find_elements_by_id("com.yunlu6.stone:id/companyteam_item_edit")[1].click()

            handle.Kjlb_browseorgspace_menu_team_teamedit_numeidt_jobsnumedit().clear()#清空
            handle.Kjlb_browseorgspace_menu_team_teamedit_numeidt_jobsnumedit_sendkeys(self.SalNum)#3人
            handle.Kjlb_browseorgspace_menu_team_teamedit_numeidt_confirm_click()#点击是
            #4.3 行政助理人数:4人
            # handle.Kjlb_browseorgspace_menu_team_teamedit_numeidt_click(self.AssistantLoc)#编辑助理人数
            driver.find_elements_by_id("com.yunlu6.stone:id/companyteam_item_edit")[3].click()

            handle.Kjlb_browseorgspace_menu_team_teamedit_numeidt_jobsnumedit().clear()#清空
            handle.Kjlb_browseorgspace_menu_team_teamedit_numeidt_jobsnumedit_sendkeys(self.AssNum)#4人
            handle.Kjlb_browseorgspace_menu_team_teamedit_numeidt_confirm_click()#点击是
        #5.检查各职位人数是否保存生效
            #5.1 检查管理员人数编辑是否生效
            # handle.Kjlb_browseorgspace_menu_team_teamedit_numeidt_click(self.AdministratorLoc)#编辑管理员人数
            driver.find_elements_by_id("com.yunlu6.stone:id/companyteam_item_edit")[0].click()

            AdmNumm = int(handle.Kjlb_browseorgspace_menu_team_teamedit_numeidt_jobsnumedit().text)
            assert self.AdmNum == AdmNumm,"编辑管理员人数保存后未生效"
            handle.Kjlb_browseorgspace_menu_team_teamedit_numeidt_cancel_click()#点击否
            #5.2 检查销售员人数编辑是否生效
            # handle.Kjlb_browseorgspace_menu_team_teamedit_numeidt_click(self.SalespersonLoc)#编辑管理员人数
            driver.find_elements_by_id("com.yunlu6.stone:id/companyteam_item_edit")[1].click()

            SalNum = int(handle.Kjlb_browseorgspace_menu_team_teamedit_numeidt_jobsnumedit().text)
            assert self.SalNum == SalNum,"编辑销售员人数保存后未生效"
            handle.Kjlb_browseorgspace_menu_team_teamedit_numeidt_cancel_click()#点击否
            #5.3 检查行政助理人数编辑是否生效
            # handle.Kjlb_browseorgspace_menu_team_teamedit_numeidt_click(self.AssistantLoc)#编辑管理员人数
            driver.find_elements_by_id("com.yunlu6.stone:id/companyteam_item_edit")[3].click()

            AssNum = int(handle.Kjlb_browseorgspace_menu_team_teamedit_numeidt_jobsnumedit().text)
            assert self.AssNum == AssNum,"编辑管理员人数后未生效"
            handle.Kjlb_browseorgspace_menu_team_teamedit_numeidt_cancel_click()#点击否
        #6.关闭编辑
            handle.Kjlb_browseorgspace_menu_team_teamedit_click()#点击编辑按钮
        #7.菜单栏-人事任免
            handle.Kjlb_browseorgspace_menu_team_menu_click()#点击菜单栏
            handle.Kjlb_browseorgspace_menu_team_menu_assignjob_click()#点击人事任免
            if driver.find_elements_by_id("com.yunlu6.stone:id/removaljobs_name") != []:#列表是否为空
                listT = handle.Kjlb_browseorgspace_menu_team_menu_assignjob_contact()
                for i in range(len(listT)):#遍历列表
                    if handle.Kjlb_browseorgspace_menu_team_menu_assignjob_contact()[i].text == self.Name:#再判断是否该人已被任免
                        handle.Kjlb_browseorgspace_menu_team_menu_assignjob_contact_click(0)#待任免联系人
                        handle.Kjlb_browseorgspace_menu_team_menu_assignjob_contact_delete_click()#点击移除
                    else :
                        pass
            else:
                pass
            handle.Kjlb_browseorgspace_menu_team_menu_assignjob_addperson_click()#点击人事任免新增按钮
        #8.搜索姓名:肖静远
            handle.Kjlb_browseorgspace_menu_team_menu_assignjob_addperson_search_sendkeys(self.Name)#搜索关键字
            handle.Kjlb_browseorgspace_menu_team_menu_assignjob_addperson_searchbtn_click()#点击搜索
        #9.点击搜索的结果,添加
            handle.Kjlb_browseorgspace_menu_team_menu_assignjob_addperson_choose_click(0)#勾选
            handle.Kjlb_browseorgspace_menu_team_menu_assignjob_addperson_confirm_click()#添加
        #10.待任免列表点击联系人-任免职位-勾选-返回
            handle.Kjlb_browseorgspace_menu_team_menu_assignjob_contact_click(0)#待任免联系人
            handle.Kjlb_browseorgspace_menu_team_menu_assignjob_contact_department_click(self.Director)#董事会
            handle.Kjlb_browseorgspace_menu_team_menu_assignjob_contact_jobname_click(0)#董事长
            handle.Kjlb_browseorgspace_menu_team_menu_assignjob_contact_confrim_click()#勾选
            handle.Kjlb_browseorgspace_menu_team_menu_assignjob_contact_back_click()#返回
            name = driver.find_elements_by_id("com.yunlu6.stone:id/companyteam_item_name")[0].text#获取董事长姓名
            assert self.Name == name,"董事长任免失败"
        #11.移除任免,还原
            handle.Kjlb_browseorgspace_menu_team_menu_click()#点击菜单栏
            handle.Kjlb_browseorgspace_menu_team_menu_assignjob_click()#点击人事任免
            handle.Kjlb_browseorgspace_menu_team_menu_assignjob_contact_click(0)#待任免联系人
            handle.Kjlb_browseorgspace_menu_team_menu_assignjob_contact_delete_click()#点击移除
        except Exception as err:
            logging.error("Error Information TeamAssignJob Inside : %s"%err)
            raise err