def test_filter_save_cancel(vms, subset_of_vms, expression_for_vms_subset): pytest.sel.force_navigate("infra_vms") filter_name = fauxfactory.gen_alphanumeric() # Set up the filter search.save_filter("fill_field(Virtual Machine : Name, =)", filter_name, cancel=True) assert_no_cfme_exception() with pytest.raises(pytest.sel.NoSuchElementException): search.load_filter(filter_name) # does not exist
def test_filter_save_cancel(hosts, hosts_with_vm_count, host_with_median_vm): sel.force_navigate("infrastructure_hosts") median_host, median_vm_count = host_with_median_vm filter_name = generate_random_string() # Try save filter search.save_filter("fill_count(Host.VMs, >)", filter_name, cancel=True) assert_no_cfme_exception() with pytest.raises(sel.NoSuchElementException): search.load_filter(filter_name) # does not exist
def test_filter_save_cancel(hosts, hosts_with_vm_count, host_with_median_vm): pytest.sel.force_navigate("infrastructure_hosts") median_host, median_vm_count = host_with_median_vm filter_name = fauxfactory.gen_alphanumeric() # Try save filter search.save_filter(get_expression(True), filter_name, cancel=True) assert_no_cfme_exception() with pytest.raises(pytest.sel.NoSuchElementException): search.load_filter(filter_name) # does not exist
def test_filter_save_cancel(vms, subset_of_vms, expression_for_vms_subset): navigate_to(Vm, 'VMsOnly') filter_name = fauxfactory.gen_alphanumeric() # Set up the filter search.save_filter("fill_field(Virtual Machine : Name, =)", filter_name, cancel=True) assert_no_cfme_exception() with pytest.raises(search.DisabledButtonException): search.load_filter(filter_name) # does not exist
def test_filter_save_cancel(vms, subset_of_vms, expression_for_vms_subset): sel.force_navigate("infra_vms") filter_name = generate_random_string() # Set up the filter search.save_filter("fill_field(Virtual Machine : Name, =)", filter_name, cancel=True) assert_no_cfme_exception() with pytest.raises(sel.NoSuchElementException): search.load_filter(filter_name) # does not exist
def test_can_delete_filter(): navigate_to(Host, 'All') filter_name = fauxfactory.gen_alphanumeric() search.save_filter(get_expression(False).format(0), filter_name) assert_no_cfme_exception() search.reset_filter() assert_no_cfme_exception() search.load_filter(filter_name) assert_no_cfme_exception() if not search.delete_filter(): raise pytest.fail("Cannot delete filter! Probably the delete button is not present!") assert_no_cfme_exception()
def test_filter_save_cancel(vms, subset_of_vms, expression_for_vms_subset): navigate_to(Vm, 'VMsOnly') filter_name = fauxfactory.gen_alphanumeric() # Set up the filter search.save_filter( "fill_field(Virtual Machine : Name, =)", filter_name, cancel=True ) assert_no_cfme_exception() with pytest.raises(search.DisabledButtonException): search.load_filter(filter_name) # does not exist
def test_can_delete_filter(single_provider): filter_name = fauxfactory.gen_alphanumeric() logger.debug('Set filter_name to: {}'.format(filter_name)) assert search.save_filter("fill_count(Infrastructure Provider.VMs, >, 0)", filter_name) assert_no_cfme_exception() search.reset_filter() assert_no_cfme_exception() search.load_filter(filter_name) assert_no_cfme_exception() if not search.delete_filter(): raise pytest.fail("Cannot delete filter! Probably the delete button is not present!") assert_no_cfme_exception()
def test_can_delete_filter(): filter_name = fauxfactory.gen_alphanumeric() logger.debug('Set filter_name to: {}'.format(filter_name)) assert search.save_filter("fill_count(Infrastructure Provider.VMs, >, 0)", filter_name) assert_no_cfme_exception() search.reset_filter() assert_no_cfme_exception() search.load_filter(filter_name) assert_no_cfme_exception() if not search.delete_filter(): raise pytest.fail("Cannot delete filter! Probably the delete button is not present!") assert_no_cfme_exception()
def test_filter_save_cancel(request, providers, ssh_client): pytest.sel.force_navigate("infrastructure_providers") filter_name = fauxfactory.gen_alphanumeric() # Set up finalizer request.addfinalizer( lambda: ssh_client.run_rails_command( "\"MiqSearch.where(:description => {}).first.delete\"".format(repr(filter_name)))) # Try save filter search.save_filter("fill_count(Infrastructure Provider.VMs, >)", filter_name, cancel=True) assert_no_cfme_exception() with pytest.raises(pytest.sel.NoSuchElementException): search.load_filter(filter_name) # does not exist
def test_can_delete_filter(): sel.force_navigate("infra_vms") filter_name = fauxfactory.gen_alphanumeric() search.save_filter("fill_count(Virtual Machine.Files, >, 0)", filter_name) assert_no_cfme_exception() search.reset_filter() assert_no_cfme_exception() search.load_filter(filter_name) assert_no_cfme_exception() if not search.delete_filter(): raise pytest.fail("Cannot delete filter! Probably the delete button is not present!") assert_no_cfme_exception()
def test_can_delete_filter(): pytest.sel.force_navigate("infrastructure_providers") filter_name = fauxfactory.gen_alphanumeric() search.save_filter("fill_count(Infrastructure Provider.VMs, >, 0)", filter_name) assert_no_cfme_exception() search.reset_filter() assert_no_cfme_exception() search.load_filter(filter_name) assert_no_cfme_exception() if not search.delete_filter(): raise pytest.fail("Cannot delete filter! Probably the delete button is not present!") assert_no_cfme_exception()
def test_can_delete_filter(): pytest.sel.force_navigate("infrastructure_hosts") filter_name = fauxfactory.gen_alphanumeric() search.save_filter(get_expression(False).format(0), filter_name) assert_no_cfme_exception() search.reset_filter() assert_no_cfme_exception() search.load_filter(filter_name) assert_no_cfme_exception() if not search.delete_filter(): raise pytest.fail("Cannot delete filter! Probably the delete button is not present!") assert_no_cfme_exception()
def test_can_delete_filter(): sel.force_navigate("infrastructure_hosts") filter_name = generate_random_string() search.save_filter("fill_count(Host.VMs, >, 0)", filter_name) assert_no_cfme_exception() search.reset_filter() assert_no_cfme_exception() search.load_filter(filter_name) assert_no_cfme_exception() if not search.delete_filter(): raise pytest.fail("Cannot delete filter! Probably the delete button is not present!") assert_no_cfme_exception()
def test_can_delete_filter(): navigate_to(Vm, 'VMsOnly') filter_name = fauxfactory.gen_alphanumeric() search.save_filter("fill_count(Virtual Machine.Files, >, 0)", filter_name) assert_no_cfme_exception() search.reset_filter() assert_no_cfme_exception() search.load_filter(filter_name) assert_no_cfme_exception() if not search.delete_filter(): raise pytest.fail( "Cannot delete filter! Probably the delete button is not present!") assert_no_cfme_exception()
def test_can_delete_filter(): sel.force_navigate("infrastructure_hosts") filter_name = fauxfactory.gen_alphanumeric() search.save_filter(get_expression(False) % 0, filter_name) assert_no_cfme_exception() search.reset_filter() assert_no_cfme_exception() search.load_filter(filter_name) assert_no_cfme_exception() if not search.delete_filter(): raise pytest.fail( "Cannot delete filter! Probably the delete button is not present!") assert_no_cfme_exception()
def test_can_delete_filter(): sel.force_navigate("infrastructure_hosts") filter_name = generate_random_string() search.save_filter("fill_count(Host.VMs, >, 0)", filter_name) assert_no_cfme_exception() search.reset_filter() assert_no_cfme_exception() search.load_filter(filter_name) assert_no_cfme_exception() if not search.delete_filter(): raise pytest.fail( "Cannot delete filter! Probably the delete button is not present!") assert_no_cfme_exception()
def test_can_delete_filter(): sel.force_navigate("infrastructure_providers") filter_name = fauxfactory.gen_alphanumeric() search.save_filter("fill_count(Infrastructure Provider.VMs, >, 0)", filter_name) assert_no_cfme_exception() search.reset_filter() assert_no_cfme_exception() search.load_filter(filter_name) assert_no_cfme_exception() if not search.delete_filter(): raise pytest.fail( "Cannot delete filter! Probably the delete button is not present!") assert_no_cfme_exception()
def test_filter_save_cancel(request, providers, ssh_client): sel.force_navigate("infrastructure_providers") filter_name = fauxfactory.gen_alphanumeric() # Set up finalizer request.addfinalizer(lambda: ssh_client.run_rails_command( "\"MiqSearch.where(:description => {}).first.delete\"".format( repr(filter_name)))) # Try save filter search.save_filter("fill_count(Infrastructure Provider.VMs, >)", filter_name, cancel=True) assert_no_cfme_exception() with pytest.raises(sel.NoSuchElementException): search.load_filter(filter_name) # does not exist
def test_filter_save_cancel(single_provider, rails_delete_filter): # bind filter_name to the function for fixture cleanup test_filter_save_cancel.filter_name = fauxfactory.gen_alphanumeric() logger.debug('Set filter_name to: {}'.format(test_filter_save_cancel.filter_name)) # Try save filter assert search.save_filter("fill_count(Infrastructure Provider.VMs, >)", test_filter_save_cancel.filter_name, cancel=True) assert_no_cfme_exception() assert search.reset_filter() # Exception depends on system state - Load button will be disabled if there are no saved filters with pytest.raises((DisabledButtonException, NoSuchElementException)): search.load_filter(saved_filter=test_filter_save_cancel.filter_name)
def test_filter_save_cancel(rails_delete_filter): # bind filter_name to the function for fixture cleanup test_filter_save_cancel.filter_name = fauxfactory.gen_alphanumeric() logger.debug('Set filter_name to: {}'.format(test_filter_save_cancel.filter_name)) # Try save filter assert search.save_filter("fill_count(Infrastructure Provider.VMs, >)", test_filter_save_cancel.filter_name, cancel=True) assert_no_cfme_exception() assert search.reset_filter() # Exception depends on system state - Load button will be disabled if there are no saved filters with pytest.raises((DisabledButtonException, NoSuchElementException)): search.load_filter(saved_filter=test_filter_save_cancel.filter_name)
def test_filter_save_and_cancel_load(request): sel.force_navigate("infra_vms") filter_name = generate_random_string() # Set up the filter search.save_filter("fill_field(Virtual Machine : Name, =)", filter_name) def cleanup(): search.load_filter(filter_name) search.delete_filter() request.addfinalizer(cleanup) assert_no_cfme_exception() search.reset_filter() search.load_filter(filter_name, cancel=True) assert_no_cfme_exception()
def test_filter_save_and_cancel_load(request): navigate_to(Vm, 'VMsOnly') filter_name = fauxfactory.gen_alphanumeric() # Set up the filter search.save_filter("fill_field(Virtual Machine : Name, =)", filter_name) @request.addfinalizer def cleanup(): navigate_to(Vm, 'VMsOnly') search.load_filter(filter_name) search.delete_filter() assert_no_cfme_exception() search.reset_filter() search.load_filter(filter_name, cancel=True) assert_no_cfme_exception()
def test_filter_save_and_cancel_load(request): pytest.sel.force_navigate("infra_vms") filter_name = fauxfactory.gen_alphanumeric() # Set up the filter search.save_filter("fill_field(Virtual Machine : Name, =)", filter_name) @request.addfinalizer def cleanup(): pytest.sel.force_navigate("infra_vms") search.load_filter(filter_name) search.delete_filter() assert_no_cfme_exception() search.reset_filter() search.load_filter(filter_name, cancel=True) assert_no_cfme_exception()
def test_cannot_delete_more_than_once(request): """When Delete button appars, it does not want to go away""" sel.force_navigate("infrastructure_providers") filter_name = generate_random_string() search.save_filter("fill_count(Infrastructure Provider.VMs, >, 0)", filter_name) search.load_filter(filter_name) # circumvent the thing happening in previous test # Delete once if not search.delete_filter(): pytest.fail("Could not delete the filter even first time!") assert_no_cfme_exception() # Try it second time if search.delete_filter(): # If the button is there, it says True # This should not happen msg = "Delete twice accepted!" if is_cfme_exception(): msg += " CFME Exception text: `{}`".format(cfme_exception_text()) pytest.fail(msg)
def test_cannot_delete_more_than_once(request): """When Delete button appars, it does not want to go away""" sel.force_navigate("infra_vms") filter_name = fauxfactory.gen_alphanumeric() search.save_filter("fill_count(Virtual Machine.Files, >, 0)", filter_name) search.load_filter(filter_name) # circumvent the thing happening in previous test # Delete once if not search.delete_filter(): pytest.fail("Could not delete the filter even first time!") assert_no_cfme_exception() # Try it second time if search.delete_filter(): # If the button is there, it says True # This should not happen msg = "Delete twice accepted!" if is_cfme_exception(): msg += " CFME Exception text: `{}`".format(cfme_exception_text()) pytest.fail(msg)
def test_cannot_delete_more_than_once(request, nuke_browser_after_test): """When Delete button appars, it does not want to go away""" navigate_to(Host, 'All') filter_name = fauxfactory.gen_alphanumeric() search.save_filter(get_expression(False).format(0), filter_name) search.load_filter(filter_name) # circumvent the thing happening in previous test # Delete once if not search.delete_filter(): pytest.fail("Could not delete the filter even first time!") assert_no_cfme_exception() # Try it second time if search.delete_filter(): # If the button is there, it says True # This should not happen msg = "Delete twice accepted!" if is_cfme_exception(): msg += " CFME Exception text: `{}`".format(cfme_exception_text()) pytest.fail(msg)
def test_filter_save_and_cancel_load(request, hosts, hosts_with_vm_count, host_with_median_vm): sel.force_navigate("infrastructure_hosts") median_host, median_vm_count = host_with_median_vm filter_name = generate_random_string() # Try save filter search.save_filter("fill_count(Host.VMs, >)", filter_name) def cleanup(): search.load_filter(filter_name) search.delete_filter() request.addfinalizer(cleanup) assert_no_cfme_exception() search.reset_filter() search.load_filter(filter_name, cancel=True) assert_no_cfme_exception()
def test_cannot_delete_more_than_once(request, nuke_browser_after_test): """When Delete button appars, it does not want to go away""" pytest.sel.force_navigate("infrastructure_hosts") filter_name = fauxfactory.gen_alphanumeric() search.save_filter(get_expression(False).format(0), filter_name) search.load_filter(filter_name) # circumvent the thing happening in previous test # Delete once if not search.delete_filter(): pytest.fail("Could not delete the filter even first time!") assert_no_cfme_exception() # Try it second time if search.delete_filter(): # If the button is there, it says True # This should not happen msg = "Delete twice accepted!" if is_cfme_exception(): msg += " CFME Exception text: `{}`".format(cfme_exception_text()) pytest.fail(msg)
def test_cannot_delete_more_than_once(request): """When Delete button appars, it does not want to go away""" sel.force_navigate("infrastructure_hosts") filter_name = generate_random_string() search.save_filter("fill_count(Host.VMs, >, 0)", filter_name) search.load_filter( filter_name) # circumvent the thing happening in previous test # Delete once if not search.delete_filter(): pytest.fail("Could not delete the filter even first time!") assert_no_cfme_exception() # Try it second time if search.delete_filter(): # If the button is there, it says True # This should not happen msg = "Delete twice accepted!" if is_cfme_exception(): msg += " CFME Exception text: `{}`".format(cfme_exception_text()) pytest.fail(msg)
def test_filter_save_and_cancel_load(request, hosts, hosts_with_vm_count, host_with_median_vm): pytest.sel.force_navigate("infrastructure_hosts") median_host, median_vm_count = host_with_median_vm filter_name = fauxfactory.gen_alphanumeric() # Try save filter search.save_filter(get_expression(True), filter_name) @request.addfinalizer def cleanup(): pytest.sel.force_navigate("infrastructure_hosts") search.load_filter(filter_name) search.delete_filter() assert_no_cfme_exception() search.reset_filter() search.load_filter(filter_name, cancel=True) assert_no_cfme_exception()
def test_filter_save_and_cancel_load(request, hosts, hosts_with_vm_count, host_with_median_vm): navigate_to(Host, 'All') median_host, median_vm_count = host_with_median_vm filter_name = fauxfactory.gen_alphanumeric() # Try save filter search.save_filter(get_expression(True), filter_name) @request.addfinalizer def cleanup(): navigate_to(Host, 'All') search.load_filter(filter_name) search.delete_filter() assert_no_cfme_exception() search.reset_filter() search.load_filter(filter_name, cancel=True) assert_no_cfme_exception()
def test_filter_save_and_cancel_load(request, hosts, hosts_with_vm_count, host_with_median_vm): sel.force_navigate("infrastructure_hosts") median_host, median_vm_count = host_with_median_vm filter_name = fauxfactory.gen_alphanumeric() # Try save filter search.save_filter(get_expression(True), filter_name) def cleanup(): sel.force_navigate("infrastructure_hosts") search.load_filter(filter_name) search.delete_filter() request.addfinalizer(cleanup) assert_no_cfme_exception() search.reset_filter() search.load_filter(filter_name, cancel=True) assert_no_cfme_exception()
def test_filter_save_and_cancel_load(request, providers, ssh_client): pytest.sel.force_navigate("infrastructure_providers") filter_name = fauxfactory.gen_alphanumeric() # Set up finalizer request.addfinalizer( lambda: ssh_client.run_rails_command( "\"MiqSearch.where(:description => {}).first.delete\"".format(repr(filter_name)))) # Try save filter search.save_filter("fill_count(Infrastructure Provider.VMs, >)", filter_name) @request.addfinalizer def cleanup(): pytest.sel.force_navigate("infrastructure_providers") search.load_filter(filter_name) search.delete_filter() assert_no_cfme_exception() search.reset_filter() search.load_filter(filter_name, cancel=True) assert_no_cfme_exception()
def test_filter_save_and_cancel_load(request, providers, ssh_client): sel.force_navigate("infrastructure_providers") filter_name = fauxfactory.gen_alphanumeric() # Set up finalizer request.addfinalizer(lambda: ssh_client.run_rails_command( "\"MiqSearch.where(:description => {}).first.delete\"".format( repr(filter_name)))) # Try save filter search.save_filter("fill_count(Infrastructure Provider.VMs, >)", filter_name) def cleanup(): sel.force_navigate("infrastructure_providers") search.load_filter(filter_name) search.delete_filter() request.addfinalizer(cleanup) assert_no_cfme_exception() search.reset_filter() search.load_filter(filter_name, cancel=True) assert_no_cfme_exception()
def test_filter_save_and_cancel_load(rails_delete_filter): # bind filter_name to the function for fixture cleanup test_filter_save_and_cancel_load.filter_name = fauxfactory.gen_alphanumeric() logger.debug('Set filter_name to: {}'.format(test_filter_save_and_cancel_load.filter_name)) # Save filter assert search.save_filter("fill_count(Infrastructure Provider.VMs, >, 0)", test_filter_save_and_cancel_load.filter_name) assert_no_cfme_exception() # Reset Filter assert search.reset_filter() # Load and cancel assert search.load_filter(test_filter_save_and_cancel_load.filter_name, cancel=True) assert_no_cfme_exception()
def test_filter_save_and_cancel_load(single_provider, rails_delete_filter): # bind filter_name to the function for fixture cleanup test_filter_save_and_cancel_load.filter_name = fauxfactory.gen_alphanumeric() logger.debug('Set filter_name to: {}'.format(test_filter_save_and_cancel_load.filter_name)) # Save filter assert search.save_filter("fill_count(Infrastructure Provider.VMs, >, 0)", test_filter_save_and_cancel_load.filter_name) assert_no_cfme_exception() # Reset Filter assert search.reset_filter() # Load and cancel assert search.load_filter(test_filter_save_and_cancel_load.filter_name, cancel=True) assert_no_cfme_exception()
def test_cannot_delete_more_than_once(): """When Delete button appars, it does not want to go away""" filter_name = fauxfactory.gen_alphanumeric() assert search.save_filter("fill_count(Infrastructure Provider.VMs, >, 0)", filter_name) assert search.load_filter(filter_name) # circumvent the thing happening in previous test # Delete once if not search.delete_filter(): pytest.fail("Could not delete the filter even first time!") assert_no_cfme_exception() # Try it second time if search.delete_filter(): # If the button is there, it says True # This should not happen msg = "Delete twice accepted!" if is_cfme_exception(): msg += " CFME Exception text: `{}`".format(cfme_exception_text()) pytest.fail(msg)
def cleanup(): navigate_to(Vm, 'VMsOnly') search.load_filter(filter_name) search.delete_filter()
def cleanup(): search.load_filter(filter_name) search.delete_filter()
def cleanup(): navigate_to(Host, 'All') search.load_filter(filter_name) search.delete_filter()
def cleanup(): sel.force_navigate("infra_vms") search.load_filter(filter_name) search.delete_filter()
def cleanup(): pytest.sel.force_navigate("infra_vms") search.load_filter(filter_name) search.delete_filter()
def cleanup(): pytest.sel.force_navigate("infrastructure_hosts") search.load_filter(filter_name) search.delete_filter()
def cleanup(): sel.force_navigate("infrastructure_providers") search.load_filter(filter_name) search.delete_filter()
def cleanup(): navigate_to(host_collection, 'All') search.load_filter(filter_name) search.delete_filter()