Пример #1
0
 def reserved(self, base, no):
     try:
         cp = configparser.SafeConfigParser()
         cp.read('base.ini', encoding='utf-8')
         try:
             base.name_click(no)
         except BaseException:
             for StorageOut.i in range(10000):
                 n = 1
                 StorageOut.DropDown.dropDown(base)
                 try:
                     base.name_click(no)
                     break
                 except BaseException:
                     n = n + 1
         StorageOut.DropDown.dropDown(base)
         base.name_click('请选择领用人')
         base.driver.implicitly_wait(300)
         base.id_sendkey(
             'com.facilityone.product.shang:id/search_edit_text',
             cp.get('login', 'realname'))
         base.class_name_click_number('android.widget.RelativeLayout', 1)
         base.driver.implicitly_wait(0)
     except BaseException:
         self.assertEqual(0, 1, "库存出库模块,预定出库测试未通过")
Пример #2
0
    def content(self):
        try:
            sleep(2)
            for i in range(100):
                try:
                    base.name_click(Energy.cp.get('energy', 'energy'))
                    break
                except BaseException:
                    Energy.DropDown.dropDown()
            l = len(
                base.driver.find_elements_by_id(
                    'com.facilityone.product.shang:id/enery_task_detail_item_name_tv'
                ))
            i = 1
            for i in range(int(l)):
                try:
                    base.id_click_number(
                        'com.facilityone.product.shang:id/enery_task_detail_item_name_tv',
                        int(i))

                except BaseException:
                    Energy.DropDown.dropDown()
                    base.id_click_number(
                        'com.facilityone.product.shang:id/enery_task_detail_item_name_tv',
                        int(i))
                base.id_sendkey(
                    'com.facilityone.product.shang:id/enerty_write_taks_result_et',
                    i)
                base.name_click('保存')
                sleep(3)
            base.class_name_click_number('android.widget.LinearLayout', 3)
        except BaseException:
            self.assertEqual(0, 1, "能源模块,抄表测试未通过")
Пример #3
0
 def storageIn(self, material):
     try:
         cp = configparser.SafeConfigParser()
         cp.read('base.ini', encoding='utf-8')
         try:
             base.name_click(u'入库')
         except BaseException:
             try:
                 base.name_click(u'库存')
                 base.name_click(u'入库')
             except BaseException:
                 base.name_click(u'工作')
                 base.name_click(u'库存')
                 base.name_click(u'入库')
         sleep(2)
         base.name_click('点击选择仓库')
         base.driver.implicitly_wait(300)
         base.id_sendkey(
             'com.facilityone.product.shang:id/search_edit_text',
             cp.get('invebtory', 'warehouse'))
         sleep(2)
         l = len(
             base.driver.find_elements_by_class_name(
                 'android.widget.RelativeLayout'))
         base.class_name_click_number('android.widget.RelativeLayout',
                                      int(int(l) - 1))
         base.driver.implicitly_wait(0)
         i = random.randint(0, 10000)
         base.id_sendkey(
             'com.facilityone.product.shang:id/multi_input_content_et',
             '描述' + str(i))
         base.driver.find_element_by_xpath(
             '/hierarchy/android.widget.FrameLayout/cn.bingoogolapple.swipebacklayout.BGASwipeBackLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.view.ViewGroup/android.widget.FrameLayout[1]/android.view.ViewGroup/android.widget.LinearLayout/android.widget.LinearLayout[2]/android.widget.LinearLayout[1]'
         ).click()
         base.driver.implicitly_wait(300)
         base.id_sendkey(
             'com.facilityone.product.shang:id/search_edit_text', material)
         sleep(2)
         base.driver.find_element_by_xpath(
             '/hierarchy/android.widget.FrameLayout/cn.bingoogolapple.swipebacklayout.BGASwipeBackLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.view.ViewGroup/android.widget.FrameLayout[2]/android.widget.LinearLayout/android.widget.LinearLayout[2]/android.widget.FrameLayout/android.widget.ListView/android.widget.LinearLayout[1]'
         ).click()
         base.driver.implicitly_wait(0)
         base.id_click('com.facilityone.product.shang:id/ll_root')
         base.id_click(
             'com.facilityone.product.shang:id/material_add_batch')
         base.name_sendkey('请输入供应商名称', '供应商' + str(i))
         base.name_click('请选择过期时间')
         base.name_click('确定')
         due_date = base.id_text(
             'com.facilityone.product.shang:id/et_select_due_date')
         base.id_sendkey('com.facilityone.product.shang:id/et_cost', str(i))
         base.id_sendkey('com.facilityone.product.shang:id/et_amount', 2)
         base.name_click('保存')
         sleep(1)
         base.name_click('保存')
         base.id_click(
             'com.facilityone.product.shang:id/inventory_save_btn')
     except BaseException:
         self.assertEqual(0, 1, "库存入库模块,入库测试未通过")
