Ejemplo n.º 1
0
def test(data):
    test_list.delete_test(data.test)
    common.assert_toast_message_is_displayed('File {} was removed'.format(
        data.test))
    assert not test_list.test_exists(data.test)
    actions.refresh_page()
    assert not test_list.test_exists(data.test)
Ejemplo n.º 2
0
def test(data):
    common.navigate_menu('Project Settings')
    settings.set_settings_value('{\n"search_timeout": 10\n}')
    actions.click(settings.save_button)
    common.assert_toast_message_is_displayed('Settings saved')
    actions.refresh_page()
    settings.assert_settings_value('{\n"search_timeout": 10\n}')
Ejemplo n.º 3
0
def test(data):
    new_name = data.page + '_rename'
    page_list.rename_page(data.page, new_name)
    assert not page_list.page_exists(data.page)
    page_list.assert_page_exists(new_name)
    actions.refresh_page()
    page_list.assert_page_exists(new_name)
Ejemplo n.º 4
0
def setup(data):
    common.access_golem(data.env.url, data.env.admin)
    api.project.using_project('test_list')
    common.navigate_menu('Tests')
    data.folder = actions.random_str()
    test_list.add_folder(data.folder)
    actions.refresh_page()
Ejemplo n.º 5
0
def test(data):
    new_name = data.test + '_rename'
    test_list.rename_test(data.test, new_name)
    assert not test_list.test_exists(data.test)
    test_list.assert_test_exists(new_name)
    actions.refresh_page()
    test_list.assert_test_exists(new_name)
Ejemplo n.º 6
0
def test(data):
    new_name = data.suite + '_rename'
    suite_list.rename_suite(data.suite, new_name)
    assert not suite_list.suite_exists(data.suite)
    suite_list.assert_suite_exists(new_name)
    actions.refresh_page()
    suite_list.assert_suite_exists(new_name)
Ejemplo n.º 7
0
def test(data):
    actions.navigate(data.env.url + 'elements/')
    checkbox = ('id', 'unselected-checkbox')
    actions.click(checkbox)
    actions.verify_is_selected(checkbox)
    actions.refresh_page()
    actions.verify_is_not_selected(checkbox)
def test(data):
    test_builder.add_action('click')
    test_builder.save_test()
    actions.refresh_page()
    actions.click(test_builder.save_button)
    common.assert_toast_message_is_displayed('Test ' + data.test_name +
                                             ' saved')
Ejemplo n.º 9
0
def test_config_modal_processes_not_integer(data):
    actions.refresh_page()
    test_builder.open_run_configurations_modal()
    actions.clear_element(test_run_config_modal.processes_input)
    actions.send_keys(test_run_config_modal.processes_input, 'abc')
    actions.click(test_run_config_modal.run_button)
    common.assert_info_bar_message('Processes must be an integer')
Ejemplo n.º 10
0
def test(data):
    test_line = "description = 'desc'"
    test_builder_code.set_value(test_line)
    actions.click(test_builder_code.save_button)
    common.assert_toast_message_is_displayed('Test ' + data.test + ' saved')
    actions.refresh_page()
    test_builder_code.assert_value(test_line)
Ejemplo n.º 11
0
def setup(data):
    common.access_golem(data.env.url, data.env.admin)
    api.project.create_access_random_project()
    common.navigate_menu('Tests')
    actions.store('folder', actions.random_str())
    test_list.add_folder(data.folder)
    actions.refresh_page()
Ejemplo n.º 12
0
def test(data):
    actions.wait(1)
    suite_builder.assert_test_not_selected(data.test)
    suite_builder.select_test(data.test)
    suite_builder.assert_test_counter(selected=1)
    suite_builder.save_suite()
    actions.refresh_page()
    suite_builder.assert_test_selected(data.test)
Ejemplo n.º 13
0
def test_add_new_page_with_invalid_chars(data):
    actions.refresh_page()
    actions.click(test_builder.new_page_button)
    actions.send_keys(test_builder.new_page_modal_input, '$$invalid')
    actions.click(test_builder.new_page_modal_submit)
    common.assert_error_message(
        "Only letters, numbers and underscores are allowed")
    actions.refresh_page()
Ejemplo n.º 14
0
def test_add_new_page_with_empty_name(data):
    actions.refresh_page()
    actions.click(test_builder.new_page_button)
    actions.wait_for_element_displayed(test_builder.new_page_modal_input)
    actions.assert_element_attribute(test_builder.new_page_modal_input,
                                     'value', '')
    actions.click(test_builder.new_page_modal_submit)
    common.assert_error_message('New filename cannot be empty')
def test_rename_test_inline_invalid_chars(data):
    actions.refresh_page()
    actions.click(test_builder.test_name)
    actions.send_keys(test_builder.test_name_input, '??')
    actions.press_key(test_builder.test_name_input, 'TAB')
    common.assert_toast_message_is_displayed('Only letters, numbers and underscores are allowed')
    actions.refresh_page()
    actions.assert_element_text(test_builder.test_name, data.test)
def test_rename_test_inline_too_long(data):
    actions.refresh_page()
    actions.click(test_builder.test_name)
    actions.send_keys(test_builder.test_name_input, 'abcdefghij' * 14 + 'a')
    actions.press_key(test_builder.test_name_input, 'TAB')
    common.assert_toast_message_is_displayed('Maximum name length is 150 characters')
    actions.refresh_page()
    actions.assert_element_text(test_builder.test_name, data.test)
