def test_pull_splitter_persistence(location): if location[0] == Server: location = (current_appliance.server, location[1]) navigate_to(*location) # First we move splitter to hidden position by pulling it left twice pull_splitter_left() pull_splitter_left() navigate_to(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 pytest.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 pull_splitter_right() navigate_to(Server, 'Dashboard') navigate_to(*location) # Then check its position if not pytest.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(location): navigate_to(*location) # First we move splitter to hidden position by pulling it left twice pull_splitter_left() pull_splitter_left() navigate_to(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 pytest.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 pull_splitter_right() navigate_to(Server, 'Dashboard') navigate_to(*location) # Then check its position if not pytest.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(location): pytest.sel.force_navigate(location) # First we move splitter to hidden position by pulling it left twice pull_splitter_left() pull_splitter_left() pytest.sel.force_navigate("dashboard") pytest.sel.force_navigate(location) # Then we check hidden position splitter if not pytest.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 pull_splitter_right() pytest.sel.force_navigate("dashboard") pytest.sel.force_navigate(location) # Then check its position if not pytest.sel.elements("//div[@id='left_div'][contains(@class, {})]" .format(unescape(quoteattr(position)))): pytest.fail("Splitter did not persist when on " + str(position) + " position!")