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


Python ListPage.get_list_task方法代码示例

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


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

示例1: TestTaskListPage

# 需要导入模块: from openeobs_mobile.list_page import ListPage [as 别名]
# 或者: from openeobs_mobile.list_page.ListPage import get_list_task [as 别名]

#.........这里部分代码省略.........
            task_list.append(patient)

        self.assertNotEquals(task_list, [], 'Task list not showing tasks')

    def test_take_task_news_obs(self):
        """
        Submit adhoc observation which creates News observation task
        and Take task NEWS Observation from task list, submit news score
        """

        # Enter high risk observation to create News Observation task in task
        # list
        self.patient_list_page.go_to_patient_list()
        high_score = HIGH_RISK_SCORE_9_EWS_DATA
        no_risk = NO_RISK_EWS_DATA
        news_task = []
        success = 'Successfully Submitted NEWS Observation'

        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(high_score)

        ui.WebDriverWait(self.driver, 5).until(
            ec.visibility_of_element_located(CONFIRM_SUBMIT)
        )
        self.driver.find_element(*CONFIRM_SUBMIT).click()

        ui.WebDriverWait(self.driver, 5).until(
            ec.visibility_of_element_located((
                SUCCESSFUL_SUBMIT))
        )
        response = self.driver.find_element(*SUCCESSFUL_SUBMIT)
        self.assertEqual(success, response.text,
                         'NEWS observation unsuccessful')

        self.driver.find_element(*GO_TO_MY_TASK).click()

        # Click on the first news score task from Task list
        self.task_list_page.go_to_task_list()

        self.driver.refresh()
        for task in self.task_list_page.get_list_task():
            # print(task.text)
            if task.text == 'NEWS Observation':
                news_task.append(task)
        news_task[0].click()

        # enter low risk observation
        PatientPage(self.driver).enter_obs_data(no_risk)

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

        self.driver.find_element(*CONFIRM_SUBMIT).click()

        ui.WebDriverWait(self.driver, 5).until(
            ec.visibility_of_element_located((
                SUCCESSFUL_SUBMIT))
        )
        response = self.driver.find_element(*SUCCESSFUL_SUBMIT)
        self.assertEqual(success, response.text,
                         'NEWS observation unsuccessful')
        # print(news_task)

    def test_confirm_clinical(self):
        """
        Test that a clinical notification can be confirmed
        """
        self.patient_list_page.go_to_patient_list()
        tasks = self.patient_list_page.get_list_items()
        patient_to_test = tasks[0]
        task_id = patient_to_test.get_attribute('href').replace(
            PATIENT_PAGE, ''
        )
        PatientPage(self.driver).remove_observations_for_patient(int(task_id))
        TaskPage(self.driver).open_clinical(task_id, self.patient_list_page)

        success = 'Submission successful'
        response = TaskPage(self.driver).confirm_clinical()
        self.assertEqual(success, response, 'Error confirming clinical')

    def test_cancel_clinical(self):
        """
        Test that a clinical notification can be cancelled
        """
        self.patient_list_page.go_to_patient_list()
        tasks = self.patient_list_page.get_list_items()
        patient_to_test = tasks[0]
        task_id = patient_to_test.get_attribute('href').replace(
            PATIENT_PAGE, ''
        )
        PatientPage(self.driver).remove_observations_for_patient(int(task_id))
        TaskPage(self.driver).open_clinical(task_id, self.patient_list_page)

        success = 'Cancellation successful'
        response = TaskPage(self.driver).cancel_clinical()
        self.assertEqual(success, response, 'Error cancelling clinical')
开发者ID:Gimpneek,项目名称:openeobs-quality-assurance,代码行数:104,代码来源:test_task_list_page.py


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