Пример #4
0
 def create(self):
     try:
         cp = configparser.SafeConfigParser()
         cp.read('base.ini', encoding='utf-8')
         try:
             base.name_click(u'新建物资')
         except BaseException:
             try:
                 base.name_click(u'库存')
                 base.name_click(u'新建物资')
             except BaseException:
                 base.name_click(u'工作')
                 base.name_click(u'库存')
                 base.name_click(u'新建物资')
         base.name_click('点击选择仓库')
         base.driver.implicitly_wait(300)
         base.id_sendkey('com.facilityone.product.shang:id/search_edit_text', cp.get('invebtory', 'warehouse'))
         sleep(2)
         l = len(base.driver.find_elements_by_class_name('android.widget.RelativeLayout'))
         base.class_name_click_number('android.widget.RelativeLayout', int(int(l) - 1))
         base.driver.implicitly_wait(0)
         i = random.randint(0, 10000)
         base.id_sendkey('com.facilityone.product.shang:id/et_shelves', '货架信息' + str(i))
         base.id_sendkey('com.facilityone.product.shang:id/material_info_name', '物资' + str(i))
         base.id_sendkey('com.facilityone.product.shang:id/material_info_code', 'bm' + str(i))
         base.id_sendkey('com.facilityone.product.shang:id/material_info_unit', 'kg' + str(i))
         create.DropDown.dropDown()
         base.driver.implicitly_wait(200)
         base.id_sendkey('com.facilityone.product.shang:id/material_info_brand', '品牌' + str(i))
         base.driver.implicitly_wait(0)
         base.id_sendkey('com.facilityone.product.shang:id/material_info_model', 'NHG' + str(i))
         base.id_sendkey('com.facilityone.product.shang:id/material_info_ratified_price', str(i))
         create.DropDown.dropDown()
         base.id_sendkey('com.facilityone.product.shang:id/material_info_minimum_stock', 21)
         base.driver.implicitly_wait(200)
         base.id_sendkey('com.facilityone.product.shang:id/material_info_initial_number', 10)
         base.driver.implicitly_wait(0)
         base.name_sendkey('请输入或选择供应商', '供应商' + str(i))
         create.DropDown.dropDown(base)
         base.id_sendkey('com.facilityone.product.shang:id/et_cost', 22)
         base.id_click('com.facilityone.product.shang:id/et_select_due_date')
         base.name_click('确定')
         due_date = base.id_text('com.facilityone.product.shang:id/et_select_due_date')
         create.DropDown.dropDown()
         base.name_sendkey('请输入备注', '库存备注' + str(i))
         base.name_click("保存")
         sleep(7)
         return '物资' + str(i)
     except BaseException:
         self.assertEqual(0,1, "库存新建物资模块,测试未通过")
Пример #5
0
 def create(self):
     try:
         cp = configparser.SafeConfigParser()
         cp.read('base.ini', encoding='utf-8')
         try:
             base.name_click(u'创建新需求')
         except BaseException:
             try:
                 base.name_click(u'服务台')
                 base.name_click(u'创建新需求')
             except BaseException:
                 base.name_click(u'工作')
                 base.name_click(u'服务台')
                 base.name_click(u'创建新需求')
         name = str(base.id_text('com.facilityone.product.shang:id/demand_create_operator_et'))
         phone = str(base.id_text('com.facilityone.product.shang:id/demand_create_operator_phone_et'))
         if phone == "" or phone is None:
             base.class_name_sendkey_number('android.widget.EditText', 1, '15542835749')
             phone = '15542835749'
         print(name + ',' + phone)
         sleep(2)
         base.name_click(u'请选择需求类型')
         base.class_name_sendkey('android.widget.EditText', cp.get('requirment', 'type'))
         sleep(1)
         base.class_name_click_number('android.widget.RelativeLayout', 1)
         sleep(2)
         i = random.randint(0, 10000)
         sleep(1)
         try:
             base.name_click('确定')
             print(12)
         except BaseException:
             print('无子集')
         sleep(1)
         base.name_sendkey('请输入需求描述', '测试' + str(i))
         des = '测试' + str(i)
         print(des)
         base.name_click(u'提交')
         createtime = datetime.datetime.now().strftime('M-D h:m')
         inf = Information()
         inf.setdes(des)
         inf.setname(name)
         inf.setCreateTime(createtime)
         inf.settype(cp.get('requirment', 'type'))
         return inf
     except BaseException:
         self.assertEqual(0,1, "创建需求模块,测试未通过")
