示例#1
0
def change_name(step, new_name):
    settings_css = '.settings-button'
    world.css_click(settings_css)
    input_css = 'input.setting-input'
    world.css_fill(input_css, new_name)
    if world.is_firefox():
        world.trigger_event(input_css)
    world.save_component()
示例#2
0
def enter_xml_in_advanced_problem(_step, text):
    """
    Edits an advanced problem (assumes only on page),
    types the provided XML, and saves the component.
    """
    world.edit_component()
    type_in_codemirror(0, text)
    world.save_component()
def enter_xml_in_advanced_problem(step, text):
    """
    Edits an advanced problem (assumes only on page),
    types the provided XML, and saves the component.
    """
    world.edit_component()
    type_in_codemirror(0, text)
    world.save_component()
示例#4
0
文件: pages.py 项目: eliesmr4/myedx
def change_name(step, new_name):
    settings_css = '.settings-button'
    world.css_click(settings_css)
    input_css = 'input.setting-input'
    world.css_fill(input_css, new_name)
    if world.is_firefox():
        world.trigger_event(input_css)
    world.save_component()
示例#5
0
def video_name_persisted(step):
    world.save_component()
    reload_the_page(step)
    world.wait_for_xmodule()
    world.edit_component()

    world.verify_setting_entry(world.get_setting_entry(DISPLAY_NAME),
                               DISPLAY_NAME, '3.4', True)
示例#6
0
def set_show_captions(step, setting):
    # Prevent cookies from overriding course settings
    world.browser.cookies.delete('hide_captions')

    world.edit_component()
    world.select_editor_tab('Advanced')
    world.browser.select('Show Transcript', setting)
    world.save_component()
示例#7
0
def video_name_persisted(step):
    world.save_component()
    reload_the_page(step)
    world.wait_for_xmodule()
    world.edit_component()

    world.verify_setting_entry(world.get_setting_entry('Display Name'),
                               'Display Name', '3.4', True)
示例#8
0
def set_show_captions(step, setting):
    # Prevent cookies from overriding course settings
    world.browser.cookies.delete('hide_captions')

    world.edit_component()
    world.select_editor_tab('Advanced')
    world.browser.select('Transcript Display', setting)
    world.save_component()
示例#9
0
def i_can_modify_the_display_name_with_html(_step):
    """
    If alert appear on save then UnexpectedAlertPresentException
    will occur and test will fail.
    """
    index = world.get_setting_entry_index(DISPLAY_NAME)
    world.set_field_value(index, "<script>alert('test')</script>")
    verify_modified_display_name_with_html()
    world.save_component()
示例#10
0
def video_name_persisted(step):
    world.save_component()
    reload_the_page(step)
    world.wait_for_xmodule()
    world.edit_component()

    world.verify_setting_entry(
        world.get_setting_entry('Display Name'),
        'Display Name', '3.4', True
    )
示例#11
0
def video_name_persisted(step):
    world.save_component()
    reload_the_page(step)
    world.wait_for_xmodule()
    world.edit_component()

    world.verify_setting_entry(
        world.get_setting_entry(DISPLAY_NAME),
        DISPLAY_NAME, '3.4', True
    )
示例#12
0
def i_edit_blank_problem_for_annotation_response(_step):
    world.edit_component(1)
    text = """
        <problem>
            <annotationresponse>
                <annotationinput><text>Text of annotation</text></annotationinput>
            </annotationresponse>
        </problem>"""
    type_in_codemirror(0, text)
    world.save_component()
def i_edit_blank_problem_for_annotation_response(_step):
    edit_css = """$('.component-header:contains("Blank Advanced Problem")').parent().find('a.edit-button').click()"""
    text = """
        <problem>
            <annotationresponse>
                <annotationinput><text>Text of annotation</text></annotationinput>
            </annotationresponse>
        </problem>"""
    world.browser.execute_script(edit_css)
    world.wait_for_ajax_complete()
    type_in_codemirror(0, text)
    world.save_component()
示例#14
0
def i_enter_bad_xml(step):
    world.edit_component()
    type_in_codemirror(
        0, """<problem><h1>Smallest Canvas</h1>
            <p>You want to make the smallest canvas you can.</p>
            <multiplechoiceresponse>
            <choicegroup type="MultipleChoice">
              <choice correct="false"><verbatim><canvas id="myCanvas" width = 10 height = 100> </canvas></verbatim></choice>
              <choice correct="true"><code><canvas id="myCanvas" width = 10 height = 10> </canvas></code></choice>
            </choicegroup>
            </multiplechoiceresponse>
            </problem>""")
    world.save_component(step)
示例#15
0
def i_enter_bad_xml(step):
    world.edit_component()
    type_in_codemirror(
        0,
        """<problem><h1>Smallest Canvas</h1>
            <p>You want to make the smallest canvas you can.</p>
            <multiplechoiceresponse>
            <choicegroup type="MultipleChoice">
              <choice correct="false"><verbatim><canvas id="myCanvas" width = 10 height = 100> </canvas></verbatim></choice>
              <choice correct="true"><code><canvas id="myCanvas" width = 10 height = 10> </canvas></code></choice>
            </choicegroup>
            </multiplechoiceresponse>
            </problem>"""
    )
    world.save_component(step)
示例#16
0
def save_changes(_step):
    world.save_component()
示例#17
0
def unset_display_name(step):
    world.edit_component_and_select_settings()
    world.revert_setting_entry(DISPLAY_NAME)
    world.save_component()
示例#18
0
def change_display_name(step, display_name):
    world.edit_component_and_select_settings()
    index = world.get_setting_entry_index(DISPLAY_NAME)
    world.set_field_value(index, display_name)
    world.save_component()
示例#19
0
def unset_display_name(step):
    world.edit_component_and_select_settings()
    world.revert_setting_entry(DISPLAY_NAME)
    world.save_component()
示例#20
0
def change_display_name(step, display_name):
    world.edit_component_and_select_settings()
    index = world.get_setting_entry_index(DISPLAY_NAME)
    world.set_field_value(index, display_name)
    world.save_component()
示例#21
0
def save_changes(_step):
    world.save_component()
示例#22
0
def i_click_on_save(step):
    world.save_component()
示例#23
0
def i_click_on_save(_step):
    world.save_component()