本文整理汇总了Python中openeobs_mobile.list_page.ListPage.task_scan_helper方法的典型用法代码示例。如果您正苦于以下问题:Python ListPage.task_scan_helper方法的具体用法?Python ListPage.task_scan_helper怎么用?Python ListPage.task_scan_helper使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类openeobs_mobile.list_page.ListPage
的用法示例。
在下文中一共展示了ListPage.task_scan_helper方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: TestTaskListPage
# 需要导入模块: from openeobs_mobile.list_page import ListPage [as 别名]
# 或者: from openeobs_mobile.list_page.ListPage import task_scan_helper [as 别名]
class TestTaskListPage(TestCommon):
"""
Setup a session and test that the task list page works correctly
"""
def setUp(self):
self.driver.get(MOB_LOGIN)
self.login_page = LoginPage(self.driver)
self.task_list_page = ListPage(self.driver)
self.patient_list_page = ListPage(self.driver)
self.login_page.login(NURSE_USERNM1, NURSE_PWD1)
self.task_list_page.go_to_task_list()
def test_can_logout(self):
"""
Test that the title of the login page is Open-eObs
"""
self.task_list_page.logout()
self.assertTrue(PageConfirm(self.driver).is_login_page(),
'Did not get to the logout page correctly')
def test_can_go_to_task_list_page(self):
"""
Test that can go to task list page
"""
self.task_list_page.go_to_task_list()
self.assertTrue(PageConfirm(self.driver).is_task_list_page(),
'Did not get to the task list page correctly')
def test_go_to_patient_list_page(self):
"""
Test that can go to the patient list page
"""
self.task_list_page.go_to_patient_list()
self.assertTrue(PageConfirm(self.driver).is_patient_list_page(),
'Did not get to patient list page correctly')
def test_can_go_to_stand_in_page(self):
"""
Test that can navigate to the stand in page
"""
self.task_list_page.go_to_standin()
self.assertTrue(PageConfirm(self.driver).is_stand_in_page(),
'Did not get to stand in page correctly')
def test_can_carry_out_barcode_scan(self):
"""
Test that can do a barcode scan
"""
tasks = self.task_list_page.get_list_items()
patient_to_test = tasks[0]
task_id = patient_to_test.get_attribute('href').replace(
TASK_PAGE, ''
)
id_to_use = self.task_list_page.task_scan_helper(task_id)
self.task_list_page.do_barcode_scan(id_to_use['other_identifier'])
def test_click_list_item(self):
"""
Test that clicking on a work item tasks user to carry out the task
"""
tasks = self.task_list_page.get_list_items()
task_to_test = tasks[0]
task_url = task_to_test.get_attribute('href')
task_to_test.click()
self.assertTrue(PageConfirm(self.driver).is_task_page(),
'Did not get to task page correctly')
self.assertEqual(self.driver.current_url, task_url,
'Incorrect url')
def test_list_item_patient_name(self):
"""
Test that the patient name is in the list item
"""
tasks = self.task_list_page.get_list_items()
patient_to_test = tasks[0]
task_id = patient_to_test.get_attribute('href').replace(
TASK_PAGE, ''
)
task_data = self.task_list_page.task_helper(task_id)[0]
name_to_use = task_data['full_name']
patient_name = self.driver.find_element(
*list_page_locators.LIST_ITEM_PATIENT_NAME
)
self.assertEqual(patient_name.text, name_to_use.strip(),
'Incorrect name')
def test_list_item_patient_location(self):
"""
Test that the patient name is in the list item
"""
tasks = self.task_list_page.get_list_items()
patient_to_test = tasks[0]
task_id = patient_to_test.get_attribute('href').replace(
TASK_PAGE, ''
)
task_data = self.task_list_page.task_helper(task_id)[0]
location = task_data['location']
parent_location = task_data['parent_location']
bed_to_use = '{0}, {1}'.format(location, parent_location)
#.........这里部分代码省略.........