Commit 305f0b2a by cahrens

Add number of spaces for formatting of JSON.

parent 6981ba4e
...@@ -2,11 +2,14 @@ from lettuce import world, step ...@@ -2,11 +2,14 @@ from lettuce import world, step
from common import * from common import *
############### ACTIONS #################### ############### ACTIONS ####################
@step('I click the new section link$') @step('I click the new section link$')
def i_click_new_section_link(step): def i_click_new_section_link(step):
link_css = 'a.new-courseware-section-button' link_css = 'a.new-courseware-section-button'
css_click(link_css) css_click(link_css)
@step('I enter the section name and click save$') @step('I enter the section name and click save$')
def i_save_section_name(step): def i_save_section_name(step):
name_css = '.new-section-name' name_css = '.new-section-name'
...@@ -14,15 +17,18 @@ def i_save_section_name(step): ...@@ -14,15 +17,18 @@ def i_save_section_name(step):
css_fill(name_css, 'My Section') css_fill(name_css, 'My Section')
css_click(save_css) css_click(save_css)
@step('I have added a new section$') @step('I have added a new section$')
def i_have_added_new_section(step): def i_have_added_new_section(step):
add_section() add_section()
@step('I click the Edit link for the release date$') @step('I click the Edit link for the release date$')
def i_click_the_edit_link_for_the_release_date(step): def i_click_the_edit_link_for_the_release_date(step):
button_css = 'div.section-published-date a.edit-button' button_css = 'div.section-published-date a.edit-button'
css_click(button_css) css_click(button_css)
@step('I save a new section release date$') @step('I save a new section release date$')
def i_save_a_new_section_release_date(step): def i_save_a_new_section_release_date(step):
date_css = 'input.start-date.date.hasDatepicker' date_css = 'input.start-date.date.hasDatepicker'
...@@ -33,17 +39,22 @@ def i_save_a_new_section_release_date(step): ...@@ -33,17 +39,22 @@ def i_save_a_new_section_release_date(step):
css_fill(time_css, '12:00am') css_fill(time_css, '12:00am')
css_click('a.save-button') css_click('a.save-button')
############ ASSERTIONS ################### ############ ASSERTIONS ###################
@step('I see my section on the Courseware page$') @step('I see my section on the Courseware page$')
def i_see_my_section_on_the_courseware_page(step): def i_see_my_section_on_the_courseware_page(step):
section_css = 'span.section-name-span' section_css = 'span.section-name-span'
assert_css_with_text(section_css, 'My Section') assert_css_with_text(section_css, 'My Section')
@step('the section does not exist$') @step('the section does not exist$')
def section_does_not_exist(step): def section_does_not_exist(step):
css = 'span.section-name-span' css = 'span.section-name-span'
assert world.browser.is_element_not_present_by_css(css) assert world.browser.is_element_not_present_by_css(css)
@step('I see a release date for my section$') @step('I see a release date for my section$')
def i_see_a_release_date_for_my_section(step): def i_see_a_release_date_for_my_section(step):
import re import re
...@@ -59,16 +70,19 @@ def i_see_a_release_date_for_my_section(step): ...@@ -59,16 +70,19 @@ def i_see_a_release_date_for_my_section(step):
match_string = '%s %s at %s' % (msg, date_regex, time_regex) match_string = '%s %s at %s' % (msg, date_regex, time_regex)
assert re.match(match_string, status_text) assert re.match(match_string, status_text)
@step('I see a link to create a new subsection$') @step('I see a link to create a new subsection$')
def i_see_a_link_to_create_a_new_subsection(step): def i_see_a_link_to_create_a_new_subsection(step):
css = 'a.new-subsection-item' css = 'a.new-subsection-item'
assert world.browser.is_element_present_by_css(css) assert world.browser.is_element_present_by_css(css)
@step('the section release date picker is not visible$') @step('the section release date picker is not visible$')
def the_section_release_date_picker_not_visible(step): def the_section_release_date_picker_not_visible(step):
css = 'div.edit-subsection-publish-settings' css = 'div.edit-subsection-publish-settings'
assert False, world.browser.find_by_css(css).visible assert False, world.browser.find_by_css(css).visible
@step('the section release date is updated$') @step('the section release date is updated$')
def the_section_release_date_is_updated(step): def the_section_release_date_is_updated(step):
css = 'span.published-status' css = 'span.published-status'
......
...@@ -45,7 +45,7 @@ CMS.Views.Settings.Advanced = CMS.Views.ValidatingView.extend({ ...@@ -45,7 +45,7 @@ CMS.Views.Settings.Advanced = CMS.Views.ValidatingView.extend({
var self = this; var self = this;
_.each(_.sortBy(_.keys(this.model.attributes), _.identity), _.each(_.sortBy(_.keys(this.model.attributes), _.identity),
function(key) { function(key) {
listEle$.append(self.template({ key : key, value : JSON.stringify(self.model.get(key))})); listEle$.append(self.template({ key : key, value : JSON.stringify(self.model.get(key), null, 4)}));
self.fieldToSelectorMap[key] = key; self.fieldToSelectorMap[key] = key;
}); });
var policyValues = listEle$.find('.json'); var policyValues = listEle$.find('.json');
......
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