def click_public_labor(self): """ 发布劳务需求 :return: """ if self.is_run_ios(): if is_element_present(self.driver, ('ACCESSIBILITY_ID', '发布劳务需求')): MainPage(self.driver).click_publish_labor_ios() self._publish_labour_ios() if not self.is_run_ios(): #LongCardPage(self.driver).click_expected_card(user_id=10001396, card_name='发布劳务需求') if is_element_present( self.driver, ("XPATH", "//*[@resource-id='com.iscs.mobilewcs:id/text' and @text='找劳务需求']" )): sleep(5) self.click_swipe_left(x1=1.5, y1=0.5, x2=0.2, y2=0.5, time=2000) self.click_swipe_left(x1=1.5, y1=0.5, x2=0.2, y2=0.5, time=2000) MainPage(self.driver).click_publish_labor_android() self._public_labour_android() pass
def test_continue_release(self): # 登录后点击长期任务卡片 main_page = MainPage(self.driver) main_page.select_page() publish_labour = PublishLabour(self.driver) publish_labour.click_public_labor() pass
def test_publish_supply_full(self): main_page = MainPage(self.driver) main_page.select_page() test_public_supply = PublishWarehouseSupply(self.driver) test_public_supply.click_publish_warehouse_supply() # 建立契约义务项. test_contractual_obligation = ContractualObligation(self.driver) test_contractual_obligation.service_contract()
def select_packing(self): """ 拣选 :return: """ w = ['KW001', 'sjbm1175w', 1, 'GOK01001', 'GOK01002'] if self.is_run_ios(): MainPage(self.driver).click_packing_ios() # 拣选1 self._temporary_task_packing_ios(location=w[0], commodity=w[1], amount=w[2], carrier=w[3]) if not self.is_run_ios(): MainPage(self.driver).click_packing_android() # 拣选1 self._temporary_task_packing_android(location=w[0], commodity=w[1], amount=w[2], carrier=w[3])
def click_publish_warehouse_supply(self): """ 发布仓储供应 :return: """ if self.is_run_ios(): if is_element_present(self.driver, ('ACCESSIBILITY_ID', '找劳务需求')): test_public_labour = PublishLabour(self.driver) # 滑动1次,滑到'发布仓储供应'卡片位置 test_public_labour.click_swipe_left(x1=1.5, y1=0.5, x2=0.2, y2=0.5, time=2000) main_page = MainPage(self.driver) main_page.click_publish_supply_ios() self._click_publish_warehouse_supply_ios() pass if not self.is_run_ios(): if is_element_present( self.driver, ("XPATH", "//*[@resource-id='com.iscs.mobilewcs:id/text' and @text='找劳务需求']" )): sleep(3) test_public_labour = PublishLabour(self.driver) # 滑动3次,滑到'发布仓储供应'卡片位置 test_public_labour.click_swipe_left(x1=1.5, y1=0.5, x2=0.2, y2=0.5, time=2000) sleep(3) test_public_labour.click_swipe_left(x1=1.5, y1=0.5, x2=0.2, y2=0.5, time=2000) sleep(3) test_public_labour.click_swipe_left(x1=1.5, y1=0.5, x2=0.2, y2=0.5, time=2000) main_page = MainPage(self.driver) main_page.click_publish_supply_android() self._click_publish_warehouse_supply_android() pass
def setUp(self): BaseTestCase.setUp(self) clear_first_sql() clear_second_sql() self.login_page = LoginPage(self.driver) self.main_page = MainPage(self.driver) self.exit_app = ExitAppPage(self.driver) self.longcard_page = LongCardPage(self.driver) self.registerd_bussiness_first_page_first = RegisteredBusinessContactsOnePage( self.driver) self.registerd_bussiness_second_page = RegisteredBusinessContactsTwoPage( self.driver) self.login_page.login(username=18267990494, password=123456) pass
def test_public_full(self): main_page = MainPage(self.driver) main_page.select_page() test_public_labour = PublishLabour(self.driver) test_public_labour.click_public_labor() assert_publish_labour()