Exemple #1
0
def test(data):
    page_code = 'test = ("id", "test")'
    actions.click(page_builder.code_button)
    page_builder_code.set_value(page_code)
    page_builder_code.save_page()
    actions.click(page_builder_code.preview_button)
    actions.click(page_builder.code_button)
    page_builder_code.assert_value(page_code)
def test(data):
    actions.click(page_builder.code_button)
    page_builder_code.set_value('undefined_var')
    page_builder_code.save_page()
    actions.click(page_builder_code.preview_button)
    actions.assert_page_contains_text('There are errors in the page')
    actions.assert_page_contains_text('There are errors and the page cannot be displayed, '
                                      'open the page code editor to solve them.')
    actions.assert_element_present(page_builder.open_page_code_button)
def test(data):
    page_code = 'undefined'
    error_message = "Traceback (most recent call last):\nNameError: name 'undefined' is not defined"
    actions.click(page_builder.code_button)
    page_builder_code.set_value(page_code)
    actions.click(page_builder_code.save_button)
    common.assert_toast_message_is_displayed('There are errors in the code')
    page_builder_code.assert_error_message(error_message)
    actions.refresh_page()
    page_builder_code.assert_error_message(error_message)