Assert an element exists matching the given selector within the given time
    period.

def wait_for_element_by_selector(self, selector, seconds):
    """
    Assert an element exists matching the given selector within the given time
    period.
    """

    def assert_element_present():
        """Assert an element matching the given selector exists."""
        if not find_elements_by_jquery(world.browser, selector):
            raise AssertionError("Expected a matching element.")

    wait_for(assert_element_present)(timeout=int(seconds))