def test_teacher_add_a_homework_using_the_calendar_date_8029(self):
"""Add a homework using the calendar date.
Steps:
Click on a date at least one day later than current date on calendar
From the menu that appears, click on 'Add Homework'
Expected Result:
The teacher is taken to a page where they create the assignment.
"""
self.ps.test_updates['name'] = 't1.16.002' \
+ inspect.currentframe().f_code.co_name[4:]
self.ps.test_updates['tags'] = ['t1', 't1.16', 't1.16.002', '8028']
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.driver.execute_script('window.scrollBy(0, -80);')
self.teacher.sleep(2)
actions = ActionChains(self.teacher.driver)
actions.move_to_element(calendar_date)
actions.move_by_offset(0, -35)
actions.click()
actions.move_by_offset(30, 45)
actions.click()
actions.perform()
assert('homework/new' in self.teacher.current_url()),\
'not at Add Homework page'
self.ps.test_updates['passed'] = True
# Case C8030 - 003 - Teacher | Set open/due dates for periods collectively
test_t1_16_CreateAHomework.py 文件源码
python
阅读 24
收藏 0
点赞 0
评论 0
评论列表
文章目录