test_t1_21_CreateAnEvent.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:test-automation 作者: openstax 项目源码 文件源码
def test_teacher_add_event_using_the_calendar_date_8119(self):
        """Add an event using the calendar date.

        Steps:
        Click on a calendar date
        Click on the 'Add Event' option

        Expected Result:
        user taken to add ecent page with due date filled in
        """
        self.ps.test_updates['name'] = 't1.21.003' \
            + inspect.currentframe().f_code.co_name[4:]
        self.ps.test_updates['tags'] = ['t1', 't1.21', 't1.21.003', '8119']
        self.ps.test_updates['passed'] = False

        # Test steps and verification assertions
        calendar_date = self.teacher.wait.until(
            expect.element_to_be_clickable(
                (By.XPATH, '//div[contains(@class,"Day--upcoming")]')
            )
        )
        self.teacher.driver.execute_script(
            'return arguments[0].scrollIntoView();', calendar_date)
        self.teacher.sleep(1)
        actions = ActionChains(self.teacher.driver)
        actions.move_to_element_with_offset(calendar_date, 50, 10)
        actions.click()
        actions.perform()
        self.teacher.find(
            By.XPATH,
            '//ul[@class="new-assignments"]//a[contains(text(),"Add Event")]'
        ).click()
        assert('event/new' in self.teacher.current_url()),\
            'not at Add Event page'

        self.ps.test_updates['passed'] = True

    # Case C8120 - 004 - Teacher | Set open and due dates for all periods
    # collectively
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号