Ejemplo n.º 17
0
def test_save_environments(data):
    code = '{\n"test": {"url": "foo"}\n}'
    common.navigate_menu('Environments')
    environments.set_value(code)
    actions.click(environments.save_button)
    common.assert_toast_message_is_displayed('Environments saved')
    actions.refresh_page()
    assert environments.get_value() == code
Ejemplo n.º 18
0
def test(data):
    actions.navigate(data.env.url + 'elements/')
    checkbox = ('id', 'unselected-checkbox')
    actions.click(checkbox)
    actions.assert_element_checked(checkbox)
    actions.refresh_page()
    golem_steps.assert_last_step_message('Refresh page')
    actions.assert_element_not_checked(checkbox)
Ejemplo n.º 19
0
def test(data):
    new_folder = data.folder + '_rename'
    test_list.rename_folder(data.folder, new_folder)
    assert not test_list.folder_exists(data.folder)
    assert test_list.folder_exists(new_folder)
    actions.refresh_page()
    assert not test_list.folder_exists(data.folder)
    assert test_list.folder_exists(new_folder)
Ejemplo n.º 20
0
def test_config_modal_env_doesnt_exist(data):
    actions.refresh_page()
    test_builder.open_run_configurations_modal()
    actions.send_keys(test_run_config_modal.environments_input,
                      'not-existent-env')
    actions.click(test_run_config_modal.run_button)
    common.assert_info_bar_message(
        'Environment not-existent-env does not exist for project test')
Ejemplo n.º 21
0
def test(data):
    suite_list.dismiss_no_tests_alert_if()
    new_folder = data.folder + '_rename'
    suite_list.rename_folder(data.folder, new_folder)
    assert not suite_list.folder_exists(data.folder)
    assert suite_list.folder_exists(new_folder)
    actions.refresh_page()
    assert not suite_list.folder_exists(data.folder)
    assert suite_list.folder_exists(new_folder)
Ejemplo n.º 22
0
def setup(data):
    common.access_golem(data.env.url, data.env.admin)
    api.project.create_access_random_project()
    common.navigate_menu('Tests')
    actions.store('folder_one', 'foo')
    test_list.add_folder(data.folder_one)
    actions.store('folder_two', 'bar.baz')
    test_list.add_folder(data.folder_two)
    actions.refresh_page()
def test(data):
    page_line = "undefined_var"
    error_message = "Traceback (most recent call last):\nNameError: name 'undefined_var' is not defined"
    test_builder_code.set_value(page_line)
    actions.click(test_builder_code.save_button)
    common.assert_toast_message_is_displayed('Test ' + data.test + ' saved')
    common.assert_toast_message_is_displayed('There are errors in the code')
    test_builder_code.assert_error_message(error_message)
    actions.refresh_page()
    test_builder_code.assert_error_message(error_message)
Ejemplo n.º 24
0
def test(data):
    folder_one = actions.random_str()
    test_list.add_folder(folder_one)
    test_list.assert_folder_exists(folder_one)
    folder_two = 'folder1.' + actions.random_str()
    test_list.add_folder(folder_two)
    test_list.assert_folder_exists(folder_two)
    actions.refresh_page()
    test_list.assert_folder_exists(folder_one)
    test_list.assert_folder_exists(folder_two)
Ejemplo n.º 25
0
def test(data):
    actions.store('folder_one', actions.random_str())
    suite_list.add_folder(data.folder_one)
    suite_list.assert_folder_exists(data.folder_one)
    actions.store('folder_two', 'folder1.' + actions.random_str())
    suite_list.add_folder(data.folder_two)
    suite_list.assert_folder_exists(data.folder_two)
    actions.refresh_page()
    suite_list.assert_folder_exists(data.folder_one)
    suite_list.assert_folder_exists(data.folder_two)
Ejemplo n.º 26
0
def test(data):
    test_one = '{}.{}'.format(actions.random_str(), actions.random_str())
    test_two = '{}.{}.{}'.format(actions.random_str(), actions.random_str(), actions.random_str())
    test_list.add_test_to_current_folder(test_one)
    test_list.add_test_to_current_folder(test_two)
    test_list.assert_test_exists(test_one)
    test_list.assert_test_exists(test_two)
    actions.refresh_page()
    test_list.assert_test_exists(test_one)
    test_list.assert_test_exists(test_two)
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)
Ejemplo n.º 28
0
def test(data):
    actions.send_keys(suite_builder.environments_input, 'not-existent')
    actions.wait(0.5)
    actions.click(suite_builder.save_button)
    common.assert_toast_message_is_displayed(
        'Environment not-existent does not exist for project test')
    actions.refresh_page()
    actions.assert_alert_present()
    actions.accept_alert()
    actions.assert_element_value(suite_builder.environments_input, '')
Ejemplo n.º 29
0
def setup(data):
    common.access_golem(data.env.url, data.env.admin)
    api.project.using_project('test_list')
    common.navigate_menu('Tests')
    data.folder_one = 'foo'
    test_list.add_folder(data.folder_one)
    data.folder_two = 'bar'
    data.folder_three = actions.random_str()
    data.folder_two_full = '{}.{}'.format(data.folder_two, data.folder_three)
    test_list.add_folder(data.folder_two_full)
    actions.refresh_page()
Ejemplo n.º 30
0
def test(data):
    test_name = 'invalid-name'
    test_list.add_test(test_name)
    common.assert_error_message(
        'Only letters, numbers and underscores are allowed')
    assert not test_list.test_exists(test_name)
    actions.refresh_page()
    test_name = 'a' * 151
    test_list.add_test(test_name)
    common.assert_error_message('Maximum name length is 150 characters')
    assert not test_list.test_exists(test_name)