Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions common/test/acceptance/pages/studio/course_rerun.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,5 @@ def create_rerun(self):
Clicks the create rerun button.
"""
self.q(css='.rerun-course-save')[0].click()
# Clicking on the course will trigger an ajax event
self.wait_for_ajax()
15 changes: 11 additions & 4 deletions common/test/acceptance/pages/studio/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

from bok_choy.page_object import PageObject
from . import BASE_URL
from selenium.webdriver import ActionChains


class DashboardPage(PageObject):
Expand All @@ -28,18 +29,24 @@ def course_runs(self):
def has_processing_courses(self):
return self.q(css='.courses-processing').present

def create_rerun(self, display_name):
def create_rerun(self, course_key):
"""
Clicks the create rerun link of the course specified by display_name.
Clicks the create rerun link of the course specified by course_key
'Re-run course' link doesn't show up until you mouse over that course in the course listing
"""
name = self.q(css='.course-title').filter(lambda el: el.text == display_name)[0]
name.find_elements_by_xpath('../..')[0].find_elements_by_class_name('rerun-button')[0].click()
actions = ActionChains(self.browser)
button_name = self.browser.find_element_by_css_selector('.rerun-button[href$="' + course_key + '"]')
actions.move_to_element(button_name)
actions.click(button_name)
actions.perform()

def click_course_run(self, run):
"""
Clicks on the course with run given by run.
"""
self.q(css='.course-run .value').filter(lambda el: el.text == run)[0].click()
# Clicking on course with run will trigger an ajax event
self.wait_for_ajax()

def has_new_library_button(self):
"""
Expand Down
3 changes: 2 additions & 1 deletion common/test/acceptance/tests/studio/test_studio_rerun.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,10 @@ def test_course_rerun(self):
Then I see one html component with the content 'Test Content'
"""
course_info = (self.course_info['org'], self.course_info['number'], self.course_info['run'])
updated_course_info = course_info[0] + "+" + course_info[1] + "+" + course_info[2]

self.dashboard_page.visit()
self.dashboard_page.create_rerun(self.course_info['display_name'])
self.dashboard_page.create_rerun(updated_course_info)

rerun_page = CourseRerunPage(self.browser, *course_info)
rerun_page.wait_for_page()
Expand Down