pytest.sel.click

Here are the examples of the python api pytest.sel.click taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

4 Examples 7

Example 1

Project: integration_tests Source File: test_set_default_filter.py
def test_set_default_host_filter(provider, request):
    """ Test for setting default filter for hosts."""

    # Add cleanup finalizer
    def unset_default_host_filter():
        navigate_to(Host, 'All')
        list_acc.select('Filters', 'ALL', by_title=False)
        pytest.sel.click(host.default_host_filter_btn)
    request.addfinalizer(unset_default_host_filter)

    navigate_to(Host, 'All')
    list_acc.select('Filters', 'Status / Running', by_title=False)
    pytest.sel.click(host.default_host_filter_btn)
    logout()
    login_admin()
    navigate_to(Host, 'All')
    assert list_acc.is_selected('Filters', 'Status / Running (Default)', by_title=False),\
        'Status / Running filter not set as default'

Example 2

Project: integration_tests Source File: test_set_default_filter.py
def test_clear_host_filter_results(provider):
    """ Test for clearing filter results for hosts."""

    navigate_to(Host, 'All')
    list_acc.select('Filters', 'Status / Stopped', by_title=False)
    pytest.sel.click(search_box.clear_advanced_search)
    page_title = pytest.sel.text(host.page_title_loc)
    assert page_title == 'Hosts', 'Clear filter results failed'

Example 3

Project: integration_tests Source File: test_set_default_filter.py
def test_clear_datastore_filter_results(provider):
    """ Test for clearing filter results for datastores."""

    if version.current_version() >= 5.6:
        expected_page_title = 'All Datastores'
        datastore_select = lambda: accordion.tree('Datastores', 'All Datastores', 'Global Filters',
            'Store Type / VMFS')
    else:
        expected_page_title = 'Datastores'
        datastore_select = lambda: list_acc.select('Filters', 'Store Type / VMFS', by_title=False)

    navigate_to(Datastore, 'All')
    datastore_select()
    pytest.sel.click(search_box.clear_advanced_search)
    page_title = pytest.sel.text(datastore.page_title_loc)
    assert page_title == expected_page_title, 'Clear filter results failed'

Example 4

Project: integration_tests Source File: test_vm_power_control.py
def test_no_template_power_control(provider, setup_provider_funcscope, soft_assert):
    """ Ensures that no power button is displayed for templates.

    Prerequisities:
        * An infra provider that has some templates.

    Steps:
        * Open the view of all templates of the provider
        * Verify the Power toolbar button is not visible
        * Select some template using the checkbox
        * Verify the Power toolbar button is not visible
        * Click on some template to get into the details page
        * Verify the Power toolbar button is not visible
    """
    provider.load_all_provider_templates()
    toolbar.select('Grid View')
    soft_assert(not toolbar.exists("Power"), "Power displayed in template grid view!")

    # Ensure selecting a template doesn't cause power menu to appear
    templates = list(get_all_vms(True))
    template_name = random.choice(templates)
    selected_template = VM.factory(template_name, provider, template=True)

    # Check the power button with checking the quadicon
    quadicon = selected_template.find_quadicon(do_not_navigate=True, mark=True, refresh=False)
    soft_assert(not toolbar.exists("Power"), "Power displayed when template quadicon checked!")

    # Ensure there isn't a power button on the details page
    pytest.sel.click(quadicon)
    soft_assert(not toolbar.exists("Power"), "Power displayed in template details!")