Merge pull request #11247 from edx/clrux/ac-313-fixup
CMS: Removing H1 and H2 from editor options; updating editor icons
This commit is contained in:
@@ -28,7 +28,7 @@ def see_a_single_step_component(step):
|
||||
for step_hash in step.hashes:
|
||||
component = step_hash['Component']
|
||||
assert_in(component, ['Discussion', 'Video'])
|
||||
component_css = 'div.xmodule_{}Module'.format(component)
|
||||
component_css = '.xmodule_{}Module'.format(component)
|
||||
assert_true(world.is_css_present(component_css),
|
||||
"{} couldn't be found".format(component))
|
||||
|
||||
@@ -56,7 +56,7 @@ def see_a_multi_step_component(step, category):
|
||||
html_matcher = {
|
||||
'Text': '\n \n',
|
||||
'Announcement': '<h3>Announcement Date</h3>',
|
||||
'Zooming Image Tool': '<h2>Zooming Image Tool</h2>',
|
||||
'Zooming Image Tool': '<h3>Zooming Image Tool</h3>',
|
||||
'E-text Written in LaTeX': '<h3>Example: E-text page</h3>',
|
||||
'Raw HTML': '<p>This template is similar to the Text template. The only difference is',
|
||||
}
|
||||
@@ -64,19 +64,19 @@ def see_a_multi_step_component(step, category):
|
||||
assert_in(html_matcher[step_hash['Component']].strip(), actual_html.strip())
|
||||
else:
|
||||
actual_text = world.css_text(selector, index=idx)
|
||||
assert_in(step_hash['Component'].upper(), actual_text)
|
||||
assert_in(step_hash['Component'], actual_text)
|
||||
|
||||
|
||||
@step(u'I see a "([^"]*)" Problem component$')
|
||||
def see_a_problem_component(step, category):
|
||||
component_css = 'div.xmodule_CapaModule'
|
||||
component_css = '.xmodule_CapaModule'
|
||||
assert_true(world.is_css_present(component_css),
|
||||
'No problem was added to the unit.')
|
||||
|
||||
problem_css = 'li.studio-xblock-wrapper div.xblock-student_view'
|
||||
problem_css = '.studio-xblock-wrapper .xblock-student_view'
|
||||
# This view presents the given problem component in uppercase. Assert that the text matches
|
||||
# the component selected (in uppercase)
|
||||
assert_true(world.css_contains_text(problem_css, category.upper()))
|
||||
# the component selected
|
||||
assert_true(world.css_contains_text(problem_css, category))
|
||||
|
||||
|
||||
@step(u'I add a "([^"]*)" "([^"]*)" component$')
|
||||
@@ -88,17 +88,17 @@ def add_component_category(step, component, category):
|
||||
|
||||
@step(u'I delete all components$')
|
||||
def delete_all_components(step):
|
||||
count = len(world.css_find('ol.reorderable-container li.studio-xblock-wrapper'))
|
||||
count = len(world.css_find('.reorderable-container .studio-xblock-wrapper'))
|
||||
step.given('I delete "' + str(count) + '" component')
|
||||
|
||||
|
||||
@step(u'I delete "([^"]*)" component$')
|
||||
def delete_components(step, number):
|
||||
world.wait_for_xmodule()
|
||||
delete_btn_css = 'a.delete-button'
|
||||
prompt_css = 'div#prompt-warning'
|
||||
btn_css = '{} button.action-primary'.format(prompt_css)
|
||||
saving_mini_css = 'div#page-notification .wrapper-notification-mini'
|
||||
delete_btn_css = '.delete-button'
|
||||
prompt_css = '#prompt-warning'
|
||||
btn_css = '{} .action-primary'.format(prompt_css)
|
||||
saving_mini_css = '#page-notification .wrapper-notification-mini'
|
||||
for _ in range(int(number)):
|
||||
world.css_click(delete_btn_css)
|
||||
assert_true(
|
||||
@@ -124,7 +124,7 @@ def see_no_components(steps):
|
||||
|
||||
@step(u'I delete a component')
|
||||
def delete_one_component(step):
|
||||
world.css_click('a.delete-button')
|
||||
world.css_click('.delete-button')
|
||||
|
||||
|
||||
@step(u'I edit and save a component')
|
||||
@@ -141,16 +141,16 @@ def duplicated_component(step, ordinal):
|
||||
"third": 2,
|
||||
}
|
||||
index = ord_map[ordinal]
|
||||
duplicate_btn_css = 'a.duplicate-button'
|
||||
duplicate_btn_css = '.duplicate-button'
|
||||
world.css_click(duplicate_btn_css, int(index))
|
||||
|
||||
|
||||
@step(u'I see a Problem component with display name "([^"]*)" in position "([^"]*)"$')
|
||||
def see_component_in_position(step, display_name, index):
|
||||
component_css = 'div.xmodule_CapaModule'
|
||||
component_css = '.xmodule_CapaModule'
|
||||
|
||||
def find_problem(_driver):
|
||||
return world.css_text(component_css, int(index)).startswith(display_name.upper())
|
||||
return world.css_text(component_css, int(index)).startswith(display_name)
|
||||
|
||||
world.wait_for(find_problem, timeout_msg='Did not find the duplicated problem')
|
||||
|
||||
@@ -158,7 +158,7 @@ def see_component_in_position(step, display_name, index):
|
||||
@step(u'I see the display name is "([^"]*)"')
|
||||
def check_component_display_name(step, display_name):
|
||||
# The display name for the unit uses the same structure, must differentiate by level-element.
|
||||
label = world.css_html("section.level-element>header>div>div>span.xblock-display-name")
|
||||
label = world.css_html(".level-element>header>div>div>span.xblock-display-name")
|
||||
assert_equal(display_name, label)
|
||||
|
||||
|
||||
|
||||
@@ -125,7 +125,7 @@ def my_display_name_change_is_persisted_on_save(step):
|
||||
|
||||
@step('the problem display name is "(.*)"$')
|
||||
def verify_problem_display_name(step, name):
|
||||
assert_equal(name.upper(), world.browser.find_by_css('.problem-header').text)
|
||||
assert_equal(name, world.browser.find_by_css('.problem-header').text)
|
||||
|
||||
|
||||
@step('I can specify special characters in the display name')
|
||||
@@ -332,8 +332,8 @@ def i_edit_blank_problem_for_annotation_response(_step):
|
||||
|
||||
@step(u'I can see cheatsheet$')
|
||||
def verify_cheat_sheet_displaying(_step):
|
||||
world.css_click("a.cheatsheet-toggle")
|
||||
css_selector = 'article.simple-editor-cheatsheet'
|
||||
world.css_click(".cheatsheet-toggle")
|
||||
css_selector = '.simple-editor-cheatsheet'
|
||||
world.wait_for_visible(css_selector)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user