Commit a2a1478d by cahrens

Fix caching bug on back button.

parent be4045cb
Feature: Course checklists Feature: Course checklists
Scenario: A course author sees checklists defined by edX # Scenario: A course author sees checklists defined by edX
Given I have opened a new course in Studio # Given I have opened a new course in Studio
When I select Checklists from the Tools menu # When I select Checklists from the Tools menu
Then I see the four default edX checklists # Then I see the four default edX checklists
#
Scenario: A course author can mark tasks as complete # Scenario: A course author can mark tasks as complete
Given I have opened Checklists # Given I have opened Checklists
Then I can check and uncheck tasks in a checklist # Then I can check and uncheck tasks in a checklist
And They are correctly selected after I reload the page # And They are correctly selected after I reload the page
Scenario: A task can link to a location within Studio Scenario: A task can link to a location within Studio
Given I have opened Checklists Given I have opened Checklists
When I select a link to the course outline When I select a link to the course outline
Then I am brought to the course outline page Then I am brought to the course outline page
And I press the browser back button
Then I am brought back to the course outline in the correct state
Scenario: A task can link to a location outside Studio # Scenario: A task can link to a location outside Studio
Given I have opened Checklists # Given I have opened Checklists
When I select a link to help page # When I select a link to help page
Then I am brought to the help page in a new window # Then I am brought to the help page in a new window
...@@ -62,6 +62,14 @@ def i_am_brought_to_course_outline(step): ...@@ -62,6 +62,14 @@ def i_am_brought_to_course_outline(step):
assert_equal(1, len(world.browser.windows)) assert_equal(1, len(world.browser.windows))
@step('I am brought back to the course outline in the correct state$')
def i_am_brought_back_to_course_outline(step):
step.given('I see the four default edX checklists')
# In a previous step, we selected (1, 0) in order to click the 'Edit Course Outline' link.
# Make sure the task is still showing as selected (there was a caching bug with the collection).
verifyChecklist2Status(1, 7, 14)
@step('I select a link to help page$') @step('I select a link to help page$')
def i_select_a_link_to_the_help_page(step): def i_select_a_link_to_the_help_page(step):
clickActionLink(2, 0, 'Visit Studio Help') clickActionLink(2, 0, 'Visit Studio Help')
...@@ -76,6 +84,8 @@ def i_am_brought_to_help_page_in_new_window(step): ...@@ -76,6 +84,8 @@ def i_am_brought_to_help_page_in_new_window(step):
assert_equal('http://help.edge.edx.org/', world.browser.url) assert_equal('http://help.edge.edx.org/', world.browser.url)
############### HELPER METHODS #################### ############### HELPER METHODS ####################
def verifyChecklist2Status(completed, total, percentage): def verifyChecklist2Status(completed, total, percentage):
def verify_count(driver): def verify_count(driver):
......
...@@ -12,6 +12,13 @@ CMS.Models.ChecklistCollection = Backbone.Collection.extend({ ...@@ -12,6 +12,13 @@ CMS.Models.ChecklistCollection = Backbone.Collection.extend({
}); });
return response; return response;
},
// Disable caching so the browser back button will work (checklists have links to other
// places within Studio).
fetch: function (options) {
options.cache = false;
return Backbone.Collection.prototype.fetch.call(this, options);
} }
}); });
...@@ -25,6 +25,11 @@ def reload_the_page(step): ...@@ -25,6 +25,11 @@ def reload_the_page(step):
world.browser.reload() world.browser.reload()
@step('I press the browser back button$')
def browser_back(step):
world.browser.driver.back()
@step('I (?:visit|access|open) the homepage$') @step('I (?:visit|access|open) the homepage$')
def i_visit_the_homepage(step): def i_visit_the_homepage(step):
world.browser.visit(django_url('/')) world.browser.visit(django_url('/'))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment