def test_pull_splitter_persistence(request, appliance, model_object, destination): """ Polarion: assignee: pvala caseimportance: low casecomponent: WebUI initialEstimate: 1/20h Bugzilla: 1380443 """ splitter = Splitter(parent=appliance.browser.widgetastic) request.addfinalizer(splitter.reset) if model_object == Server: model_object = appliance.server elif issubclass(model_object, BaseCollection): model_object = model_object(appliance) navigate_to(model_object, destination) # First we move splitter to hidden position by pulling it left twice splitter.pull_left() splitter.pull_left() navigate_to(appliance.server, 'Dashboard') try: navigate_to(model_object, destination) except (TypeError, CannotScrollException, TimedOutError): # this exception is expected here since # some navigation commands try to use accordion when it is hidden by splitter # and accordion is often part of is_displayed check pass # Then we check hidden position splitter selenium = appliance.browser.widgetastic.selenium if not selenium.find_element_by_xpath("//div[@id='left_div'][contains(@class, 'hidden-md')]"): pytest.fail("Splitter did not persist when on hidden position!") # Then we iterate over all the other positions for position in ["col-md-2", "col-md-3", "col-md-4", "col-md-5"]: # Pull splitter left splitter.pull_right() navigate_to(appliance.server, 'Dashboard') navigate_to(model_object, destination) # Then check its position if not selenium.find_element_by_xpath( "//div[@id='left_div'][contains(@class, {})]".format( unescape(quoteattr(position)))): pytest.fail("Splitter did not persist when on '{}' position!".format(position))
def test_pull_splitter_persistence(request, location, appliance): splitter = Splitter(parent=appliance.browser.widgetastic) request.addfinalizer(splitter.reset) if location[0] == Server: location = (current_appliance.server, location[1]) elif issubclass(location[0], BaseCollection): location = (location[0](appliance), location[1]) navigate_to(*location) # TODO: When all WT is complete, use the view for this splitter.pull_left() splitter.pull_left() navigate_to(appliance.server, 'Dashboard') try: navigate_to(*location) except (TypeError, CannotScrollException): # this exception is expected here since # some navigation commands try to use accordion when it is hidden by splitter pass # Then we check hidden position splitter if not sel.elements("//div[@id='left_div'][contains(@class, 'hidden-md')]"): pytest.fail("Splitter did not persist when on hidden position!") # Then we iterate over all the other positions for position in ["col-md-2", "col-md-3", "col-md-4", "col-md-5"]: # Pull splitter left splitter.pull_right() navigate_to(appliance.server, 'Dashboard') navigate_to(*location) # Then check its position if not sel.elements("//div[@id='left_div'][contains(@class, {})]" .format(unescape(quoteattr(position)))): pytest.fail("Splitter did not persist when on " + str(position) + " position!")
def test_pull_splitter_persistence(request, appliance, model_object, destination): """ Polarion: assignee: anikifor caseimportance: low initialEstimate: 1/20h Bugzilla: 1380443 """ splitter = Splitter(parent=appliance.browser.widgetastic) request.addfinalizer(splitter.reset) if model_object == Server: model_object = appliance.server elif issubclass(model_object, BaseCollection): model_object = model_object(appliance) navigate_to(model_object, destination) # First we move splitter to hidden position by pulling it left twice splitter.pull_left() splitter.pull_left() navigate_to(appliance.server, 'Dashboard') try: navigate_to(model_object, destination) except (TypeError, CannotScrollException, TimedOutError): # this exception is expected here since # some navigation commands try to use accordion when it is hidden by splitter # and accordion is often part of is_displayed check pass # Then we check hidden position splitter selenium = appliance.browser.widgetastic.selenium if not selenium.find_element_by_xpath( "//div[@id='left_div'][contains(@class, 'hidden-md')]"): pytest.fail("Splitter did not persist when on hidden position!") # Then we iterate over all the other positions for position in ["col-md-2", "col-md-3", "col-md-4", "col-md-5"]: # Pull splitter left splitter.pull_right() navigate_to(appliance.server, 'Dashboard') navigate_to(model_object, destination) # Then check its position if not selenium.find_element_by_xpath( "//div[@id='left_div'][contains(@class, {})]".format( unescape(quoteattr(position)))): pytest.fail( "Splitter did not persist when on '{}' position!".format( position))
def test_pull_splitter_persistence(request, location, appliance): splitter = Splitter(parent=appliance.browser.widgetastic) request.addfinalizer(splitter.reset) if location[0] == Server: location = (current_appliance.server, location[1]) elif issubclass(location[0], BaseCollection): location = (location[0](appliance), location[1]) navigate_to(*location) # TODO: When all WT is complete, use the view for this splitter.pull_left() splitter.pull_left() navigate_to(appliance.server, 'Dashboard') try: navigate_to(*location) except (TypeError, CannotScrollException): # this exception is expected here since # some navigation commands try to use accordion when it is hidden by splitter pass # Then we check hidden position splitter if not sel.elements( "//div[@id='left_div'][contains(@class, 'hidden-md')]"): pytest.fail("Splitter did not persist when on hidden position!") # Then we iterate over all the other positions for position in ["col-md-2", "col-md-3", "col-md-4", "col-md-5"]: # Pull splitter left splitter.pull_right() navigate_to(appliance.server, 'Dashboard') navigate_to(*location) # Then check its position if not sel.elements( "//div[@id='left_div'][contains(@class, {})]".format( unescape(quoteattr(position)))): pytest.fail("Splitter did not persist when on " + str(position) + " position!")
def test_pull_splitter_persistence(request, appliance, model_object, destination): splitter = Splitter(parent=appliance.browser.widgetastic) request.addfinalizer(splitter.reset) if model_object == Server: model_object = appliance.server elif issubclass(model_object, BaseCollection): model_object = model_object(appliance) navigate_to(model_object, destination) # First we move splitter to hidden position by pulling it left twice splitter.pull_left() splitter.pull_left() navigate_to(appliance.server, 'Dashboard') try: navigate_to(model_object, destination) except (TypeError, CannotScrollException): # this exception is expected here since # some navigation commands try to use accordion when it is hidden by splitter pass # Then we check hidden position splitter if not sel.elements( "//div[@id='left_div'][contains(@class, 'hidden-md')]"): pytest.fail("Splitter did not persist when on hidden position!") # Then we iterate over all the other positions for position in ["col-md-2", "col-md-3", "col-md-4", "col-md-5"]: # Pull splitter left splitter.pull_right() navigate_to(appliance.server, 'Dashboard') navigate_to(model_object, destination) # Then check its position if not sel.elements( "//div[@id='left_div'][contains(@class, {})]".format( unescape(quoteattr(position)))): pytest.fail("Splitter did not persist when on " + str(position) + " position!")
class datastore(Accordion): # noqa tree = ManageIQTree() splitter = Splitter()