fix cms subsection tests
STUD-1624
This commit is contained in:
@@ -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):
|
||||
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()
|
||||
|
||||
|
||||
|
||||
@@ -38,14 +38,16 @@ Feature: CMS.Create Subsection
|
||||
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
|
||||
|
||||
# Disabling due to failure on master. JZ 05/14/2014 TODO: fix
|
||||
# Scenario: Set release and due dates of subsection on enter
|
||||
# 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 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
|
||||
# And I see the subsection due date is 04/04/2014 04:00
|
||||
@skip_safari
|
||||
Scenario: Set release and due dates of subsection on enter
|
||||
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 due date on enter to 04/04/2014 04: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 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
|
||||
Given I have opened a new course section in Studio
|
||||
@@ -56,16 +58,18 @@ Feature: CMS.Create Subsection
|
||||
And I confirm the prompt
|
||||
Then the subsection does not exist
|
||||
|
||||
# Disabling due to failure on master. JZ 05/14/2014 TODO: fix
|
||||
# Scenario: Sync to Section
|
||||
# Given I have opened a new course section in Studio
|
||||
# And I click the Edit link for the release date
|
||||
# And I set the section release date to 01/02/2103
|
||||
# And I have added a new subsection
|
||||
# And I click on the subsection
|
||||
# And I set the subsection release date to 01/20/2103
|
||||
# And I reload the page
|
||||
# And I click the link to sync release date to section
|
||||
# And I wait for "1" second
|
||||
# And I reload the page
|
||||
# Then I see the subsection release date is 01/02/2103
|
||||
@skip_safari
|
||||
Scenario: Sync to Section
|
||||
Given I have opened a new course section in Studio
|
||||
And I click the Edit link for the release date
|
||||
And I set the section release date to 01/02/2103
|
||||
And I have added a new subsection
|
||||
And I click on the subsection
|
||||
And I set the subsection release date to 06/20/2104
|
||||
Then I see the subsection release date is 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 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
|
||||
|
||||
|
||||
@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'):
|
||||
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:]+)?')
|
||||
def set_subsection_due_date_on_enter(_step, datestring, timestring): # pylint: disable-msg=invalid-name
|
||||
if not world.css_visible('input#due_date'):
|
||||
world.css_click('.due-date-input .set-date')
|
||||
|
||||
set_subsection_date('input#due_date', datestring, 'input#due_time', timestring, 'ENTER')
|
||||
set_subsection_due_date(_step, datestring, timestring, 'ENTER')
|
||||
|
||||
|
||||
@step('I mark it as Homework$')
|
||||
|
||||
Reference in New Issue
Block a user