Пример #6
0
 def StorageCheck(self,material):
     try:
         cp = configparser.SafeConfigParser()
         cp.read('base.ini', encoding='utf-8')
         try:
             base.name_click(u'盘点')
         except BaseException:
             try:
                 base.name_click(u'库存')
                 base.name_click(u'盘点')
             except BaseException:
                 base.name_click(u'工作')
                 base.name_click(u'库存')
                 base.name_click(u'盘点')
         base.name_click('点击选择仓库')
         base.id_sendkey('com.facilityone.product.shang:id/search_edit_text', cp.get('invebtory', 'warehouse'))
         sleep(2)
         l = len(base.driver.find_elements_by_class_name('android.widget.RelativeLayout'))
         base.class_name_click_number('android.widget.RelativeLayout', int(int(l) - 1))
         base.driver.implicitly_wait(0)
         base.driver.find_element_by_xpath(
             '/hierarchy/android.widget.FrameLayout/cn.bingoogolapple.swipebacklayout.BGASwipeBackLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.view.ViewGroup/android.widget.FrameLayout[1]/android.view.ViewGroup/android.widget.LinearLayout/android.widget.LinearLayout[2]/android.widget.LinearLayout[1]').click()
         base.driver.implicitly_wait(300)
         base.id_sendkey('com.facilityone.product.shang:id/search_edit_text', material)
         sleep(2)
         base.driver.find_element_by_xpath(
             '/hierarchy/android.widget.FrameLayout/cn.bingoogolapple.swipebacklayout.BGASwipeBackLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.view.ViewGroup/android.widget.FrameLayout[2]/android.widget.LinearLayout/android.widget.LinearLayout[2]/android.widget.FrameLayout/android.widget.ListView/android.widget.LinearLayout').click()
         base.driver.implicitly_wait(0)
         base.id_click('com.facilityone.product.shang:id/ll_root')
         sleep(2)
         StorageCheck.DropDown.dropDown()
         sleep(2)
         base.driver.find_element_by_xpath(
             '/hierarchy/android.widget.FrameLayout/cn.bingoogolapple.swipebacklayout.BGASwipeBackLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.view.ViewGroup/android.widget.FrameLayout[2]/android.widget.ScrollView/android.widget.LinearLayout/android.widget.LinearLayout[2]/android.widget.LinearLayout/android.widget.ListView/android.widget.FrameLayout[1]/android.widget.LinearLayout').click()
         sleep(2)
         base.id_sendkey('com.facilityone.product.shang:id/adjust_inventory_batch_num_et', 1)
         base.id_click('com.facilityone.product.shang:id/inventory_operate_btn')
         base.name_click('确定')
         sleep(1)
         base.id_click('com.facilityone.product.shang:id/inventory_save_btn')
     except BaseException:
         self.assertEqual(0,1, "库存盘点模块,盘点测试未通过")
Пример #7
0
 def maintain(self):
     try:
         try:
             base.name_click(u'计划性维护')
         except BaseException:
             base.name_click(u'工作')
             base.name_click(u'计划性维护')
         sleep(5)
         Maintain.DropDown.dropDown()
         try:
             base.class_name_click_number('android.widget.LinearLayout', 1)
             Maintain.DropDown.dropDown()
             Maintain.ReturnPage.returnpage()
         except BaseException:
             print("无维护任务")
         sleep(2)
         Maintain.WipeUp.wipeUp()
         sleep(2)
         Maintain.ReturnPage.returnpage()
     except BaseException:
         self.assertEqual(0,1, "计划性维护模块,测试未通过")
Пример #8
0
 def change(self):
     try:
         sleep(2)
         base.name_click(Energy.cp.get('energy', 'energy'))
         l = len(
             base.driver.find_elements_by_id(
                 'com.facilityone.product.shang:id/enery_task_detail_item_name_tv'
             ))
         i = 1
         for i in range(int(l)):
             try:
                 base.id_click_number(
                     'com.facilityone.product.shang:id/enery_task_detail_item_name_tv',
                     int(i))
             except BaseException:
                 Energy.DropDown.dropDown()
                 base.id_click_number(
                     'com.facilityone.product.shang:id/enery_task_detail_item_name_tv',
                     int(i))
             base.id_click(
                 'com.facilityone.product.shang:id/energy_write_change_sb')
             base.id_click(
                 'com.facilityone.product.shang:id/confirm_button')
             base.id_sendkey(
                 'com.facilityone.product.shang:id/enerty_write_taks_result_et',
                 i)
             base.id_sendkey(
                 'com.facilityone.product.shang:id/energy_change_meter_multi_et',
                 2)
             base.id_sendkey(
                 'com.facilityone.product.shang:id/energy_change_meter_value_et',
                 int(int(i) + 1))
             base.name_click('保存')
         base.class_name_click_number('android.widget.LinearLayout', 3)
     except BaseException:
         self.assertEqual(0, 1, "能源模块,换表测试未通过")
