当前位置: 首页>>代码示例>>Python>>正文


Python ListPage.patient_scan_helper方法代码示例

本文整理汇总了Python中openeobs_mobile.list_page.ListPage.patient_scan_helper方法的典型用法代码示例。如果您正苦于以下问题:Python ListPage.patient_scan_helper方法的具体用法?Python ListPage.patient_scan_helper怎么用?Python ListPage.patient_scan_helper使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在openeobs_mobile.list_page.ListPage的用法示例。


在下文中一共展示了ListPage.patient_scan_helper方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: TestErrorHandling

# 需要导入模块: from openeobs_mobile.list_page import ListPage [as 别名]
# 或者: from openeobs_mobile.list_page.ListPage import patient_scan_helper [as 别名]
class TestErrorHandling(TestCommon):
    """
    Setup a session and test that e-Obs error handling works
    """
    def setUp(self):
        self.driver.get(MOB_LOGIN)
        self.login_page = LoginPage(self.driver)
        self.patient_list_page = ListPage(self.driver)
        self.login_page.login(NURSE_USERNM1, NURSE_PWD1)
        self.patient_list_page.go_to_patient_list()

    def test_news_error(self):
        """
        Test that entering incorrect data into a NEWS ob will cause an error
        """
        incorrect_score = INCORRECT_EWS_DATA

        patients = self.patient_list_page.get_list_items()

        PatientPage(self.driver).select_patient(patients)
        PatientPage(self.driver).open_form(OPEN_OBS_MENU_NEWS_ITEM)
        PatientPage(self.driver).enter_obs_data(incorrect_score)

        ui.WebDriverWait(self.driver, 5).until(
            ec.visibility_of_element_located(TASK_FORM_INVALID_SUBMIT)
        )

        response = self.driver.find_element(
            *TASK_FORM_INVALID_SUBMIT).is_displayed()

        self.assertEqual(response, True,
                         'Incorrect error handling on NEWS form')

    def test_barcode_error(self):
        """
        Test that entering incorrect data into a barcode scan will
        cause an error
        """
        no_patient_id = self.patient_list_page.patient_scan_helper(99)
        self.patient_list_page.do_barcode_scan(
            no_patient_id['other_identifier'])

        ui.WebDriverWait(self.driver, 5).until(
            ec.visibility_of_element_located(SERVER_ERROR)
        )

        response = self.driver.find_element(
            *SERVER_ERROR).is_displayed()

        self.assertEqual(response, True,
                         'Incorrect error handling on barcode scan')
开发者ID:Gimpneek,项目名称:openeobs-quality-assurance,代码行数:53,代码来源:test_error_handling.py

示例2: TestPatientListPage

# 需要导入模块: from openeobs_mobile.list_page import ListPage [as 别名]
# 或者: from openeobs_mobile.list_page.ListPage import patient_scan_helper [as 别名]
class TestPatientListPage(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.patient_list_page = ListPage(self.driver)
        self.login_page.login(NURSE_USERNM1, NURSE_PWD1)
        self.patient_list_page.go_to_patient_list()

    def test_can_logout(self):
        """
        Test that the title of the login page is Open-eObs
        """
        self.patient_list_page.logout()
        self.assertTrue(PageConfirm(self.driver).is_login_page(),
                        'Did not get to the logout page correctly')

    def test_can_go_task_list_page(self):
        """
        Test that can go to task list page
        """
        self.patient_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_patient_list_page(self):
        """
        Test that can go to the patient list page
        """
        self.patient_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_stand_in_page(self):
        """
        Test that can navigate to the stand in page
        """
        self.patient_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_do_barcode_scan(self):
        """
        Test that can do a barcode scan
        """
        patients = self.patient_list_page.get_list_items()
        patient_to_test = patients[0]
        patient_id = patient_to_test.get_attribute('href').replace(
            PATIENT_PAGE, ''
        )
        id_to_use = self.patient_list_page.patient_scan_helper(int(patient_id))
        self.patient_list_page.do_barcode_scan(id_to_use['other_identifier'])

    def test_view_patient_details(self):
        """
        Test that clicking on a work item tasks user to carry out the task
        """
        patients = self.patient_list_page.get_list_items()
        patient_to_test = patients[0]
        patient_url = patient_to_test.get_attribute('href')
        patient_to_test.click()
        self.assertTrue(PageConfirm(self.driver).is_patient_page(),
                        'Did not get to patient page correctly')
        self.assertEqual(self.driver.current_url, patient_url,
                         'Incorrect url')

    def test_patient_name_in_list(self):
        """
        Test that the patient name is in the list item
        """
        patients = self.patient_list_page.get_list_items()
        patient_to_test = patients[0]
        task_id = patient_to_test.get_attribute('href').replace(
            PATIENT_PAGE, ''
        )
        task_data = self.patient_list_page.patient_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_patient_location_in_list(self):
        """
        Test that the patient name is in the list item
        """
        patients = self.patient_list_page.get_list_items()
        patient_to_test = patients[0]
        task_id = patient_to_test.get_attribute('href').replace(
            PATIENT_PAGE, ''
        )
        task_data = self.patient_list_page.patient_helper(task_id)[0]
        location = task_data['location']
        parent_location = task_data['parent_location']
        bed_to_use = '{0}, {1}'.format(location, parent_location)
        patient_location = self.driver.find_element(
#.........这里部分代码省略.........
开发者ID:Gimpneek,项目名称:openeobs-quality-assurance,代码行数:103,代码来源:test_patient_list_page.py


注:本文中的openeobs_mobile.list_page.ListPage.patient_scan_helper方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。