當前位置: 首頁>>代碼示例>>Python>>正文


Python ListPage.go_to_standin方法代碼示例

本文整理匯總了Python中openeobs_mobile.list_page.ListPage.go_to_standin方法的典型用法代碼示例。如果您正苦於以下問題:Python ListPage.go_to_standin方法的具體用法?Python ListPage.go_to_standin怎麽用?Python ListPage.go_to_standin使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在openeobs_mobile.list_page.ListPage的用法示例。


在下文中一共展示了ListPage.go_to_standin方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: TestTaskListPage

# 需要導入模塊: from openeobs_mobile.list_page import ListPage [as 別名]
# 或者: from openeobs_mobile.list_page.ListPage import go_to_standin [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)
#.........這裏部分代碼省略.........
開發者ID:Gimpneek,項目名稱:openeobs-quality-assurance,代碼行數:103,代碼來源:test_task_list_page.py

示例2: TestPatientListPage

# 需要導入模塊: from openeobs_mobile.list_page import ListPage [as 別名]
# 或者: from openeobs_mobile.list_page.ListPage import go_to_standin [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

示例3: TestStandInPage

# 需要導入模塊: from openeobs_mobile.list_page import ListPage [as 別名]
# 或者: from openeobs_mobile.list_page.ListPage import go_to_standin [as 別名]
class TestStandInPage(TestCommon):
    """
    Setup a session and test the stand in page
    """
    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_standin()

    def test_stand_in(self):
        """
        Test that the stand-in function works
        """
        nurse_name = StandInPage(self.driver).submit_stand_in()
        nurse = nurse_name.split(' ', 1)[0].lower()

        response = StandInPage(self.driver).confirm_stand_in(
            nurse, self.patient_list_page).text

        self.patient_list_page.go_to_standin()

        success = 'Successfully accepted stand-in invite'
        self.assertEqual(success, response,
                         'Stand in was unsuccessful')

    def test_stand_in_reject(self):
        """
        Test that a stand-in can be rejected
        """
        nurse_name = StandInPage(self.driver).submit_stand_in()
        nurse = nurse_name.split(' ', 1)[0].lower()
        response = StandInPage(self.driver).reject_stand_in(
            nurse, self.patient_list_page)

        success = 'Successfully rejected stand-in invite'
        self.assertEqual(success, response.text, 'Reject was unsuccessful')

    def test_claim_stand_in(self):
        """
        Test that a stand-in can be claimed back
        """
        nurse_name = StandInPage(self.driver).submit_stand_in()
        nurse = nurse_name.split(' ', 1)[0].lower()
        StandInPage(self.driver).confirm_stand_in(
            nurse, self.patient_list_page)

        self.setUp()

        response = StandInPage(self.driver).claim_stand_in()

        success = 'Patients claimed'
        self.assertEqual(success, response.text, 'Reject was unsuccessful')

    def test_erppeek_stand_in(self):
        """
        Test that accepting a stand-in through the GUI, after doing so through
        erppeek will cause a server error
        """
        task_id = StandInPage.add_stand_in()
        StandInPage(self.driver).go_to_patient_list()
        StandInPage.complete_stand_in(task_id)

        self.driver.find_element(*STAND_IN_ACCEPT_BUTTON).click()
        ui.WebDriverWait(self.driver, 5).until(
            ec.visibility_of_element_located(STAND_IN_CONFIRM))
        self.driver.find_element(*STAND_IN_CONFIRM).click()
        response = self.driver.find_element(*STAND_IN_ERROR).text

        success = 'Error accepting patients'
        self.assertEqual(success, response, 'Stand in should not be accepted')
開發者ID:NeovaHealth,項目名稱:openeobs-quality-assurance,代碼行數:74,代碼來源:test_stand_in_page.py


注:本文中的openeobs_mobile.list_page.ListPage.go_to_standin方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。