Esempio n. 1
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
Esempio n. 2
0
 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
Esempio n. 3
0
 def createPersonSpace(self,
                       driver,
                       spacename,
                       foldername1=None,
                       foldername2=None,
                       foldername3=None):  #最多三个文件夹
     #创建_SPACEHANDLE5公有定位控件对象
     handle = _SPACEHANDLE5(driver)
     sleep(2)
     try:
         # #1.空间首页
         #     handle.Kjlb_click()
         #2.右上角主菜单
         handle.Kjlb_mainmenu_click()
         #3.+私人空间
         handle.Kjlb_mainmenu_newpersonspace_click()
         #4.输入空间名称、文件夹名-保存
         handle.Kjlb_mainmenu_newpersonspace_choosespacetype_click(
             0)  #选择衣服类型空间
         handle.Kjlb_mainmenu_newpersonspace_spacename_sendkeys(
             spacename)  #appium私人空间
         # handle.Kjlb_mainmenu_newpersonspace_foldername_sendkeys(foldername1)#appium文件夹
         handle.Kjlb_mainmenu_newpersonspace_save_click()  #保存
         #6.返回到空间列表
         handle.Kjlb_mainmenu_newpersonspace_mainback_click()
     except Exception as err:
         logging.error("Error Information CreatePersonSpace Inside : %s" %
                       err)
         raise err
Esempio n. 4
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
Esempio n. 5
0
 def deletePerSFloder(self, driver, spacename):
     #创建 _SPACEHANDLE5公有定位控件对象
     handle = _SPACEHANDLE5(driver)
     #测试数据
     d = DataInfo()
     self.spacename = d.cell(
         "test006",
         2,
         13,
     )  #私人空间名
     sleep(2)
     try:
         #1.点击该空间
         handle.Kjlb_browseorgspaceByName_click(spacename)
         if driver.find_element_by_id(
                 "com.yunlu6.stone:id/personzone_item_foldernum"
         ).text != "(0)":  #判断文件夹是否为空
             #2.菜单栏
             handle.Kjlb_browseperspace_menu_click()
             #3.编辑
             handle.Kjlb_browseperspace_menu_edit_click()
             #4.删除文件夹
             #4.1删除文件夹(此时不为空)
             handle.Kjlb_browseperspace_more_menu_edit_deletefolder_click(0)
             #4.2照片列表
             handle.Kjlb_browseperspace_more_menu_edit_deletefolder_piclist_click(
                 0)
             #4.3删除
             handle.Kjlb_browseperspace_more_menu_edit_deletefolder_dbtn_click(
             )
             #4.4是
             handle.Kjlb_browseperspace_more_menu_edit_deletefolder_dbtn_y_click(
             )
             #4.5删除文件夹(为空)
             handle.Kjlb_browseperspace_more_menu_edit_deletefolder_click(0)
             driver.find_element_by_id(
                 "com.yunlu6.stone:id/edit_folder_ok").click()
         else:
             #4.5.菜单栏
             handle.Kjlb_browseperspace_menu_click()
             #4.6.编辑
             handle.Kjlb_browseperspace_menu_edit_click()
             #4.7删除文件夹(为空)
             handle.Kjlb_browseperspace_more_menu_edit_deletefolder_click(0)
             driver.find_element_by_id(
                 "com.yunlu6.stone:id/edit_folder_ok").click()
     #5.返回空间列表
         handle.Kjlb_browseperspace_more_menu_edit_back_click()
     except Exception as err:
         logging.error("Error Information CloseSpace Inside : %s" % err)
         raise err
Esempio n. 6
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
Esempio n. 7
0
 def closePersonSpace(self, driver, spacename):
     #创建_SPACEHANDLE5公有定位控件对象
     handle = _SPACEHANDLE5(driver)
     sleep(1)
     try:
         #1.点击该空间
         handle.Kjlb_browseorgspaceByName_click(spacename)
         #2.菜单栏
         handle.Kjlb_browseperspace_menu_click()
         #3.编辑
         handle.Kjlb_browseperspace_menu_edit_click()
         #4.删除空间
         handle.Kjlb_browseperspace_menu_edit_deletespace_click()
         handle.Kjlb_browseperspace_menu_edit_deletespace_OK_click()
     except Exception as err:
         logging.error("Error Information CloseSpace Inside : %s" % err)
         raise err
Esempio n. 8
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
Esempio n. 9
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
 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私人空间
Esempio n. 11
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
Esempio n. 12
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
Esempio n. 13
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
Esempio n. 14
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
Esempio n. 15
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