Commit 807f8e9a by zubair-arbi

fix cms subsection tests

STUD-1624
parent 6c7ca7ae
...@@ -205,8 +205,9 @@ def add_subsection(name='Subsection One'): ...@@ -205,8 +205,9 @@ def add_subsection(name='Subsection One'):
def set_date_and_time(date_css, desired_date, time_css, desired_time, key=None): def set_date_and_time(date_css, desired_date, time_css, desired_time, key=None):
set_element_value(date_css, desired_date, key) set_element_value(date_css, desired_date, key)
set_element_value(time_css, desired_time, key) world.wait_for_ajax_complete()
set_element_value(time_css, desired_time, key)
world.wait_for_ajax_complete() world.wait_for_ajax_complete()
......
...@@ -38,14 +38,16 @@ Feature: CMS.Create Subsection ...@@ -38,14 +38,16 @@ Feature: CMS.Create Subsection
Then I see the subsection release date is 12/25/2011 03:00 Then I see the subsection release date is 12/25/2011 03:00
And I see the subsection due date is 01/02/2012 04:00 And I see the subsection due date is 01/02/2012 04:00
# Disabling due to failure on master. JZ 05/14/2014 TODO: fix @skip_safari
# Scenario: Set release and due dates of subsection on enter Scenario: Set release and due dates of subsection on enter
# Given I have opened a new subsection in Studio Given I have opened a new subsection in Studio
# And I set the subsection release date on enter to 04/04/2014 03:00 And I set the subsection release date on enter to 04/04/2014 03:00
# And I set the subsection due date on enter to 04/04/2014 04:00 And I set the subsection due date on enter to 04/04/2014 04:00
# And I reload the page Then I see the subsection release date is 04/04/2014 03:00
# Then I see the subsection release date is 04/04/2014 03:00 And I see the subsection due date is 04/04/2014 04:00
# And I see the subsection due date is 04/04/2014 04:00 And I reload the page
Then I see the subsection release date is 04/04/2014 03:00
And I see the subsection due date is 04/04/2014 04:00
Scenario: Delete a subsection Scenario: Delete a subsection
Given I have opened a new course section in Studio Given I have opened a new course section in Studio
...@@ -56,16 +58,18 @@ Feature: CMS.Create Subsection ...@@ -56,16 +58,18 @@ Feature: CMS.Create Subsection
And I confirm the prompt And I confirm the prompt
Then the subsection does not exist Then the subsection does not exist
# Disabling due to failure on master. JZ 05/14/2014 TODO: fix @skip_safari
# Scenario: Sync to Section Scenario: Sync to Section
# Given I have opened a new course section in Studio Given I have opened a new course section in Studio
# And I click the Edit link for the release date And I click the Edit link for the release date
# And I set the section release date to 01/02/2103 And I set the section release date to 01/02/2103
# And I have added a new subsection And I have added a new subsection
# And I click on the subsection And I click on the subsection
# And I set the subsection release date to 01/20/2103 And I set the subsection release date to 06/20/2104
# And I reload the page Then I see the subsection release date is 06/20/2104
# And I click the link to sync release date to section And I reload the page
# And I wait for "1" second Then I see the subsection release date is 06/20/2104
# And I reload the page And I click the link to sync release date to section
# Then I see the subsection release date is 01/02/2103 And I wait for "1" second
And I reload the page
Then I see the subsection release date is 01/02/2103
...@@ -64,19 +64,17 @@ def set_subsection_release_date_on_enter(_step, datestring, timestring): # pyli ...@@ -64,19 +64,17 @@ def set_subsection_release_date_on_enter(_step, datestring, timestring): # pyli
@step('I set the subsection due date to ([0-9/-]+)( [0-9:]+)?') @step('I set the subsection due date to ([0-9/-]+)( [0-9:]+)?')
def set_subsection_due_date(_step, datestring, timestring): def set_subsection_due_date(_step, datestring, timestring, key=None):
if not world.css_visible('input#due_date'): if not world.css_visible('input#due_date'):
world.css_click('.due-date-input .set-date') world.css_click('.due-date-input .set-date')
set_subsection_date('input#due_date', datestring, 'input#due_time', timestring) assert world.css_visible('input#due_date')
set_subsection_date('input#due_date', datestring, 'input#due_time', timestring, key)
@step('I set the subsection due date on enter to ([0-9/-]+)( [0-9:]+)?') @step('I set the subsection due date on enter to ([0-9/-]+)( [0-9:]+)?')
def set_subsection_due_date_on_enter(_step, datestring, timestring): # pylint: disable-msg=invalid-name def set_subsection_due_date_on_enter(_step, datestring, timestring): # pylint: disable-msg=invalid-name
if not world.css_visible('input#due_date'): set_subsection_due_date(_step, datestring, timestring, 'ENTER')
world.css_click('.due-date-input .set-date')
set_subsection_date('input#due_date', datestring, 'input#due_time', timestring, 'ENTER')
@step('I mark it as Homework$') @step('I mark it as Homework$')
......
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