Пример #9
0
    def reserve(self, material):
        try:
            cp = configparser.SafeConfigParser()
            cp.read('base.ini', encoding='utf-8')
            try:
                base.name_click(u'物资预定')
            except BaseException:
                try:
                    base.name_click(u'库存')
                    base.name_click(u'物资预定')
                except BaseException:
                    base.name_click(u'工作')
                    base.name_click(u'库存')
                    base.name_click(u'物资预定')
            base.name_click('点击选择仓库')
            base.driver.implicitly_wait(300)
            base.id_sendkey(
                'com.facilityone.product.shang:id/search_edit_text',
                cp.get('invebtory', 'warehouse'))
            base.class_name_click_number('android.widget.RelativeLayout', 1)
            base.driver.implicitly_wait(0)
            base.id_click(
                'com.facilityone.product.shang:id/et_administrator_add_store_name'
            )
            base.driver.implicitly_wait(300)
            base.id_sendkey(
                'com.facilityone.product.shang:id/search_edit_text',
                cp.get('login', 'realname'))
            base.class_name_click_number('android.widget.RelativeLayout', 1)
            base.driver.implicitly_wait(0)
            base.id_click(
                'com.facilityone.product.shang:id/et_supervisor_add_store_name'
            )
            base.driver.implicitly_wait(300)
            base.id_sendkey(
                'com.facilityone.product.shang:id/search_edit_text',
                cp.get('login', 'realname'))
            l = len(
                base.driver.find_elements_by_class_name(
                    'android.widget.RelativeLayout'))
            base.class_name_click_number('android.widget.RelativeLayout',
                                         int(int(l) - 1))
            base.driver.implicitly_wait(0)
            sleep(2)
            base.driver.find_element_by_xpath(
                '/hierarchy/android.widget.FrameLayout/cn.bingoogolapple.swipebacklayout.BGASwipeBackLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.view.ViewGroup/android.widget.FrameLayout[1]/android.view.ViewGroup/android.widget.LinearLayout/android.widget.LinearLayout[2]/android.widget.LinearLayout'
            ).click()
            base.driver.implicitly_wait(300)
            base.id_click('com.facilityone.product.shang:id/et_materials_code')
            base.driver.implicitly_wait(0)
            base.driver.implicitly_wait(300)
            base.id_sendkey(
                'com.facilityone.product.shang:id/search_edit_text', material)
            base.driver.implicitly_wait(0)
            sleep(2)
            base.driver.find_element_by_xpath(
                '/hierarchy/android.widget.FrameLayout/cn.bingoogolapple.swipebacklayout.BGASwipeBackLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.view.ViewGroup/android.widget.FrameLayout[2]/android.widget.LinearLayout/android.widget.LinearLayout[2]/android.widget.FrameLayout/android.widget.ListView/android.widget.LinearLayout[1]'
            ).click()
            Reserve.DropDown.dropDown()
            base.id_sendkey(
                'com.facilityone.product.shang:id/et_materials_book_number', 1)

            base.name_click('添加')
            base.name_click('预定')
        except BaseException:
            self.assertEqual(0, 1, "库存物资预定模块,预定测试未通过")
Пример #10
0
 def create(self):
     try:
         cp = configparser.SafeConfigParser()
         cp.read('base.ini', encoding='utf-8')
         try:
             base.name_click(u'创建缴费单')
         except BaseException:
             try:
                 base.name_click(u'缴费管理')
                 base.name_click(u'创建缴费单')
             except BaseException:
                 base.name_click(u'工作')
                 sleep(1)
                 Create.DropDown.dropDown()
                 base.name_click(u'缴费管理')
                 base.name_click(u'创建缴费单')
         phone = base.class_name_text_number('android.widget.EditText', 1)
         if phone == " " or phone == None:
             base.id_sendkey(
                 'com.facilityone.product.shang:id/edit_item_content_et',
                 '15542540563')
         try:
             base.id_click(
                 'com.facilityone.product.shang:id/report_customer_select_tv'
             )
             base.class_name_click_number('android.widget.RelativeLayout',
                                          0)
             Create.DropDown.dropDown()
         except:
             Create.DropDown.dropDown()
             base.class_name_sendkey_number('android.widget.EditText', 2,
                                            '测试')
             base.class_name_sendkey_number('android.widget.EditText', 3,
                                            '费哲')
             base.class_name_sendkey_number('android.widget.EditText', 4,
                                            '15143567892')
             base.class_name_sendkey_number('android.widget.EditText', 5,
                                            'HT001')
             Create.Returnpage.returnpage()
             base.class_name_sendkey_number('android.widget.EditText', 6,
                                            '测试')
             base.class_name_sendkey_number('android.widget.EditText', 7,
                                            '*****@*****.**')
             Create.DropDown.dropDown()
         base.id_click(
             'com.facilityone.product.shang:id/report_position_ll')
         base.id_sendkey(
             'com.facilityone.product.shang:id/search_edit_text',
             cp.get('workorder', 'location'))
         base.id_click(
             'com.facilityone.product.shang:id/report_select_item_rl')
         try:
             base.name_click('确定')
         except BaseException:
             print('只有一级位置')
         Create.DropDown.dropDown()
         base.id_click(
             'com.facilityone.product.shang:id/report_pay_item_ll')
         sleep(1)
         base.class_name_click_number('android.widget.ImageView', 1)
         base.driver.implicitly_wait(300)
         base.id_click('com.facilityone.product.shang:id/charges_edit_name')
         base.driver.implicitly_wait(0)
         base.id_click(
             'com.facilityone.product.shang:id/report_select_item_rl')
         i = random.randint(1, 1000)
         base.id_sendkey(
             'com.facilityone.product.shang:id/charges_edit_cost', i)
         base.id_sendkey(
             'com.facilityone.product.shang:id/charges_edit_rate', 20)
         Create.DropDown.dropDown()
         base.id_sendkey(
             'com.facilityone.product.shang:id/charges_edit_desc',
             'cs描述' + str(i))
         base.name_click('保存')
         Create.Returnpage.returnpage()
         base.id_sendkey(
             'com.facilityone.product.shang:id/multi_input_content_et',
             '描述' + str(i))
         time = datetime.now().strftime('%Y-%m-%d %H:%M')
         base.name_click('提交')
         return time
     except BaseException:
         self.assertEqual(0, 1, "创建缴费单模块,测试未通过")
Пример #11
0
 def inspectionTask(self):
     try:
         cp = configparser.SafeConfigParser()
         cp.read('E:\\app\\base.ini', encoding='utf-8')
         try:
             # base.driver.implicitly_wait(10)
             base.name_click(u'巡检任务')
             # base.driver.implicitly_wait(0)
         except BaseException:
             try:
                 base.name_click(u'巡检')
                 base.driver.implicitly_wait(30)
                 base.name_click(u'巡检任务')
                 base.driver.implicitly_wait(0)
             except BaseException:
                 base.name_click(u'工作')
                 base.name_click(u'巡检')
                 base.driver.implicitly_wait(30)
                 base.name_click(u'巡检任务')
                 base.driver.implicitly_wait(0)
         sleep(5)
         for i in range(1000):
             try:
                 base.name_click(cp.get('patrol', 'patrolname'))
                 break
             except BaseException:
                 InspectionTask.DropDown.dropDown()
                 i = i + 1
         sleep(2)
         l = len(
             base.driver.find_elements_by_class_name(
                 'android.widget.RelativeLayout'))
         for n in range(1, int(l), 2):
             base.class_name_click_number('android.widget.RelativeLayout',
                                          n)
             l1 = len(
                 base.driver.find_elements_by_class_name(
                     'android.widget.RelativeLayout'))
             for j in range(0, int(l1), 2):
                 try:
                     base.class_name_click_number(
                         'android.widget.RelativeLayout', j)
                     InspectionTask.DropDown.dropDown()
                     sleep(2)
                     InspectionTask.Returnpage.returnpage()
                 except BaseException:
                     InspectionTask.DropDown.dropDown()
                 j = j + 1
             InspectionTask.Returnpage.returnpage()
             n = n + 1
         # base.id_click('com.facilityone.product.shang:id/patrol_spot_sync_tv')
         sleep(3)
         base.name_click('提交')
         try:
             base.id_click(
                 'com.facilityone.product.shang:id/confirm_button')
         except BaseException:
             print('没有未做项')
             sleep(3)
             InspectionTask.Returnpage.returnpage()
     except BaseException:
         self.assertEqual(0, 1, "巡检任务模块,测试未通过")